Page 1 of 2

cherrypy and sql query errors

Posted: February 15th, 2019, 4:59 pm
by Megatrond
Hi!
I have had Sabnzbd running on a windows server 2016 for a couple of years now, but after I upgraded the server to Server 2019 I am getting some weird errors that i can't find a sollution for.

The first error i am getting all the time is this one:

Traceback (most recent call last):
File "cherrypy\_cprequest.pyo", line 663, in respond
File "cherrypy\_cpreqbody.pyo", line 989, in process
File "cherrypy\_cpreqbody.pyo", line 558, in process
File "cherrypy\_cpreqbody.pyo", line 223, in process_multipart_form_data
File "cherrypy\_cpreqbody.pyo", line 215, in process_multipart
File "cherrypy\_cpreqbody.pyo", line 556, in process
File "cherrypy\_cpreqbody.pyo", line 715, in default_proc
File "cherrypy\_cpreqbody.pyo", line 729, in read_into_file
File "cherrypy\_cpreqbody.pyo", line 512, in make_file
File "tempfile.pyo", line 475, in NamedTemporaryFile
File "tempfile.pyo", line 244, in _mkstemp_inner
OSError: [Errno 2] No such file or directory: 'c:\\users\\trond\\appdata\\local\\temp\\2\\tmpbjsuir'


The second one is:

ERROR::[database:154] SQL Command Failed, see log

But here I cannot find any errors in the log, It's just the error over and over again.


Sabnzbd has worked like a charm until i upgraded to 2019, but now is only half-working i feel. Sometimes it works, sometimes it errors out and nothing gets downloaded. It is seriously frustrating :(

Any thoughts?

Re: cherrypy and sql query errors

Posted: February 15th, 2019, 5:01 pm
by Megatrond
And also, I cannot remember having problems before i installed Ombi if this helps...

Re: cherrypy and sql query errors

Posted: February 15th, 2019, 5:21 pm
by sander
Can you read from here: viewtopic.php?t=22877#p112847

Also after a Windows Update. Solved by a Windows Reboot.

Re: cherrypy and sql query errors

Posted: February 15th, 2019, 6:51 pm
by Megatrond
The computer has been restarted multiple times since these problems started :(

Re: cherrypy and sql query errors

Posted: February 16th, 2019, 6:27 am
by safihre
I would suggest to backup your sabnzbd.ini, and then reinstall sabnzbd. Also make sure to remove the admin directory.
You could also backup history.db to keep your history, this should work.

Re: cherrypy and sql query errors

Posted: February 18th, 2019, 8:32 am
by Megatrond
safihre wrote: February 16th, 2019, 6:27 am I would suggest to backup your sabnzbd.ini, and then reinstall sabnzbd. Also make sure to remove the admin directory.
You could also backup history.db to keep your history, this should work.
I tried this, and it worked for about a day. Looks like I might need to reboot the server about once a day to avoid this problem :(

Re: cherrypy and sql query errors

Posted: February 18th, 2019, 12:57 pm
by safihre
Maybe a permissions problem? Or does the system have enough space left on the drive?
Or probably a virusscanner..

Re: cherrypy and sql query errors

Posted: February 22nd, 2019, 12:42 am
by Megatrond
Permissions are okey, this problem is only intermittent. There is no permission issues as i can see. Both the physical hd that the vm's are running on, and the virtual disks have at least 50+ GB free space at all time. And when it comes to virus scanners, i only run the windows defender on my servers. When i restart the computer, the progam downloads the files perfectly :(

Re: cherrypy and sql query errors

Posted: February 23rd, 2019, 4:38 am
by safihre
The error is from a core Python function to create a temporary file, which should never fail in regular setups.
It has occurred more often on VM's where the disk access was somehow delayed, which messes up the timings.
Also for SABnzbd code we have to do all kind of tricks because on VM's sometimes when we send a delete-file command, the file only gets deleted a whole second later for some reason.
In any case: is there some other thing that could be messing with C:/temp? Like cleaning software?

Re: cherrypy and sql query errors

Posted: February 23rd, 2019, 3:38 pm
by Megatrond
I will take a closer look, thanks for your input. Now I at least know more where to look for the problem. I will come back and post the fix if I can find it. Might be useful for other users as well.

Re: cherrypy and sql query errors

Posted: March 7th, 2019, 8:47 am
by kvoorhees
This is literally the exact same situation I am in, minus the VM. Stand alone Windows 2016 installation, running great for years. Upgraded to Windows 2019 and I have the exact same experience. Reinstalling or rebooting makes it go away (with successful downloads) and then 12-24 hours later I start getting same errors as OP.

Re: cherrypy and sql query errors

Posted: March 7th, 2019, 10:37 pm
by NunyaBzness
kvoorhees wrote: March 7th, 2019, 8:47 am This is literally the exact same situation I am in, minus the VM. Stand alone Windows 2016 installation, running great for years. Upgraded to Windows 2019 and I have the exact same experience. Reinstalling or rebooting makes it go away (with successful downloads) and then 12-24 hours later I start getting same errors as OP.
Another "me too" post. Server 2019 clean install VM. In an attempt to address the timing/delay issue (as much as possible), I moved the boot drive to SSD. No changes in behavior. Please advise if there is additional information you'd like to receive.

Re: cherrypy and sql query errors

Posted: March 8th, 2019, 7:52 am
by safihre
There is a tiny tiny chance this will be fixed in Python 2.7.16 that will be part of SABnzbd 2.3.8.
No clue really why Windows is suddenly blocking this...

Re: cherrypy and sql query errors

Posted: March 8th, 2019, 10:58 am
by NunyaBzness
Server 2019 is built on top of the Windows 10 version 1809 feature baseline (less Edge/Windows Store), so testing on that platform may help reveal any issues. There are also a number of additional changes versus Server 2016, but there doesn't seem to be anything obvious that would vary in the simple VM implementation that are apparently in use in this thread.

In my case, the 2019 VM is still running on top of a 2016 based Hyper-V.

Re: cherrypy and sql query errors

Posted: March 8th, 2019, 12:04 pm
by kvoorhees
I don't think it is a 2019 issue specifically to be honest. I had a similar experience after upgrading from 2012 to 2016 years ago. Unfortunately it persisted until I wiped the box clean and installed the OS fresh. I am very much hoping it doesn't come to that this time. I actually wiped my install of SABNzbd yesterday. Deleted everything in appdata and program files and installed fresh. Worked great and downloaded a bunch of stuff, an hour ago, same error.


2019-03-08 11:11:27,948::ERROR::[_cplogging:219] [08/Mar/2019:11:11:27] HTTP
Traceback (most recent call last):
File "cherrypy\_cprequest.pyo", line 663, in respond
File "cherrypy\_cpreqbody.pyo", line 989, in process
File "cherrypy\_cpreqbody.pyo", line 558, in process
File "cherrypy\_cpreqbody.pyo", line 223, in process_multipart_form_data
File "cherrypy\_cpreqbody.pyo", line 215, in process_multipart
File "cherrypy\_cpreqbody.pyo", line 556, in process
File "cherrypy\_cpreqbody.pyo", line 715, in default_proc
File "cherrypy\_cpreqbody.pyo", line 729, in read_into_file
File "cherrypy\_cpreqbody.pyo", line 512, in make_file
File "tempfile.pyo", line 475, in NamedTemporaryFile
File "tempfile.pyo", line 244, in _mkstemp_inner
OSError: [Errno 2] No such file or directory: 'c:\\users\\kenny\\appdata\\local\\temp\\2\\tmpftvrva'



2019-03-08 11:26:58,640::ERROR::[_cplogging:219] [08/Mar/2019:11:26:58] HTTP
Traceback (most recent call last):
File "cherrypy\_cprequest.pyo", line 663, in respond
File "cherrypy\_cpreqbody.pyo", line 989, in process
File "cherrypy\_cpreqbody.pyo", line 558, in process
File "cherrypy\_cpreqbody.pyo", line 223, in process_multipart_form_data
File "cherrypy\_cpreqbody.pyo", line 215, in process_multipart
File "cherrypy\_cpreqbody.pyo", line 556, in process
File "cherrypy\_cpreqbody.pyo", line 715, in default_proc
File "cherrypy\_cpreqbody.pyo", line 729, in read_into_file
File "cherrypy\_cpreqbody.pyo", line 512, in make_file
File "tempfile.pyo", line 463, in NamedTemporaryFile
File "tempfile.pyo", line 275, in gettempdir
File "tempfile.pyo", line 217, in _get_default_tempdir
IOError: [Errno 2] No usable temporary directory found in ['C:\\Users\\kenny\\AppData\\Local\\Temp\\2', 'C:\\Users\\kenny\\AppData\\Local\\Temp\\2', 'c:\\temp', 'c:\\tmp', '\\temp', '\\tmp', 'C:\\Program Files\\SABnzbd']

I am giving 2.3.8 Beta 1 a try based on the above comments.