Sonarr keeps stalling

Sonarr version (exact version): 4.0.1.929
Mono version (if Sonarr is not running on Windows): .NET Version: 6.0.13
OS: Debian 12
Debug logs:

Description of issue:
Every time sonarr (re)starts it will only scan for 3 TV shows and stop! I can restart it, it will scan for 3 new ones and agian, stop.
When looking at events, i can only see the last event, something like:

[NCIS: Los Angeles] was recently added, performing post-add actions

And that’s it, until next restart when new TV Show is scanned and added, and in the loop it goes.

When looking at the “Tasks” i can see 2-3 “Refresh Series” tasks runnning and “Process Monitored Downloads” running but that’s pretty much it.

Sonarr is running as proxmox container, I’ve tried manual installation inside container on Ubuntu 22 and also reinstalled using Proxmox Helper Scripts but the issue is the same.

TV Shows are mounted on /tvshows directory as NFS share, all permissions are active, sonarr user has access to create folders, files, rename folders and files - pretty much all permissions (I’ve tested it)

I have no idea what to do, any help would be greatly appreciated.

Posting an update (and hoping someone will pickup and help)

I’ve set Settings → Media Management → “Rescan Series Folder after Refresh” to “After Manual Refresh” and I’ve refreshed 1 TV Show - 30 Rock.
It got stuck on “Refresh Series” task and that task is preventing for example app upgrade.
When i set that to “Never” it refreshes but never scans, so the tasks is completed successfully.

So for some reason, whenever scanning is in progress, task will get stuck on even 1 show.

Also, I’ve enabled trace logs and checked the logs after I’ve hit the manual refresh button for show. UI is showing “Scanning 30 Rock” but log is showing:

24-03-01 16:01:35.4|Info|DiskScanService|Completed scanning disk for 30 Rock

Also, task is stuck, never completes.
I’ve updated Sonarr to 4.0.2.1183 and it’s the same problem.

2024-02-25 23:41:30.2|Debug|ExistingMetadataImporter|Looking for existing metadata in /tvshows/NCIS Los Angeles
2024-02-25 23:41:30.2|Debug|Parser|Parsing string 'tvshow.nfo'
2024-02-25 23:41:30.2|Debug|Parser|Unable to parse tvshow.nfo
2024-02-25 23:41:30.2|Debug|Parser|Parsing string 'tvshow.nfo'
2024-02-25 23:41:30.2|Debug|Parser|Unable to parse tvshow.nfo
2024-02-25 23:41:30.2|Debug|Parser|Parsing string 'NCIS Los Angeles S09E07 The Silo.nfo'
2024-02-25 23:41:30.2|Trace|Parser|^(?<title>.+?)(?:(?:[-_\W](?<![()\[!]))+S?(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))(?:[ex]|\W[ex]){1,2}(?<episode>\d{2,3}(?!\d+))(?:(?:\-|[ex]|\W[ex]|_){1,2}(?<episode>\d{2,3}(?!\d+)))*)(?:[-_. ]|$)(?!\\)
2024-02-25 23:41:30.2|Debug|Parser|Episode Parsed. NCIS Los Angeles - S09E07 
2024-02-25 23:41:30.2|Debug|Parser|Languages parsed: Unknown
2024-02-25 23:41:30.2|Debug|QualityParser|Trying to parse quality for 'NCIS Los Angeles S09E07 The Silo.nfo'
2024-02-25 23:41:30.2|Debug|Parser|Quality parsed: Unknown v1
2024-02-25 23:41:30.2|Debug|Parser|Release Group parsed: 

Sonarr starts looking for metadata files, finds one NFO for an episode and that process never completes.

I’m not able to reproduce any issues importing existing metadata files after the series is refreshed.

That’s because it’s still processing the extra files on disk, the stage is normally done within seconds, but for some reason with your setup (or the extra files) it gets hung up.

What do those NFO files contain?
If you temporarily remove those NFO files does it finish the refresh/rescan properly?

Thanks for replying back.

I believe those nfo files were originally created by kodi before I’ve used MySQL as a library, but i might’ve been mistaken. Anywhere, here is a preview of NCIS Los Angeles S09E07 The Silo.nfo:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<episodedetails>
    <title>The Silo</title>
    <showtitle>NCIS: Los Angeles</showtitle>
    <userrating>0</userrating>
    <top250>0</top250>
    <season>9</season>
    <episode>7</episode>
    <displayseason>-1</displayseason>
    <displayepisode>-1</displayepisode>
    <outline></outline>
    <plot>Kensi is transported to a missile launch facility to help thwart a takeover of nuclear weapons.</plot>
    <tagline></tagline>
    <runtime>0</runtime>
    <thumb>http://image.tmdb.org/t/p/original/eQMa3q3ImR2Wq6FYaAn4lCqMjlJ.jpg</thumb>
    <thumb>http://image.tmdb.org/t/p/original/udetJzp3wxIHXTjWeh3akcFgs8P.jpg</thumb>
    <mpaa>TV-14</mpaa>
    <playcount>1</playcount>
    <lastplayed>2020-04-12</lastplayed>
    <id>1392500</id>
...

Let’s try to narrow it down since i can replicate this issue to a single TV Show that doesn’t contain any extra .nfo files. TV Show in question: 30 Rock (2006).
I’ve used linux ‘find’ to locate any nfo files and it found only ‘tvshow.nfo’ that is generated by sonarr:

root@sonarr:/var/lib/sonarr/logs# find /tvshows/30\ Rock\ \(2006\)\ Season\ 1-7\ S01-S07\ \(1080p\ AMZN\ WEBRip\ x265\ HEVC\ 10bit\ AAC\ 5.1\ Silence\)/ -iname '*.nfo'
/tvshows/30 Rock (2006) Season 1-7 S01-S07 (1080p AMZN WEBRip x265 HEVC 10bit AAC 5.1 Silence)/tvshow.nfo
  • I’ve removed the .nfo nonetheless.
  • I’ve set “Rescan Series Folder after Refresh” to “After Manual Refresh”
  • Stopped sonarr
  • Removed all logs
  • Started sonarr
  • Clicked on Refresh button for series 30 Rock
  • It got stuck in task “Refresh Series”, nothing (appears to be) useful in log files.

New log files here:
sonarr.debug.txt
sonarr.trace.txt
sonarr.txt

I mean sure, rescan does appear to be completed but back when it had more than 3 TV Shows to scan it gets stuck and never proceeds further.
I got all the TV Shows scanned only after many, many service restarts.

But the stuck task when it happens on a regular/scheduled trigger will cause other tasks to stall.

Some environment info beside what’s mentioned in original thread:

  • Sonarr is running as root (but originally tried to run it as same owner:group as where TV Shows are originally located)
  • TV Shows are mounted using NFS Share in fstab entry:
    <ip address>:/mnt/2TB/media/Serije /tvshows nfs nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s
  • Original TV Shows owner:group is 1000:1001
  • Sonarr can create new files and folders in /tvshows

Feel free to ask any questions that may interest you.

Why is the series for 30 Rock the release name of the multi-season pack you grabbed?

2024-03-03 11:56:01.7|Debug|MetadataService|Writing Series Metadata to: /tvshows/30 Rock (2006) Season 1-7 S01-S07 (1080p AMZN WEBRip x265 HEVC 10bit AAC 5.1 Silence)/tvshow.nfo

Looks like this is where it stalls, if you turn off metadata file creation does it get stuck there still?

It’s the name when I’ve extracted when downloading from the torrent.
However, interestingly, when I’ve turned off metadata file creation, it doesn’t get stuck!

I’m not sure why it gets stuck there as file appears to be written entirely! It has content and everything.
Now that the metadata file creation is disabled, all is working normally. Weird!

Thanks for your help! But what would be the root cause behind this?