Search code examples
apt

Aptly command is unable to open database


I'm currently running an apt repo with aptly. However, today my repo wasn't working. When i tried running this :

aptly repo list

the command didn't succeeded and showed :

Unable to open database, sleeping 11.058056147s, attempts left 10...

Where does this error come from and how can i fix this ?

Edit : Stack overflow thinks i do not show enough debug details. Also I've resolved my problem so see the answer for the solution

So i currently have an aptly server and I'm using the CLI at the same time.

PS : As it has been pointed out to me, this thread should best be elsewere. I exported it to here : https://superuser.com/q/1652881/1390494


Solution

  • After doing some research, it appears that the problem was a previous aptly process which has crashed but was still holding locks. Killing it fixed the problem

    Edit :

    This solution was only temporary as the problem occurred again some time after killing the process. The problem was the aptly api running concurrently with the CLI. As the doc says https://www.aptly.info/doc/api/ i should run the api with -no-lock flag to have both API and CLI running.