Stop sonarr deleting files

Version 3.0.6.1342

Mono Version 6.8.0.105

Is there anyway to stop sonarr deleting files all together? its driving me nuts Ever since V3

Just to be clear, the recycle bin for Sonar is set as “sonar Brainfart”
Thats where the files end up so its definitely sonarr.
Basic timeline is this.
Sonar with Sabnzbd, downloads a file, renames it and puts it in its correct folder. it might do this for 2 or 3 episodes.
It will then randomly delete some or all the files in that folder, placing them in the brainfart folder, and download the NEXT episode. It does not download another copy, just shows it as missing.
The event log only shows the following:
“Couldn’t import episode /Volumes/Media/TV/@#@/Season 4/#$# S04E02 .mkv: Episode file path does not exist”

Actual file name removed by me for this post purposes.I believe this log entry is a result of sonarr moving the file first, ie it deletes it then logs that it can’t find it.

Sonarr does this to random folders, random episodes. sometimes after i put them back it leaves them alone, sometimes it’ll delete them again a day or so later…

A tab please, that says DO NOT DELETE ANYTHING please???

From the template:

**Debug logs**

Additional Information:
- Information on the log files is here: https://wiki.servarr.com/sonarr/troubleshooting#logging-and-log-files
- Make sure debug logging is enabled in settings
- Post the log file, not a line or two, or just the error from the Logs table
- Post the full log to hone of the sites recommended in Logging and Log Files section of the wiki
- Do not post them directly here. Post in .txt not .doc, .rtf or some other formatted document

if it existed, and you ticked it, then sonarr would never be able to upgrade - in which case it doesnt need to exist, you may as well just disable quality upgrades and preferred words instead to get the same result - no new files, just the first one downloaded.

this is the second post about weird deletions though so please enable debug/trace logs so it can be tracked down asap.

rhom, you’ve nailed it in one.
I DON’T want upgrades. I Do have it disabled.
I DON’T want preferred words, whatever that may be. I do have it disabled.
I DO just want the first copy that downloads.
Some shows ill keep and watch a second time, others I’ll delete.
I WANT to be the one who decides what’s deleted.

Debug is now on, we’ll wait until the correct moon phase or whatever and it deletes some episodes and ill send it through.

Could be Propers and Repacks?

It doesn’t delete and re download. It just deletes. It will not download another copy automatically, just marks it as missing.
If I try to download another copy manually, sabnzbd will usually pause it as a duplicate because it knows it’s already downloaded it.

I’ve been through settings many times. I’ve disabled everything I can that looks like it may be able to delete a file.
This only occurs with sonarr v3. When it was first released, I installed it only to have it delete 40+ episodes of various shows. I reinstalled the last version 2.
For whatever reason I had to update to V3 and this rot started immediately. It doesn’t happen a lot, usually with the first 2 or 3 episodes of a new season.
For example, one show downloaded episode 1. The following week episode 2 downloaded and sonarr deleted episode 1. I moved it back from the brain fart folder and it remained happily until episode 3 downloaded whereby episodes 1 and 2 were deleted :roll_eyes:
There’s 3Tb of free space btw.

There is absolutely 0 code that would cause sonarr to randomly and abruptly delete episodes.

If you truly believe it is sonarr itself deleting the files - then provide trace logs of it doing so and a screenshot of the impacted episodes history.

Sounds like you have something else messing with your library under sonarr’s nose or downloads (upgrades) removed from your client while sonarr Is trying to import them.

Fair enough. I’ve only turned on debug level logging yesterday. We’ll have to wait for something to happen. Might be today, might be next week.
2 things though to consider.
Only sonarr has the “ sonarr brainfart “ folder entered as its recycling bin. That’s where the files end up.
This behaviour started with and only occurs with sonarr V3.
If I reinstall v2 the behaviour stops.
The only other apps that interact with media are sabnzbd and Plex.
M1 iMac. Also occurred on previous 2009 iMac.

Ok, its deleted a couple of episodes. I have a debug text file.
What now?
I have no idea what those sites in the wiki are, how they work or what I’m supposed to do with them.

Heres the bit of log that relevant to 1 of the deleted episodes. It was downloaded on the 9th October, been residing happily on the drive since then until 1223 today.

2021-10-19 12:23:35.1|Debug|Parser|Parsing string ‘NCIS S19E03 Road to Nowhere.mkv’
2021-10-19 12:23:35.1|Debug|Parser|Episode Parsed. NCIS - S19E03
2021-10-19 12:23:35.1|Debug|Parser|Language parsed: English
2021-10-19 12:23:35.1|Debug|QualityParser|Trying to parse quality for NCIS S19E03 Road to Nowhere.mkv
2021-10-19 12:23:35.1|Debug|Parser|Quality parsed: HDTV-720p v1
2021-10-19 12:23:35.1|Debug|Parser|Release Group parsed:
2021-10-19 12:23:35.1|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E03 Road to Nowhere.mkv
2021-10-19 12:23:35.1|Debug|AggregateLanguage|Using language: English
2021-10-19 12:23:35.1|Debug|QualityParser|Trying to parse quality for ncis.s19e05.720p.hdtv.x264-syncopy
2021-10-19 12:23:35.1|Debug|AggregateQuality|Using quality: HDTV-720p v1
2021-10-19 12:23:35.1|Debug|AbsoluteEpisodeNumberSpecification|Series type is not Anime, skipping check
2021-10-19 12:23:35.1|Debug|EpisodeTitleSpecification|Episode aired more than 1 day ago
2021-10-19 12:23:35.1|Debug|MatchesFolderSpecification|No folder ParsedEpisodeInfo, skipping check
2021-10-19 12:23:35.1|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E03 Road to Nowhere.mkv
2021-10-19 12:23:35.1|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.1|Debug|UpgradeSpecification|This file isn’t a quality upgrade for all episodes. Skipping /Volumes/Media/TV/Ncis/Season 19/NCIS S19E03 Road to Nowhere.mkv
2021-10-19 12:23:35.1|Debug|ImportDecisionMaker|File rejected for the following reasons: [Permanent] Not an upgrade for existing episode file(s)
2021-10-19 12:23:35.1|Debug|Parser|Parsing string ‘NCIS S19E04 Great Wide Open.mkv’

Take the debug log with the context and paste it into one of the pastebin-esque sites shared on the wiki - then share that link here

the template also covers this… not sure where the confusion lies.

also those logs show nothing at all related to sonarr deleting anything

if anything it appears to show the file exists, and that sonarr did not want to replace it with that new download (not sure why it would have downloaded it if it wasnt an upgrade?)

find the log that covers that timeframe (activity > history, or the history tab for the episode), then search it for “to recycling bin”, or the name of the recycle bin folder, “sonar Brainfart” in your case, to find the line where its deleted, then look just above that to see why it was deleted (new import), and just below it to see why it failed.

if anything it appears to show the file exists, and that sonarr did not want to replace it with that new download (not sure why it would have downloaded it if it wasnt an upgrade?)

find the log that covers that timeframe (activity > history, or the history tab for the episode), then search it for “to recycling bin”, or the name of the recycle bin folder, “sonar Brainfart” in your case, to find the line where its deleted, then look just above that to see why it was deleted (new import), and just below it to see why it failed.

post it here if you need help working it out

It didn’t download it. That episode has been on the server for 2 weeks.

The last modified date of the file in the recycle bin matches the time in that log.

2021-10-19 12:23:34.6|Debug|Parser|Parsing string ‘ncis s19e05 720p hdtv x264-syncopy’
2021-10-19 12:23:34.6|Debug|Parser|Episode Parsed. ncis - S19E05
2021-10-19 12:23:34.6|Debug|Parser|Language parsed: English
2021-10-19 12:23:34.6|Debug|QualityParser|Trying to parse quality for ncis s19e05 720p hdtv x264-syncopy
2021-10-19 12:23:34.6|Debug|Parser|Quality parsed: HDTV-720p v1
2021-10-19 12:23:34.6|Debug|Parser|Release Group parsed: syncopy
2021-10-19 12:23:34.6|Debug|TrackedDownloadService|Tracking ‘Sabnzbd:ncis s19e05 720p hdtv x264-syncopy’: ClientState=Completed SonarrStage=Downloading Episode=‘ncis - S19E05 HDTV-720p v1’ OutputPath=/Volumes/Media/TV/Ncis/Season 19.
2021-10-19 12:23:34.6|Debug|Parser|Parsing string ‘ncis s19e05 720p hdtv x264-syncopy’
2021-10-19 12:23:34.6|Debug|Parser|Episode Parsed. ncis - S19E05
2021-10-19 12:23:34.6|Debug|Parser|Language parsed: English
2021-10-19 12:23:34.6|Debug|QualityParser|Trying to parse quality for ncis s19e05 720p hdtv x264-syncopy
2021-10-19 12:23:34.6|Debug|Parser|Quality parsed: HDTV-720p v1
2021-10-19 12:23:34.6|Debug|Parser|Release Group parsed: syncopy
2021-10-19 12:23:34.6|Debug|Api|[GET] /api/v3/command: 200.OK (1 ms)
2021-10-19 12:23:34.6|Debug|Api|[GET] /api/v3/queue/details?episodeIds=9880&episodeIds=9947&episodeIds=9875&episodeIds=10029&episodeIds=10020&episodeIds=9950&episodeIds=9935&episodeIds=9953&episodeIds=9954&episodeIds=9944&episodeIds=10030&episodeIds=9951&episodeIds=10022&episodeIds=9873&episodeIds=9952&episodeIds=9877&episodeIds=10006&episodeIds=10013&episodeIds=9945&episodeIds=10050&episodeIds=10034&episodeIds=10026&episodeIds=10007&episodeIds=10033&episodeIds=9940&episodeIds=10011&episodeIds=10014&episodeIds=10043&episodeIds=10012&episodeIds=10044&episodeIds=9941&episodeIds=10027&episodeIds=10045: 200.OK (4 ms)
2021-10-19 12:23:34.7|Debug|DownloadedEpisodesImportService|Processing path: /Volumes/Media/TV/Ncis/Season 19
2021-10-19 12:23:34.7|Debug|Parser|Rejected Season Folder Release Title: Season 19
2021-10-19 12:23:34.7|Debug|DiskScanService|Scanning ‘/Volumes/Media/TV/Ncis/Season 19’ for video files
2021-10-19 12:23:34.7|Debug|DiskScanService|6 video files were found in /Volumes/Media/TV/Ncis/Season 19
2021-10-19 12:23:34.8|Debug|ImportDecisionMaker|Analyzing 6/6 files.
2021-10-19 12:23:34.8|Debug|Parser|Parsing string ‘ncis s19e05 720p hdtv x264-syncopy’
2021-10-19 12:23:34.8|Debug|Parser|Episode Parsed. ncis - S19E05
2021-10-19 12:23:34.8|Debug|Parser|Language parsed: English
2021-10-19 12:23:34.8|Debug|QualityParser|Trying to parse quality for ncis s19e05 720p hdtv x264-syncopy
2021-10-19 12:23:34.8|Debug|Parser|Quality parsed: HDTV-720p v1
2021-10-19 12:23:34.8|Debug|Parser|Release Group parsed: syncopy
2021-10-19 12:23:34.8|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the Water.mkv
2021-10-19 12:23:34.8|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:34.8|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the water.mp4
2021-10-19 12:23:34.9|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:34.9|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E02 Nearly Departed.mkv
2021-10-19 12:23:34.9|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:34.9|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E03 Road to Nowhere.mkv
2021-10-19 12:23:35.0|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.0|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E04 Great Wide Open.mkv
2021-10-19 12:23:35.0|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.0|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/Ncis S19E05.mkv
2021-10-19 12:23:35.0|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.0|Debug|Parser|Parsing string ‘NCIS S19E01 Blood in the Water.mkv’
2021-10-19 12:23:35.0|Debug|Parser|Episode Parsed. NCIS - S19E01
2021-10-19 12:23:35.0|Debug|Parser|Language parsed: English
2021-10-19 12:23:35.0|Debug|QualityParser|Trying to parse quality for NCIS S19E01 Blood in the Water.mkv
2021-10-19 12:23:35.0|Debug|Parser|Quality parsed: HDTV-720p v1
2021-10-19 12:23:35.0|Debug|Parser|Release Group parsed:
2021-10-19 12:23:35.0|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the Water.mkv
2021-10-19 12:23:35.0|Debug|AggregateLanguage|Using language: English
2021-10-19 12:23:35.0|Debug|QualityParser|Trying to parse quality for ncis.s19e05.720p.hdtv.x264-syncopy
2021-10-19 12:23:35.0|Debug|AggregateQuality|Using quality: HDTV-720p v1
2021-10-19 12:23:35.0|Debug|AbsoluteEpisodeNumberSpecification|Series type is not Anime, skipping check
2021-10-19 12:23:35.0|Debug|EpisodeTitleSpecification|Episode aired more than 1 day ago
2021-10-19 12:23:35.0|Debug|MatchesFolderSpecification|No folder ParsedEpisodeInfo, skipping check
2021-10-19 12:23:35.0|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the Water.mkv
2021-10-19 12:23:35.0|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.1|Debug|ImportDecisionMaker|File accepted
2021-10-19 12:23:35.1|Debug|Parser|Parsing string ‘NCIS S19E01 Blood in the water.mp4’
2021-10-19 12:23:35.1|Debug|Parser|Episode Parsed. NCIS - S19E01
2021-10-19 12:23:35.1|Debug|Parser|Language parsed: English
2021-10-19 12:23:35.1|Debug|QualityParser|Trying to parse quality for NCIS S19E01 Blood in the water.mp4
2021-10-19 12:23:35.1|Debug|Parser|Quality parsed: SDTV v1
2021-10-19 12:23:35.1|Debug|Parser|Release Group parsed:
2021-10-19 12:23:35.1|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the water.mp4
2021-10-19 12:23:35.1|Debug|AggregateLanguage|Using language: English
2021-10-19 12:23:35.1|Debug|QualityParser|Trying to parse quality for ncis.s19e05.720p.hdtv.x264-syncopy
2021-10-19 12:23:35.1|Debug|AggregateQuality|Using quality: SDTV v1
2021-10-19 12:23:35.1|Debug|AbsoluteEpisodeNumberSpecification|Series type is not Anime, skipping check
2021-10-19 12:23:35.1|Debug|EpisodeTitleSpecification|Episode aired more than 1 day ago
2021-10-19 12:23:35.1|Debug|MatchesFolderSpecification|No folder ParsedEpisodeInfo, skipping check
2021-10-19 12:23:35.1|Debug|VideoFileInfoReader|Getting media info from /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the water.mp4
2021-10-19 12:23:35.1|Debug|DetectSample|Runtime is over 90 seconds
2021-10-19 12:23:35.1|Debug|UpgradeSpecification|This file isn’t a quality upgrade for all episodes. Skipping /Volumes/Media/TV/Ncis/Season 19/NCIS S19E01 Blood in the water.mp4
2021-10-19 12:23:35.1|Debug|ImportDecisionMaker|File rejected for the following reasons: [Permanent] Not an upgrade for existing episode file(s)

From Activity history
Name

/Volumes/Media/TV/NCIS/Season 19/NCIS S19E01 Blood in the Water.mkv

Reason

File was deleted to import an upgrade

Episode 5 had just completed downloading. Episodes 1,2 and 4 were deleted. There were no other episodes downloaded.

Your logs and your history do not match

The logs do not indicate anything was deleted.

also where does anything say the logs should be posted in forum posts and only be a few dozen lines if even?

It would appear you did not read the template for providing logs nor can follow the 6 steps on the wiki for providing logs

Thanks for the tune up.

From my last post. Please refer to section, Activity History
“File was deleted to import an upgrade “

Only there was no file downloaded and no upgrade.

History will not be updated without logs

Anything and everything Sonarr does is logged.

except it did - thats an import log entry.

do you have sabnzbd setup to move files to the series/season folder? just that it appears to have told sonarr to scan the season folder for that series as part of the import process - so it sees all those existing episode files, not just the new episode you downloaded and tries to import them, which it wont be able to do as it will delete them and then they wont exist.

ie youre downloading s19e05 but the output path is the actual folder that sonarr would move it to - basically it looks like youre downloading into the media folder which is a huge problem (but i thought sonarr checked for this and spat out errors about downloading to a root path) and why youre not meant to do it.

2021-10-19 12:23:34.6|Debug|TrackedDownloadService|Tracking ‘Sabnzbd:ncis s19e05 720p hdtv x264-syncopy’: ClientState=Completed SonarrStage=Downloading Episode=‘ncis - S19E05 HDTV-720p v1’ OutputPath=/Volumes/Media/TV/Ncis/Season 19.

that download is complete so sonarr is trying to import it, but instead of importing it from a download folder it appears to be importing the existing season folder that contains all your current episodes as well, so it will see those and try to import them

2021-10-19 12:23:34.7|Debug|DownloadedEpisodesImportService|Processing path: /Volumes/Media/TV/Ncis/Season 19

please post (attach/link) the entire log file(s), as theres bound to be more in there to confirm if thats happening, and the delete should be in there somewhere as well.

I’ll check but as far as I’m aware sabnzbd downloads into a download folder on the Mac hdd titled complete.
If your suggestion is correct, why does it only happen occasionally and to several shows,but by no means all shows?
Edit: Download folder from sabnzbd is /Volumes/Macintosh HD/Users/username/Downloads/complete

Is sorting enabled in SAB?
Is that we’re your categories in SAB are set to as well?