[GH-ISSUE #399] Bitwarden_rs Docker on LCOW: Database errors #229

Closed
opened 2026-03-03 01:27:00 +03:00 by kerem · 11 comments
Owner

Originally created by @djpbessems on GitHub (Feb 15, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/399

I'm trying to run the bitwarden_rs dockerimage on Windows Server 2019 with Linux Containers On Windows (LCOW).

I'm using the command
docker run -d --name bitwarden -v C:/path/to/bitwarden/conf:/data -p 80:80 -e "RUST_BACKTRACE=1" mprasil/bitwarden:latest
which results in the error
thread 'main' panicked at 'Failed to turn on WAL: DatabaseError(__Unknown, "disk I/O error")' (it creates several files in C:\path\to\bitwarden\conf)
and subsequent runs change the error to
thread 'main' panicked at 'Can't run migrations: QueryError(DatabaseError(__Unknown, "disk I/O error"))'

Permissions for the path C:\path\to\bitwarden\conf are set to FullControl for Users (temporarily for testing purposes); but the errors remain.

What possible troubleshooting steps could I still follow?

Originally created by @djpbessems on GitHub (Feb 15, 2019). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/399 I'm trying to run the bitwarden_rs dockerimage on Windows Server 2019 with Linux Containers On Windows (LCOW). I'm using the command `docker run -d --name bitwarden -v C:/path/to/bitwarden/conf:/data -p 80:80 -e "RUST_BACKTRACE=1" mprasil/bitwarden:latest` which results in the error `thread 'main' panicked at 'Failed to turn on WAL: DatabaseError(__Unknown, "disk I/O error")'` (it creates several files in C:\path\to\bitwarden\conf) and subsequent runs change the error to `thread 'main' panicked at 'Can't run migrations: QueryError(DatabaseError(__Unknown, "disk I/O error"))'` Permissions for the path C:\path\to\bitwarden\conf are set to FullControl for Users (temporarily for testing purposes); but the errors remain. What possible troubleshooting steps could I still follow?
kerem closed this issue 2026-03-03 01:27:00 +03:00
Author
Owner

@BlackDex commented on GitHub (Feb 16, 2019):

What i can find quickly on the internet is that this is an LCOW issue.
I read stuff about disable the shared drive, reboot, re-enable the shared drive again. Or try the reset credentials link at that same menu. It seems to have something to do with the credentials not being set right for the LCOW usage.

This issue has nothing to do with bitwarden_rs it self, since it only uses normal filesystem operations and is restricted by what the docker environment allows.

Hope the credentials part in the LCOW settings will help you.
Please let us know if that solves your issue.

<!-- gh-comment-id:464350250 --> @BlackDex commented on GitHub (Feb 16, 2019): What i can find quickly on the internet is that this is an LCOW issue. I read stuff about disable the shared drive, reboot, re-enable the shared drive again. Or try the reset credentials link at that same menu. It seems to have something to do with the credentials not being set right for the LCOW usage. This issue has nothing to do with bitwarden_rs it self, since it only uses normal filesystem operations and is restricted by what the docker environment allows. Hope the credentials part in the LCOW settings will help you. Please let us know if that solves your issue.
Author
Owner

@mprasil commented on GitHub (Feb 16, 2019):

Yeah, we're enabling WAL here for performance reasons and it sounds like your filesystem (or whatever windows emulates) doesn't support that in current configuration. Try to follow @BlackDex's advice to see if you can enable it.

Alternatively we might look into optionally not enabling WAL. I think it would be a useful feature for cases like this, but in the past we had some SQLITE_BUSY related issues where some operations (especially "heavy ones") sometimes (rarely, but still) failed. We've since added some code handling these problems, but disabling WAL would have to go with the understanding, that it's somewhat non-standard configuration that might sometimes cause issues.

<!-- gh-comment-id:464392853 --> @mprasil commented on GitHub (Feb 16, 2019): Yeah, we're [enabling `WAL` here](https://github.com/dani-garcia/bitwarden_rs/blob/6027b969f542b29365875fa78dbf77765b12d290/src/main.rs#L172-L174) for performance reasons and it sounds like your filesystem (or whatever windows emulates) doesn't support that in current configuration. Try to follow @BlackDex's advice to see if you can enable it. Alternatively we might look into optionally not enabling [`WAL`](https://sqlite.org/wal.html). I think it would be a useful feature for cases like this, but in the past we had some `SQLITE_BUSY` related issues where some operations (especially "heavy ones") sometimes (rarely, but still) failed. We've since added some code handling these problems, but disabling `WAL` would have to go with the understanding, that it's somewhat non-standard configuration that might sometimes cause issues.
Author
Owner

@dani-garcia commented on GitHub (Feb 16, 2019):

Yeah, WAL on LCOW seems to be a problem (https://github.com/docker/for-win/issues/1385#issuecomment-385177466, https://github.com/Sonarr/Sonarr/issues/1886).

As a possible alternative, you could install Rust and compile the project yourself. It should work fine in that case.

<!-- gh-comment-id:464393437 --> @dani-garcia commented on GitHub (Feb 16, 2019): Yeah, WAL on LCOW seems to be a problem (https://github.com/docker/for-win/issues/1385#issuecomment-385177466, https://github.com/Sonarr/Sonarr/issues/1886). As a possible alternative, you could install Rust and [compile the project yourself](https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary). It should work fine in that case.
Author
Owner

@djpbessems commented on GitHub (Feb 17, 2019):

@BlackDex I'm using Docker for Windows Enterprise Edition; it does not have the weird requirement of sharing your entire volumes.

Probably I'll have to bite the bullet and dive in this matter: I'll try and create a new dockerimage based on Windows Nanoserver so LCOW is not involved. Mind if I ask for pointers now and then? Once I get it working you can offer it as a semi-official alternative :)

<!-- gh-comment-id:464438752 --> @djpbessems commented on GitHub (Feb 17, 2019): @BlackDex I'm using Docker for Windows Enterprise Edition; it does not have the weird requirement of sharing your entire volumes. Probably I'll have to bite the bullet and dive in this matter: I'll try and create a new dockerimage based on Windows Nanoserver so LCOW is not involved. Mind if I ask for pointers now and then? Once I get it working you can offer it as a semi-official alternative :)
Author
Owner

@dani-garcia commented on GitHub (Feb 17, 2019):

Sure thing, we can help you here, or on the matrix chat room. The link is on the Readme.

<!-- gh-comment-id:464441950 --> @dani-garcia commented on GitHub (Feb 17, 2019): Sure thing, we can help you here, or on the matrix chat room. The link is on the Readme.
Author
Owner

@mprasil commented on GitHub (Feb 18, 2019):

I've created a PR #404 that will allow you to not use WAL by setting the ENABLE_DB_WAL variable to false.

<!-- gh-comment-id:464684361 --> @mprasil commented on GitHub (Feb 18, 2019): I've created a PR #404 that will allow you to not use WAL by setting the ` ENABLE_DB_WAL` variable to `false`.
Author
Owner

@djpbessems commented on GitHub (Feb 18, 2019):

Oh, awesome; are you going to merge and build that into mprasil/bitwarden dockerimage? Or should I build it myself and try?

<!-- gh-comment-id:464733662 --> @djpbessems commented on GitHub (Feb 18, 2019): Oh, awesome; are you going to merge and build that into mprasil/bitwarden dockerimage? Or should I build it myself and try?
Author
Owner

@mprasil commented on GitHub (Feb 18, 2019):

The idea is that this will be added to the official image soon if @dani-garcia is okay with the changes. So you can wait, but can also build your own image in the meantime if you're super eager to try it now. 😄

<!-- gh-comment-id:464764137 --> @mprasil commented on GitHub (Feb 18, 2019): The idea is that this will be added to the official image soon if @dani-garcia is okay with the changes. So you can wait, but can also build your own image in the meantime if you're super eager to try it now. 😄
Author
Owner

@mprasil commented on GitHub (Feb 18, 2019):

Changes are now merged, you can see the documentation here

Note that the build was just scheduled and will take about an hour. If you want to test it now, you can use our dev image that was built just now: bitwardenrs/dev:master, otherwise wait about two hours and use mprasil/bitwarden as usual.

Let us know if it runs fine with WAL disabled.

<!-- gh-comment-id:464785961 --> @mprasil commented on GitHub (Feb 18, 2019): Changes are now merged, you can see the documentation [here](https://github.com/dani-garcia/bitwarden_rs/wiki/Running-without-WAL-enabled) Note that the build was just scheduled and will take about an hour. If you want to test it now, you can use our dev image that was built just now: `bitwardenrs/dev:master`, otherwise wait about two hours and use `mprasil/bitwarden` as usual. Let us know if it runs fine with WAL disabled.
Author
Owner

@djpbessems commented on GitHub (Feb 19, 2019):

Thanks for this; it seems to run quite stable regardless :)

<!-- gh-comment-id:465024892 --> @djpbessems commented on GitHub (Feb 19, 2019): Thanks for this; it seems to run quite stable regardless :)
Author
Owner

@mprasil commented on GitHub (Feb 19, 2019):

Yeah I wouldn't be that much worried about stability. We had some rare cases where some calls would fail (just report 500, not crash or anything like that) due to some concurrency issues on sqlite. (sharing passwords with attachments was one of these) But normal usage wasn't affected by this at all. We've also added couple retries where we would previously fail at first try and recently I couldn't reproduce the issue even with really heavy requests. So I think you should be good.

Going to close this as I think it's resolved. If you have some time, maybe do a wiki on the WSL installation, I'm sure some people would be interested. Feel free to reopen or open new issue if you spot some other problems.

<!-- gh-comment-id:465082978 --> @mprasil commented on GitHub (Feb 19, 2019): Yeah I wouldn't be that much worried about stability. We had some rare cases where some calls would fail (just report `500`, not crash or anything like that) due to some concurrency issues on sqlite. (sharing passwords with attachments was one of these) But normal usage wasn't affected by this at all. We've also added couple retries where we would previously fail at first try and recently I couldn't reproduce the issue even with really heavy requests. So I think you should be good. Going to close this as I think it's resolved. If you have some time, maybe do a wiki on the WSL installation, I'm sure some people would be interested. Feel free to reopen or open new issue if you spot some other problems.
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#229
No description provided.