Persistent data check does not work with volumes #1326

Closed
opened 2026-02-05 00:37:59 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @TymanWasTaken on GitHub (Jul 20, 2022).

Subject of the issue

When using a docker volume, vaultwarden incorrectly determines it to not be persistent storage

Deployment environment

  • vaultwarden version: 1.25.1
  • Install method: Docker image

  • Clients used: N/A

  • Reverse proxy and version: N/A

  • MySQL/MariaDB or PostgreSQL version: N/A

  • Other relevant details: Docker version 20.10.17

Steps to reproduce

Attempt to run vaultwarden mounting a docker volume to /data, no other configuration changes

Expected behaviour

Vaultwarden starts fine

Actual behaviour

Vaultwarden refuses to start without the I_REALLY_WANT_VOLATILE_STORAGE env variable set

Troubleshooting data

No troubleshooting data, but I believe this is caused because of a difference in how bind mounts work and how volume works. From what I can tell, vaultwarden detects non-persistent storage by creating a file in the dockerimage, and then checking for it on start. However, this is flawed because docker will automatically populate volumes with any files that images create, making that file visible to vaultwarden regardless of the fact that it is actually persistent storage. I temporarily fixed this by just setting I_REALLY_WANT_VOLATILE_STORAGE=true, but it is still a bug that should probably be fixed.

Originally created by @TymanWasTaken on GitHub (Jul 20, 2022). <!-- # ### NOTE: Please update to the latest version of vaultwarden before reporting an issue! This saves you and us a lot of time and troubleshooting. See: * https://github.com/dani-garcia/vaultwarden/issues/1180 * https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/redact personal or confidential information, such as passwords, IP addresses, and DNS names as appropriate. --> ### Subject of the issue <!-- Describe your issue here. --> When using a docker volume, vaultwarden incorrectly determines it to not be persistent storage ### Deployment environment <!-- ========================================================================================= Preferably, use the `Generate Support String` button on the admin page's Diagnostics tab. That will auto-generate most of the info requested in this section. ========================================================================================= --> <!-- 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: 1.25.1 <!-- How the server was installed: Docker image, OS package, built from source, etc. --> * Install method: Docker image * Clients used: N/A <!-- web vault, desktop, Android, iOS, etc. (if applicable) --> * Reverse proxy and version: N/A <!-- if applicable --> * MySQL/MariaDB or PostgreSQL version: N/A <!-- if applicable --> * Other relevant details: Docker version 20.10.17 ### 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? --> Attempt to run vaultwarden mounting a docker volume to `/data`, no other configuration changes ### Expected behaviour <!-- Tell us what you expected to happen --> Vaultwarden starts fine ### Actual behaviour <!-- Tell us what actually happened --> Vaultwarden refuses to start without the I_REALLY_WANT_VOLATILE_STORAGE env variable set ### Troubleshooting data <!-- Share any log files, screenshots, or other relevant troubleshooting data --> No troubleshooting data, but I believe this is caused because of a difference in how bind mounts work and how volume works. From what I can tell, vaultwarden detects non-persistent storage by creating a file in the dockerimage, and then checking for it on start. However, this is flawed because docker will automatically populate volumes with any files that images create, making that file visible to vaultwarden regardless of the fact that it is actually persistent storage. I temporarily fixed this by just setting I_REALLY_WANT_VOLATILE_STORAGE=true, but it is still a bug that should probably be fixed.
Author
Owner

@BlackDex commented on GitHub (Jul 20, 2022):

Closing as a duplicate of #2622

@BlackDex commented on GitHub (Jul 20, 2022): Closing as a duplicate of #2622
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1326