How to stop sonarr from deleting a file on a failed import?

2.0.0.5085
4.2.3
Linux Mint 18.3
https://pastebin.com/4WcwkXPY

I’ve seen this happened a lot with Sonarr and was wondering how to prevent it.

Take for example Bizarre Foods. A series that is totally mangled on TheXEM. When I go to import the latest episode (s19e04), I get the mapping error but am still given the option to import it. In my mind, Sonarr should make a ‘best effort’ attempt, rename it and place it in the proper directory. If -it- can’t grab the episode information, Plex will. But, it fails the import and permanently deletes the file.

To avoid it permanently deleting the file, I tried setting up the trash bin location in sonarr so I can dig the file back out of there. I pointed sonarr to .local/share/Trash and it said the directory doesn’t exist. This is probably a permission issue but sonarr is running under my account so I’m baffled as to why it can’t reach a directory that I can access via the terminal.

If an import isn’t successful, nothing is deleted.

Looking at the logs, your manual import triggers a deletion of /mnt/md0/TV Shows/Bizarre Foods/Season 18/Bizarre Foods - S18E04 - Cajun Country Trail SDTV.mp4 in order to import /home/gene/Downloads/Bizarre.Foods.S19E04.Italys.Amalfi.Coast.HDTV.x264-NY2.mp4 in it’s place. The file is permanently deleted because the recycle bin hasn’t been configured.

When manually importing it looks like you should have selected the episode for season 19 episode 4 so the file for season 18 episode 4 wasn’t deleted.

What is unclear is whether the xem mapping is wildly out of date (since it stops after season 11) or it should no longer apply. The first would need to be resolved by speaking with the XEM mods, the latter might be something we need to fix (if possible). @Taloth given the mappings are out of date by 8 seasons I think the extrapolation may be incorrect.

Since I can’t get the recycle bin working (due to a weird permission issue?) maybe add an option in Sonarr that says…“if any sort of import fails for whatever reason, leave the file in the source directory.”

When manually importing it looks like you should have selected the episode for season 19 episode 4 so the file for season 18 episode 4 wasn’t deleted.

I thought that’s what I did? I selected s19e04 to be imported, the import failed and the file was no longer in my download folder.

Because after the import failed, I was just going to manually copy s19e04 into the target directory and format the file name properly and just let Plex index it but since the file was deleted by sonarr, I couldn’t.

If I’m not understanding you, I apologize. Sitting here in bed with my iPad while watching some Olympics. I’m a little distracted. :slight_smile:

It didn’t fail to import though, it was successful.

18-2-14 19:47:12.5|Debug|EpisodeFileMovingService|Moving episode file: /home/gene/Downloads/Bizarre.Foods.S19E04.Italys.Amalfi.Coast.HDTV.x264-NY2.mp4 to /mnt/md0/TV Shows/Bizarre Foods/Season 18/Bizarre Foods - S18E04 - Cajun Country Trail SDTV.mp4
18-2-14 19:47:12.5|Debug|DiskTransferService|Move [/home/gene/Downloads/Bizarre.Foods.S19E04.Italys.Amalfi.Coast.HDTV.x264-NY2.mp4] > [/mnt/md0/TV Shows/Bizarre Foods/Season 18/Bizarre Foods - S18E04 - Cajun Country Trail SDTV.mp4]
18-2-14 19:47:12.7|Debug|EpisodeService|Linking [Season 18/Bizarre Foods - S18E04 - Cajun Country Trail SDTV.mp4] > [[1996]Cajun Country Trail]

Based on the logs (snippet above) the manual import was told to import that file to S18E04, not S19E04 (The XEM is causing the mapping, but manual import let’s you override that, just click the season/episode columns to select the correct episode).

DOH! Now I understand, thanks!

I checked and you’re right, it moved it to s18e04. Sorry. :frowning:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.