Unable to open Asterisk database '/var/lib/asterisk/astdb.sqlite3': unable to open database file

Hi everyone,

Couple days ago installed Asterisk on ubuntu 20 from source based on instructions from this video: How to install Asterisk 16 LTS on Ubuntu 21.04 - YouTube

Everything worked just fine, and today i needed to install new Asterisk server(I used second VM machine to do so) and I followed the same tutorial, however after doing the exact same set of steps, after trying to start asterisk console with asterisk -r this message shows:

Unable to open Asterisk database ‘/var/lib/asterisk/astdb.sqlite3’: unable to open database file
ASTdb initialization failed. ASTERISK EXITING!

This DB is not in /var/lib/asterisk/ directory. In the first server I installed, it is. So does anybody have any idea on why didnt this db installed this time?

Does anybody have idea on how to fix it? Or what did I do wrong?

There is no installation for the database. Asterisk opens it (which creates it if it does not exist) at startup, and if the table isn’t created also creates it.

Did this prevent Asterisk from starting? Does the user Asterisk is running as have permissions to that directory?

Everything should be fine, asterisk is owner of this folder

Okay i fixed it, thanks for your help

And what was the solution?

I had just had to change ownership of certain folders with this command:

chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk

It was actually in the video as well, i feel stupid for overseeing it. Sorry for wasting your time. But i appreciate you trying to help me, plus you forwarded me to the right direction. So thank you

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