Page 1 of 1
SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 6:32 am
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?
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 8:16 am
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.
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 8:21 am
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
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 8:56 am
by iUseNetter
Thank you sander!
I will try the suggested reboot later this evening.
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 9:07 am
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
comes from?
And why should it search with
and
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 9:15 am
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?
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 9:20 am
by iUseNetter
Of course

*joking*
I'm just downloading a copy of the history1.db to have a look inside...
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 9:46 am
by iUseNetter
I don't see any errors in the database itself. A manually executed
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
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
But long story short:
I stopped SABnzbd, then I deleted the
(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.
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 10:04 am
by iUseNetter
Just for the record:
The logged line "...database.py", line 124 only contains the command
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.
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 4:03 pm
by safihre
Could be this:
https://stackoverflow.com/a/24393355/5235502
Seems like quite a big database you have!
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 4:30 pm
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
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?
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 4:36 pm
by sander
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). "
Re: SQL Command Failed, see log / "DB or disc full" -> not true
Posted: February 21st, 2022, 4:41 pm
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
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.