Apologies for posting a bug report here, I can’t see a place in Trello to do so.
There may be a bug in the path validation code during series deletion. I deleted a bunch of series’ last night, and found today that I was missing lots of other files (>400). Looking at the logs, I found a lot of normal series deletion entries (as expected), but within them where the following mysterious entries:
Attempting to send ‘/’ to recycle bin
Recycling Bin has not been configured, deleting permanently. /
… some more correct entries … then:
Attempting to send ‘/mnt/media/TV/’ to recycling bin
Recycling Bin has not been configured, deleting permanently. /mnt/media/TV
Followed by more correct entries.
Thankfully, for reasons unknown to me, it hasn’t deleted all the things it could have, so I suspect it has come kind of failsafe limit (timeout?).
I can’t say what has caused this, could it be a database issue where the path for a given series was stored incorrectly, or could it be the series name contained odd characters that weren’t escaped, but ultimately the deletion code could probably do with some additional validation to be sure it’s not deleting things it shouldn’t be.
Thanks for the reply, markus101. Unfortunately I don’t have any prior backup copies of the database as I only installed this (migrating from sickbeard) a few hours prior to the issue. Are the entries still in the database, perhaps with a ‘deleted’ flag, or does sonarr actually delete the records?
I’ve posted relevant (and surrounding) logs on pastebin http://pastebin.com/5rhfGvJB but there doesn’t seem to be anything surrounding the entries that’s helpful. I’ve prepended the interesting lines with “* -->”. I noticed a couple of other things in the logs, which are probably not relevant, but I’ve posted them there also.
No they are deleted (if they weren’t it would cause conflicts later if the same series was re-added).
What series and paths did you delete from Sonarr? You mentioned possible specially characters, causing issues, but without knowing what they are I can’t even begin to think what it might have caused.
There are also log files (instead of copying the contents of the table), if ((debug logging)) was on they would have a lot more detail, otherwise its not enough to see.
I’m most curious about the paths that were actually deleted over the series names, since thats the only thing that matters when deleting them.
Since you’re coming from Sickbeard, were the same paths in SB? Could you get them from there?
Unfortunately I deleted a lot (over 150) of series’ and didn’t notice the issue until the next morning, so I can’t even begin to imagine which ones caused it. I only mentioned special characters because aside from db path corruption that was what came to mind as a possible cause, if not properly escaped. I didn’t notice any names with non-latin chars, but there are parenthesis, and I think I’d seen a comma here and an apostrophe there previously, so I figure other symbols aren’t out of the question, although I don’t recall any specifically.
Debug logging wasn’t on, unless it’s enabled in the default install?
The path where all series was stored is: /mnt/media/TV/ and was formatted Show Title/Season n/*.mkv
I do still have sickbeard installed, so unless the rm / succeeded, I should be able to get the paths from there (the user running sonarr also owns sickbeard). I’ll investigate this tomorrow and post back a list of anything that’s not strictly alphanumeric.
Apologies for the delay. The following are the unusual characters in path names:
, (comma) | : (colon) | ( ) (parenthesis) | - (dash) | . (period) | ’ (apostrophe) | & (ampersand) | ! (exclamation mark) | + (plus sign)
In addition to the above, there are shows that started with one of the symbols above, ended with one of the symbols above, and contained multiple occurrences of some of the symbols above.
There was also a single show (V - the old one), which was just a single letter (v) in-case there’s an array index issue. There is also a show titled H+, in-case there is an interaction with the single char and the plus symbol.
Probably unrelated, there was a show (MAS*H) whose name contained asterisks, but the path name replaces those with dashes in sickbeard. There are also shows with ? (question marks) in their name, but those are omitted from the path names in sickbeard.
Much of that won’t be relevant, but I like to be thorough.
For interests sake, the erroneously deleted files were all in folders starting with a/b (and possibly numbers?), so it was like it started deleting alphabetically before hitting either a timeout, a permissions issue, an error, or possibly is interrupted by the creation of another series deletion task (I was deleting them in fairly rapid succession as I scrolled down the list).