[Trunk] History DB - Database fails to create [rev 2490]

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
FrankSpierings
Newbie
Newbie
Posts: 6
Joined: May 5th, 2009, 2:25 am

[Trunk] History DB - Database fails to create [rev 2490]

Post by FrankSpierings »

I think there might be something wrong with the threading in revision 2490 (trunk).

(Note: I've configured the ini file to store admin somewhere outside the program dir)

I see that the initialisation of the history database is done twice. When it tries to setup the tables it fails because its locked.

You can spot this when logging the constructor of database.py.

The following is a log of the unmodified rev 2490

Code: Select all

2009-05-05 08:57:33,285::DEBUG::[misc:503] Unsupported release number (trunk), will not check
2009-05-05 08:57:59,238::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:57:59,239::DEBUG::[database:80] SQL: SELECT sum(bytes) FROM history
2009-05-05 08:57:59,239::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 74, in execute
    self.c.execute(command)
OperationalError: no such table: history
2009-05-05 08:57:59,448::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:57:59,449::DEBUG::[database:80] SQL: SELECT sum(bytes) FROM history WHERE "completed">?
2009-05-05 08:57:59,449::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 72, in execute
    self.c.execute(command, args)
OperationalError: no such table: history
2009-05-05 08:57:59,658::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:57:59,659::DEBUG::[database:80] SQL: SELECT sum(bytes) FROM history WHERE "completed">?
2009-05-05 08:57:59,659::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 72, in execute
    self.c.execute(command, args)
OperationalError: no such table: history
2009-05-05 08:57:59,868::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:57:59,869::DEBUG::[database:80] SQL: select count(*) from History WHERE name LIKE ?
2009-05-05 08:57:59,869::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 72, in execute
    self.c.execute(command, args)
OperationalError: no such table: History
2009-05-05 08:58:00,078::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:58:00,079::DEBUG::[database:80] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2009-05-05 08:58:00,081::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 72, in execute
    self.c.execute(command, args)
OperationalError: no such table: history
2009-05-05 08:58:17,490::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:58:17,491::DEBUG::[database:80] SQL: 
        CREATE TABLE "history" (
            "id" INTEGER PRIMARY KEY,
            "completed" INTEGER NOT NULL,
            "name" TEXT NOT NULL,
            "nzb_name" TEXT NOT NULL,
            "category" TEXT,
            "pp" TEXT,
            "script" TEXT,
            "report" TEXT,
            "url" TEXT,
            "status" TEXT,
            "nzo_id" TEXT,
            "storage" TEXT,
            "path" TEXT,
            "script_log" BLOB,
            "script_line" TEXT,
            "download_time" INTEGER,
            "postproc_time" INTEGER,
            "stage_log" TEXT,
            "downloaded" INTEGER,
            "completeness" INTEGER,
            "fail_message" TEXT,
            "url_info" TEXT,
            "bytes" INTEGER,
            "meta" TEXT
        )
        
2009-05-05 08:58:17,492::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 74, in execute
    self.c.execute(command)
OperationalError: database is locked
2009-05-05 08:58:29,033::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:58:29,037::DEBUG::[database:80] SQL: SELECT sum(bytes) FROM history
2009-05-05 08:58:29,037::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 74, in execute
    self.c.execute(command)
OperationalError: no such table: history
2009-05-05 08:58:29,039::ERROR::[database:79] SQL Command Failed, see log
2009-05-05 08:58:29,039::DEBUG::[database:80] SQL: SELECT sum(bytes) FROM history WHERE "completed">?
2009-05-05 08:58:29,040::DEBUG::[database:81] Traceback: 
Traceback (most recent call last):
  File "/usr/local/share/SABnzbd-trunk/sabnzbd/database.py", line 72, in execute
    self.c.execute(command, args)
OperationalError: no such table: history
Last edited by FrankSpierings on May 5th, 2009, 2:34 am, edited 1 time in total.
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: [Trunk] History DB - Database fails to create [rev 2490]

Post by switch »

I take it this happened right after changing the admin directory to another location. I will look into ways to make this better.

For now, simply delete the database file inside the admin folder and it will be created again.

Thanks for reporting the issue.
FrankSpierings
Newbie
Newbie
Posts: 6
Joined: May 5th, 2009, 2:25 am

Re: [Trunk] History DB - Database fails to create [rev 2490]

Post by FrankSpierings »

In this situation the admin database won't be rercreated. I'll give it a try when the admin folder is in the normal installation dir.

Cheers
Post Reply