snippet-box
snippet-box copied to clipboard
Docker-image won't start // Database connection error
when i follow the instructions on github page and want to start snippet-box i get the following:
[2022-03-01 07:43:40.153 UTC+0] [INFO] db: Database connected [2022-03-01 07:43:40.178 UTC+0] [INFO] db: Found pending migrations. Executing... [2022-03-01 07:43:40.197 UTC+0] [ERROR] db: Database connection error
i deployed the container with docker (docker run ...) and docker-compose and the .yml from the repository. i sticked to the given example. error is always the same. the logs get spammed with the 3 lines given.
i am running docker on ubuntu 20.04.3 x64, latest updates and upgrades, docker from official repo. can provide any logs and outputs. just ask (:
I am facing the same issue as well I run it on raspberry pi using the arm tag
+1
https://github.com/pawelmalak/snippet-box/issues/34
Spotted this issue - could be because I'm using named volumes
I'm getting this condition as well. Also using named volumes.
I can also confirm. I kept getting an error with the following docker-compose.yml:
version: '3.3'
services:
snippet-box:
image: pawelmalak/snippet-box
container_name: snippet-box
restart: unless-stopped
ports:
- '5000:5000'
volumes:
- 'snippet-box-data:/app/data'
networks:
- reverse-proxy-network
volumes:
snippet-box-data:
external: true
networks:
reverse-proxy-network:
external: true
I changed the Volume to a Bind Mount in the following docker-compose.yml file and it has been working fine for me.
version: '3.3'
services:
snippet-box:
image: pawelmalak/snippet-box
container_name: snippet-box
restart: unless-stopped
ports:
- '5000:5000'
volumes:
- './data:/app/data'
networks:
- reverse-proxy-network
networks:
reverse-proxy-network:
external: true
For those running into this error; This appears to be a file system permission issue. At least when working with bind mounts.
Ran into the same thing on first deployment where docker (as the root user) would create the local directory and the container running as the node user (ID 1000) could not create the DB file.
After running a chown -R 1000:1000 on the snippet-box directory all works fine.
Has there been any progress on this one? I enjoy using snippet-box but following this thread it appears to have a bug surrounding named docker volumes. I had been using a bind mount happily but recently tried to move to a volume and no matter what I do I can't seem to get the container to even start. If I had logs it would be helpful but the container just flat out won't start. I suspected it was a permissions issue as person above listed but no permissions seem to fix it.