SQL Command Failed, see log / "DB or disc full" -> not true

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • 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
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

SABnzbd startet to complain about a failed SQL command:

Code: Select all

2022-02-21 12:25:01,026::INFO::[nzbqueue:237] Saving queue
2022-02-21 12:25:01,028::INFO::[downloader:414] Forcing disconnect
2022-02-21 12:25:11,019::INFO::[notifier:123] Sending notification: Error - SQL Command Failed, see log (type=error, job_cat=None)
2022-02-21 12:25:11,019::ERROR::[database:153] SQL Command Failed, see log
2022-02-21 12:25:11,021::INFO::[database:154] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2022-02-21 12:25:11,022::INFO::[database:155] Arguments: ('%%', 0, 1000000)
2022-02-21 12:25:11,022::INFO::[database:156] Traceback: 
Traceback (most recent call last):
  File "/volume5/@appstore/sabnzbd/share/SABnzbd/sabnzbd/database.py", line 124, in execute
    self.c.execute(command, args)
sqlite3.OperationalError: database or disk is full
2022-02-21 12:27:11,866::INFO::[notifier:123] Sending notification: Error - SQL Command Failed, see log (type=error, job_cat=None)
2022-02-21 12:27:11,866::ERROR::[database:153] SQL Command Failed, see log
2022-02-21 12:27:11,868::INFO::[database:154] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2022-02-21 12:27:11,868::INFO::[database:155] Arguments: ('%%', 0, 1000000)
2022-02-21 12:27:11,869::INFO::[database:156] Traceback: 
Traceback (most recent call last):
  File "/volume5/@appstore/sabnzbd/share/SABnzbd/sabnzbd/database.py", line 124, in execute
    self.c.execute(command, args)
sqlite3.OperationalError: database or disk is full
2022-02-21 12:27:19,295::ERROR::[database:153] SQL Command Failed, see log
2022-02-21 12:27:19,297::INFO::[database:154] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2022-02-21 12:27:19,298::INFO::[database:155] Arguments: ('%%', 0, 1000000)
2022-02-21 12:27:19,299::INFO::[database:156] Traceback: 
Traceback (most recent call last):
  File "/volume5/@appstore/sabnzbd/share/SABnzbd/sabnzbd/database.py", line 124, in execute
    self.c.execute(command, args)
sqlite3.OperationalError: database or disk is full
I'm absolutely sure that the /volume5 is not full.

How can the database (which one exactly?) be full?

What should I do now?
User avatar
sander
Release Testers
Release Testers
Posts: 8845
Joined: January 22nd, 2008, 2:22 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by sander »

The error does not say /volume5 is full.
/volume5 is just the volume where the SAB executable is

It's about the file .sabnzbd/admin/history1.db ... so where is that on your system ... ?

Easier: is there any filesytem full?

Oh, and you could always try a nice reboot.
User avatar
sander
Release Testers
Release Testers
Posts: 8845
Joined: January 22nd, 2008, 2:22 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by sander »

Practical trick to find your directory: set SAB logging to +DEBUG, and files like below.

Code: Select all

2022-02-21 12:16:04,970::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 12:31:36,092::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 12:47:07,257::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 13:02:38,398::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 13:18:09,537::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 13:33:40,696::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 13:49:11,861::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
2022-02-21 14:04:43,018::DEBUG::[filesystem:1107] [sabnzbd.filesystem.save_admin] Saving data for rss_data.sab in /home/sander/.sabnzbd/admin
So on my system: /home/sander/.sabnzbd/admin ...

And formal: https://sabnzbd.org/wiki/advanced/directory-setup
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

Thank you sander!

Image

Image

Image

I will try the suggested reboot later this evening.
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

After a SABnzdb restart I still see this error message in the log file:

Code: Select all

2022-02-21 15:03:14,695::INFO::[notifier:123] Sending notification: SABnzbd - SABnzbd 3.5.0 started (type=startup, job_cat=None)
2022-02-21 15:03:14,748::INFO::[postproc:231] Completed Download Folder /volume5/SABnzbd/complete is not on FAT
2022-02-21 15:03:14,835::INFO::[notifier:123] Sending notification: Error - SQL Command Failed, see log (type=error, job_cat=None)
2022-02-21 15:03:14,835::ERROR::[database:153] SQL Command Failed, see log
2022-02-21 15:03:14,836::INFO::[database:154] SQL: VACUUM
2022-02-21 15:03:14,837::INFO::[database:155] Arguments: ()
2022-02-21 15:03:14,837::INFO::[database:156] Traceback: 
Traceback (most recent call last):
  File "/volume5/@appstore/sabnzbd/share/SABnzbd/sabnzbd/database.py", line 126, in execute
    self.c.execute(command)
sqlite3.OperationalError: database or disk is full
and some seconds later:

Code: Select all

2022-02-21 15:03:32,359::ERROR::[database:153] SQL Command Failed, see log
2022-02-21 15:03:32,360::INFO::[database:154] SQL: SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
2022-02-21 15:03:32,360::INFO::[database:155] Arguments: ('%%', 0, 1000000)
2022-02-21 15:03:32,361::INFO::[database:156] Traceback: 
Traceback (most recent call last):
  File "/volume5/@appstore/sabnzbd/share/SABnzbd/sabnzbd/database.py", line 124, in execute
    self.c.execute(command, args)
sqlite3.OperationalError: database or disk is full
Where does this

Code: Select all

 SELECT * FROM
comes from?
And why should it search with

Code: Select all

LIKE ?
and

Code: Select all

LIMIT ?, ?
User avatar
sander
Release Testers
Release Testers
Posts: 8845
Joined: January 22nd, 2008, 2:22 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by sander »

I guess that is from SAB itself: SAB's GUI shows the history, so it must search the history. It looks like a sql command "give me everything"

Disclaimer: I know about nothing about SQL commands. Do you?
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

Of course ;) ;D *joking*
I'm just downloading a copy of the history1.db to have a look inside...
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

I don't see any errors in the database itself. A manually executed

Code: Select all

VACUUM
works without any problem.
The SQL-command

Code: Select all

SELECT * FROM history WHERE name LIKE ? ORDER BY completed desc LIMIT ?, ?
doesn't work, but maybe the

Code: Select all

?
sign masks something?

I have never seen that the LIMIT option takes something like ? as valid value.
The two comma separated numbers should be the "offset" and the "row_count", something like

Code: Select all

LIMIT 10 OFFSET 5;
But long story short:
I stopped SABnzbd, then I deleted the

Code: Select all

history1.db
(with my 40'000 history entries) in a SSH console window.
Then I restarted SABnzbd and my next downloads just started fine.

Maybe some additional kind of tool like "Check database integrity" or more detailed failing SQL command in the Debug-Log mode would be helpful.
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

Just for the record:

The logged line "...database.py", line 124 only contains the command

Code: Select all

self.c.execute(command, args)

I assume, the source of the error message is this code snippet starting at line 333 in database.py:

Code: Select all

        command_args.extend([start, limit])
        cmd = "SELECT * FROM history WHERE name LIKE ?"
        if self.execute(cmd + post + " ORDER BY completed desc LIMIT ?, ?", tuple(command_args)):
            items = self.c.fetchall()
        else:
            items = []
This should "fetch_history".

As already noted, I have never seen that syntax before.
User avatar
safihre
Administrator
Administrator
Posts: 5384
Joined: April 30th, 2015, 7:35 am
Contact:

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by safihre »

Could be this: https://stackoverflow.com/a/24393355/5235502
Seems like quite a big database you have!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 8845
Joined: January 22nd, 2008, 2:22 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by sander »

iUseNetter wrote: February 21st, 2022, 10:04 am Just for the record:

The logged line "...database.py", line 124 only contains the command

Code: Select all

self.c.execute(command, args)

I assume, the source of the error message is this code snippet starting at line 333 in database.py:

Code: Select all

        command_args.extend([start, limit])
        cmd = "SELECT * FROM history WHERE name LIKE ?"
        if self.execute(cmd + post + " ORDER BY completed desc LIMIT ?, ?", tuple(command_args)):
            items = self.c.fetchall()
        else:
            items = []
This should "fetch_history".

As already noted, I have never seen that syntax before.
Do you mean that code works for you? Have you tried? If so, would it work for others?
User avatar
sander
Release Testers
Release Testers
Posts: 8845
Joined: January 22nd, 2008, 2:22 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by sander »

safihre wrote: February 21st, 2022, 4:03 pm Could be this: https://stackoverflow.com/a/24393355/5235502
Seems like quite a big database you have!
40.000 entries in a 2MB sql file ... not too impressive, I would say.

Quote from https://www.sqlite.org/limits.html : "The theoretical maximum number of rows in a table is 2^64 (18446744073709551616 or about 1.8e+19). "
iUseNetter
Jr. Member
Jr. Member
Posts: 73
Joined: December 1st, 2019, 2:53 pm

Re: SQL Command Failed, see log / "DB or disc full" -> not true

Post by iUseNetter »

@safihre: I didn't know that a sqlite db can get full at 1 TB page size, thanks for that info.
But even with my 40'000 history entries, I think the history1.db was only about 40 MB, far away from the 1 TB file size.
On the other side: The command

Code: Select all

PRAGMA main.max_page_count;
shows "1073741823" for my old (in the meantime deleted) history1.db.
Exactly the same number as in the linked info
In my case the value was 1073741823, which meant that in combination with a page size of 1024 Bytes the database maxed out at 1 TB and returned the "database or disk is full" error.
So you could be quite right.
Maybe some kind of warning reaching this limit would be helpful?

@sander: This is only the original code snippet found in the database.py. I assume that the error message is a result from this SQL-Query.
Post Reply