Asterisk 18.1 failing on DB update

In the last couple of days, I’ve started to get
WARNING[16546] db.c: Couldn’t execute statement: SQL logic error or missing database
messages to any attempt to update my asterisk database. The database has 664 entries in it, and reached this point only a couple of days ago.

Through the asterisk commandline, I can successfully query the contents of the database, but cannot update it. For example:

rutherford*CLI> database show Majordomo UCFN
/Majordomo/UCFN :
1 results found.

rutherford*CLI> database get Majordomo UCFN

rutherford*CLI> database put Majordomo UCFN 8885551212
Failed to update entry
[2021-04-19 19:08:17.439] WARNING[25137]: db.c:348 ast_db_put: Couldn’t execute statement: SQL logic error or missing database

I have taken asterisk down, and been successful at reading, updating, and deleting from the astdb.sqlite3 table using the sqlite3 commandline tool. The database file does not seem to have any inconsistancies, and the file is readable. I’ve even duplicated (by exporting through the sqlite3 commandline) the database file; the duplicate suffers the same errors as the original when accessed by Asterisk.

I’m running Asterisk 18.1 on a 64-bit Slackware 14.2 system, with 4Gi memory and 500Mb of hard drive. My system shows only 541Mi used memory, with none of my 31Gi swap in use. Asterisk ulimit address-space size and data-size have been set to “unlimited”.

Does anyone have any suggestions as to what could be causing this DB update failure, and/or how to debug or fix it?

Can you reproduce on another install. Like installing on your own laptop and reproduce same error ? 500mb sounds like a 90s pentium 1 computer.
You Can also stop asterisk . mount a ram drive on same directory of db and copy db to it an start asterisk. Does it reproduce ?
What Does df -hs show ? Did you check the size of your /var/log/asterisk/messages ? It could grow to 500mb in couple hours.

Good news. I fixed my problem.

On a recent update of some AGI scripts, my homebrew installer program
changed the owner and permissions of /var/lib/asterisk. Somehow, this
fouled up Asterisk’s ability to update the astdb.sqlite3 database.

I’ve corrected the /var/lib/asterisk problem, and all is well with
Asterisk now. Next step is to fix my installer program so that it doesn’t
clobber /var/lib/asterisk again.

Sorry for the false alarm.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.