Page 1 of 1

0.5.0RC3 barfing SQLite errors

Posted: January 26th, 2010, 9:00 pm
by wolrah
I just upgraded from 0.4.12 (official package) to 0.5.0RC3 (PPA).  On initial access and maybe 1/5 accesses from there on out rather than displaying the page or information expected I get an error such as this:

Code: Select all

Unrecoverable error in the server.
Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/cherrypy/_cpwsgi.py", line 78, in setapp
    self.request = self.get_request()
  File "/usr/share/sabnzbdplus/cherrypy/_cpwsgi.py", line 233, in get_request
    request, resp = self.cpapp.get_serving(local, remote, scheme, sproto)
  File "/usr/share/sabnzbdplus/cherrypy/_cptree.py", line 112, in get_serving
    cherrypy.engine.publish('acquire_thread')
  File "/usr/share/sabnzbdplus/cherrypy/process/wspbus.py", line 147, in publish
    output.append(listener(*args, **kwargs))
  File "/usr/share/sabnzbdplus/cherrypy/process/plugins.py", line 514, in acquire_thread
    self.bus.publish('start_thread', i)
  File "/usr/share/sabnzbdplus/cherrypy/process/wspbus.py", line 147, in publish
    output.append(listener(*args, **kwargs))
  File "/usr/share/sabnzbdplus/sabnzbd/__init__.py", line 155, in connect_db
    cherrypy.thread_data.history_db = sabnzbd.database.get_history_handle()
  File "/usr/share/sabnzbdplus/sabnzbd/database.py", line 50, in get_history_handle
    return HistoryDB(_HISTORY_DB)
  File "/usr/share/sabnzbdplus/sabnzbd/database.py", line 66, in __init__
    self.con = sqlite3.connect(db_path)
OperationalError: unable to open database file
Pressing refresh a time or two always makes it do what's expected, but it's still annoying.

I had hoped I could just add the PPA, launch aptitude, upgrade the packages, and call it a day.  Unfortunately that got me where I am right now.

Since my SAB config isn't exactly complicated I did a full purge of all sabnzbdplus packages as well as my config file, emptying the entire cache directory.  I then started it back up with a config file consisting of nothing but my log directory (since it won't run as a service without that).  Still no change.

Another bit of information is on launch I see it try to create the directory '/etc/admin'.  It fails and never tries again as far as I can tell, but it seems like this might be related if these SQLite databases are supposed to go in the admin directory, just it's not allowing me to configure where that admin directory lives apparently.

Re: 0.5.0RC3 barfing SQLite errors

Posted: January 26th, 2010, 9:07 pm
by wolrah
By comparing with my Mac, I found the admin directory setting in the config file and it seems to be working now after setting it to a place it had write permissions.

edit: While admin_dir is now set, SAB apparently doesn't read it early enough and still throws these errors every time it's started:

Code: Select all

#

2010-01-26 21:12:41,599
ERROR:
#error-createDir# /etc/admin

#

2010-01-26 21:12:41,599
ERROR:
#error-createDir# /etc/admin

Re: 0.5.0RC3 barfing SQLite errors

Posted: January 27th, 2010, 4:05 am
by shypike
Thanks for the tip, I'll check this.
Usually the base folder is writable, so the problem does not occur.
99% of the users have the admin/cache/logs folders relative to the location of the sabnzbd.ini file.
The latter file needs to be in a writable location anyway.

Re: 0.5.0RC3 barfing SQLite errors

Posted: January 27th, 2010, 5:27 am
by jcfp
wolrah, just for my understanding: with your 0.4.x setup, sabnzbd.ini was stored somewhere in /etc ?

Re: 0.5.0RC3 barfing SQLite errors

Posted: January 29th, 2010, 3:38 pm
by shypike
wolrah wrote: edit: While admin_dir is now set, SAB apparently doesn't read it early enough and still throws these errors every time it's started:
Actually, the creation problem is not caused by the sqlite database, but by the HTTPS certificate files.
Those files reside by default in admin too, only for those files the admin folder path is not taken from the INI file.
I will fix that for 0.5.0.