Page 1 of 1

SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 11:30 am
by Eternity8701
I'm running in Docker (really k3s, but same thing as far as support goes), everything works fine except for this one issue.

Once files are downloaded they are successfully moved by sab to /data/usenet/complete, but then they get immediately removed from sab's history, which is causing *arr apps to now be able to import them into my media folder. config > switches > post processing > history retention = keep all jobs. I do not have sorting on. I have .nzb files saved into a .nzb backup folder. This issue happens when an NZB is added from any source, including manually.

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 12:02 pm
by safihre
Sabnzbd isn't removing them, it's the Arr apps that are doing that..
You can enable Debug logging in the Status window and then after it happens again click Show Logging, then you can see exactly who requested the deletion.

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 12:54 pm
by Eternity8701
This issue happens even when sabznbd is the only container running, no sonarr/radarr/any*arr. I'm pretty sure the issue is with the history1 db file in /config/admin. I've tried stopping sabnzbd and starting with an empty /config dir, so it initializes it's files, but then I get an error regarding the history:

2023-11-26 12:49:35,711::ERROR::[database:152] SQL Command Failed, see log
2023-11-26 12:49:35,713::INFO::[database:153] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2023-11-26 12:49:35,715::INFO::[database:154] Arguments: ['%%', 0, 1000000]
2023-11-26 12:49:35,717::INFO::[database:155] Traceback:
Traceback (most recent call last):
File "/app/sabnzbd/sabnzbd/database py", line 125, in execute
self.cursor.execute(command, args)
sqlite3.OperationalError: no such table: history


My history is already screwed up, is there some other way to get a working history db? I'm not sure why the one it makes itself would have this issue, but I must be missing something.

I had to replace . with a space in errors above since I'm a new user on the forum and it's interpreting that as a link

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 12:56 pm
by safihre
You need to make sure SABnzbd is really shutdown, the error above seems to indicate you deleted the file without it being shutdown.
Then just delete the history dB file.

Just make sure to enable Debug logging so you can see what is deleting the job.

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 1:38 pm
by Eternity8701
It definitely was shutdown because it was a new container, I just did it again with a new container and entirely new directory mounted for /config, and nothing has the new API key so nothing would be able to request a removal. Here are the logs from it, I downloaded the 100MB test file. It didn't move the file but I'm guessing that's because of the SQL error?

I doubt you feel like looking at logs, but if you do then here are the logs from the entire bootup showing no files present and creating them, and running into the SQL error, and a bunch of API complaints since nothing can get to it:
https://pastebin(dot)com/kdd6wK0r


I've tried this with completely new directories so everything is initialized by sab, but every time I get the SQL error with no such table: history

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 1:45 pm
by safihre
The logs are a bit confusing to me, especially for a clean install. Seems problems with other Admin files like the bpsmeter (data counters) that mess up the whole startup.
Can you just start with a clean config directory and only copy your sabnzbd.ini?
Or even don't copy the sabnzbd.ini

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 26th, 2023, 1:56 pm
by Eternity8701
Hey it's working now! I had tried clean config directories a few times, but always over the same network share. This time I just mounted /config directly to my k3s host and it worked. Either an issue with network shares in general, or an issue with just mine. I have an actual NAS coming so hopefully it is just an issue with mine and not network shares in general. Thank you for your help!

Re: SABnzbd deleting files from history before Sonarr/Radarr/etc., can pick them up

Posted: November 27th, 2023, 6:45 am
by safihre
Hope the issues are resolved!