sqlite3.OperationalError: attempt to write a readonly database
Hugo-Persson opened this issue · 2 comments
Hugo-Persson commented
Hello,
I get the following error when trying to start the project in docker:
sqlite3.OperationalError: attempt to write a readonly database
My docker-compose file looks like this:
version: '3.8'
services:
bragi:
image: ghcr.io/djdembeck/bragibooks:main
container_name: bragibooks
environment:
- CSRF_TRUSTED_ORIGINS=https://bragibooks.mydomain.com
- LOG_LEVEL=INFO
- DEBUG=False
- UID=1000
- GID=1000
volumes:
- ./bragibooks/config:/config
- /home/hugo/Library/Audiobooks/unparsed:/input
- /home/hugo/Library/Audiobooks/parsed:/output
- ./bragibooks/done:/done
ports:
- 8083:8000
The full error is:
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) attempt to write a readonly database
bragibooks | [SQL:
bragibooks | CREATE TABLE kombu_queue (
bragibooks | id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
bragibooks | name VARCHAR(200),
bragibooks | UNIQUE (name)
bragibooks | )
bragibooks |
bragibooks | ]
bragibooks | (Background on this error at: https://sqlalche.me/e/20/e3q8)
Anyone knows how to solve this? I can access the web interface but get 500 error when trying to save settings.
djdembeck commented
Make sure the folder ./bragibooks/config
has ownership permissions of 1000:1000
Hugo-Persson commented
I solved the issue, the directory that was mounted was owned by my user. But it was empty on startup. When the container created DB files these were created by root by som reason. After shutting down container, changing ownership and starting again everything worked.