vaultwarden won't connect to MySQL database server #1236

Closed
opened 2026-02-05 00:20:56 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @skybro6789 on GitHub (Mar 19, 2022).

Vaultwarden won't connect and so won't start sadly. Idk what's wrong keeps repeating I don't know why, tried recreating the container and downloading the new image and no go. Can connect to the MySQL using 3rd party stuff, on both my personal computer and the server vaultwarden is on (using docker) all computers are in a local database (MySQL server is on a different system but connectable from any system within the network) unsure what to do, Please help!

[2022-03-19 00:35:59.183][vaultwarden::util][WARN] Can't connect to database, retrying: Failed to create pool.

[CAUSE] Error(


,

)

[2022-03-19 00:36:40.453][vaultwarden::util][WARN] Can't connect to database, retrying: Failed to create pool.

[CAUSE] Error(


,

)

Originally created by @skybro6789 on GitHub (Mar 19, 2022). Vaultwarden won't connect and so won't start sadly. Idk what's wrong keeps repeating I don't know why, tried recreating the container and downloading the new image and no go. Can connect to the MySQL using 3rd party stuff, on both my personal computer and the server vaultwarden is on (using docker) all computers are in a local database (MySQL server is on a different system but connectable from any system within the network) unsure what to do, Please help! [2022-03-19 00:35:59.183][vaultwarden::util][WARN] Can't connect to database, retrying: Failed to create pool. [CAUSE] Error(  , ) [2022-03-19 00:36:40.453][vaultwarden::util][WARN] Can't connect to database, retrying: Failed to create pool. [CAUSE] Error(  , )
Author
Owner

@BlackDex commented on GitHub (Mar 19, 2022):

Please provide the docker or docker-compose config you use to start the container. Maybe this can help us to see what is wrong.

@BlackDex commented on GitHub (Mar 19, 2022): Please provide the docker or docker-compose config you use to start the container. Maybe this can help us to see what is wrong.
Author
Owner

@skybro6789 commented on GitHub (Mar 19, 2022):

I removed the real user and password even though the IP is internal just incase 😅 I also forgot to mention that it worked when I first setup just fine for a while but randomly started having this issue

version: '3.3'
services:
    server:
        container_name: vaultwarden
        image: 'vaultwarden/server:latest'
        volumes:
            - './vw-data/:/data/'
        ports:
            - '8081:80'
        environment:
           - "DATABASE_URL=mysql://[user]:[password]@10.0.0.13:3306/vaultwarden"
           - "ADMIN_TOKEN=SECRET"
           - "RUST_BACKTRACE=1"
        restart: unless-stopped
@skybro6789 commented on GitHub (Mar 19, 2022): I removed the real user and password even though the IP is internal just incase 😅 I also forgot to mention that it worked when I first setup just fine for a while but randomly started having this issue ```yaml version: '3.3' services: server: container_name: vaultwarden image: 'vaultwarden/server:latest' volumes: - './vw-data/:/data/' ports: - '8081:80' environment: - "DATABASE_URL=mysql://[user]:[password]@10.0.0.13:3306/vaultwarden" - "ADMIN_TOKEN=SECRET" - "RUST_BACKTRACE=1" restart: unless-stopped ```
Author
Owner

@BlackDex commented on GitHub (Mar 19, 2022):

I would suggest to check the logs of MySQL also, it could be that there are some errors there which can help.
It could be that vaultwarden is not allowed to connect because of the IP it is connecting from maybe.

Also try to set LOG_LEVEL=DEBUG or TRACE maybe that gives a bit more info (But i doubt it).

@BlackDex commented on GitHub (Mar 19, 2022): I would suggest to check the logs of MySQL also, it could be that there are some errors there which can help. It could be that vaultwarden is not allowed to connect because of the IP it is connecting from maybe. Also try to set `LOG_LEVEL=DEBUG` or `TRACE` maybe that gives a bit more info (But i doubt it).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1236