[Postgresql/DB] Database URL changes not respected #505

Closed
opened 2025-10-09 16:35:12 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @PrivatePuffin on GitHub.

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 @PrivatePuffin on GitHub. ### 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
Author
Owner

@PrivatePuffin commented on GitHub:

Can confirm user error, issue can stay closed.

@PrivatePuffin commented on GitHub: Can confirm user error, issue can stay closed.
Author
Owner

@PrivatePuffin commented on GitHub:

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!

@PrivatePuffin commented on GitHub: > 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

@BlackDex commented on GitHub:

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.

@BlackDex commented on GitHub: 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#505