[GH-ISSUE #4511] [Postgresql/DB] Database URL changes not respected #1908

Closed
opened 2026-03-03 02:13:17 +03:00 by kerem · 3 comments
Owner

Originally created by @Crow-Control on GitHub (Apr 18, 2024).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4511

Subject of the issue

When changing the DATABASE_URL ENV var, the change isn't respected and the application still tries to access the old url.
This is primarily important when database passwords change.

Having this as an env-var gives the impression it does more than just set it at first boot.

Deployment environment

Docker/Helm/Kubernetes, irrelevant (container feature)

  • vaultwarden version:
    Latest (All?)
  • Install method:

  • MySQL/MariaDB or PostgreSQL version:
    Postgresql, should alson happen with MariaDB

  • Other relevant details:

Steps to reproduce

Expected behaviour

  • Install in what-ever way you fancy
  • Change database password on the side of the DB
  • Change DATABASE_URL env var to match the new password
  • Cannot connect

Actual behaviour

  • It should respect the new env var

Troubleshooting data

Might be related to using the admin interface afterwards or not, this I would need to verify

Originally created by @Crow-Control on GitHub (Apr 18, 2024). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4511 ### Subject of the issue When changing the DATABASE_URL ENV var, the change isn't respected and the application still tries to access the old url. This is primarily important when database passwords change. Having this as an env-var gives the impression it does more than just set it at first boot. ### Deployment environment Docker/Helm/Kubernetes, irrelevant (container feature) <!-- The version number, obtained from the logs (at startup) or the admin diagnostics page --> <!-- This is NOT the version number shown on the web vault, which is versioned separately from vaultwarden --> <!-- Remember to check if your issue exists on the latest version first! --> * vaultwarden version: Latest (All?) <!-- How the server was installed: Docker image, OS package, built from source, etc. --> * Install method: * MySQL/MariaDB or PostgreSQL version: Postgresql, should alson happen with MariaDB * Other relevant details: ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start vaultwarden? --> ### Expected behaviour <!-- Tell us what you expected to happen --> - Install in what-ever way you fancy - Change database password on the side of the DB - Change DATABASE_URL env var to match the new password - Cannot connect ### Actual behaviour - It should respect the new env var ### Troubleshooting data Might be related to using the admin interface afterwards or not, this I would need to verify
kerem closed this issue 2026-03-03 02:13:17 +03:00
Author
Owner

@BlackDex commented on GitHub (Apr 18, 2024):

You probably have changed/saved the config via the Admin Interface, in that case there is a config.json located in the data directory. Values in the config.json override environment variables.

<!-- gh-comment-id:2063517157 --> @BlackDex commented on GitHub (Apr 18, 2024): You probably have changed/saved the config via the Admin Interface, in that case there is a `config.json` located in the data directory. Values in the `config.json` override environment variables.
Author
Owner

@Crow-Control commented on GitHub (Apr 18, 2024):

You probably have changed/saved the config via the Admin Interface, in that case there is a config.json located in the data directory. Values in the config.json override environment variables.

Well it's not me, it's one of our users...
I might've been to receptive for the feedback there, i'll reopen if I can reproduce more thoroughly!

<!-- gh-comment-id:2063524057 --> @Crow-Control commented on GitHub (Apr 18, 2024): > You probably have changed/saved the config via the Admin Interface, in that case there is a `config.json` located in the data directory. Values in the `config.json` override environment variables. Well it's not me, it's one of our users... I might've been to receptive for the feedback there, i'll reopen if I can reproduce more thoroughly!
Author
Owner

@Crow-Control commented on GitHub (Apr 18, 2024):

Can confirm user error, issue can stay closed.

<!-- gh-comment-id:2063563740 --> @Crow-Control commented on GitHub (Apr 18, 2024): Can confirm user error, issue can stay closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#1908
No description provided.