Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-image won't start // Database connection error #46

Open
leisefuxX opened this issue Mar 1, 2022 · 7 comments
Open

Docker-image won't start // Database connection error #46

leisefuxX opened this issue Mar 1, 2022 · 7 comments

Comments

@leisefuxX
Copy link

leisefuxX commented Mar 1, 2022

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 (:

@natget21
Copy link

I am facing the same issue as well I run it on raspberry pi using the arm tag

@chrisbward
Copy link

+1

@chrisbward
Copy link

#34

Spotted this issue - could be because I'm using named volumes

@null-affinity
Copy link

I'm getting this condition as well. Also using named volumes.

@Trevo525
Copy link

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

@RoboMagus
Copy link

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.

@sysblob
Copy link

sysblob commented Mar 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants