mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-10 01:10:09 +03:00
OpenSSL-related crashes on Docker Alpine image #1176
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JeDaYoshi on GitHub.
Subject of the issue
Looking at my vaultwarden logs, I noticed something peculiar in them. Apparently, vaultwarden has had occasional crashes due to OpenSSL errors, which seem pretty random.
I have not noticed any disruption while using it, but it raises an eye.
Deployment environment
vaultwarden/server:testing-alpine,amd64)Steps to reproduce
Unsure. I have pretty much a "regular" setup, with
WEBSOCKET_ENABLEDand that's it.It seems to have happened
duringa while after regular sync intervals, no entries added or anything.@JeDaYoshi commented on GitHub:
I don't have TLS enabled on Vaultwarden. It's served via HTTP to Caddy.
I am using
testing-alpinealready, as pointed out in the original issue. I don't recall seeing this issue in the latest stable version, but I can't give out any confirmations right now.@BlackDex commented on GitHub:
It almost looks like you also have Vaultwarden configured to serve HTTPS to Caddy.
The SSL implementation for the Rocket version used is a bit unstable sometimes. That is why we suggest to use a reverse proxy and let it offload the SSL also.
I'm not sure if you have it configured like that, but if that is the case i would suggest two things to try
testing-alpineversion and see if that helps. That version has a newer library.@JeDaYoshi commented on GitHub:
Yep.
@BlackDex commented on GitHub:
Ah indeed. Sorry late here already hehe.
Is the postgresql connection secured with ssl?
That would be the only item left which i can think of.
@JeDaYoshi commented on GitHub:
Actually, good point. Isn't PostgreSQL secured with TLS by default?
That could possibly be it. Would also explain why it's not exactly when a HTTP request is received.
@JeDaYoshi commented on GitHub:
Let's see if it crashes again, and if so, I'll ask for it. You can build it anyway if it's no issue.
Looking good so far, though.
@JeDaYoshi commented on GitHub:
I'm gonna try adding
?sslmode=disableto the PostgreSQL URI and see if it still crashes. Shouldn't matter that much since they're in the same server.Will report back with results.
@BlackDex commented on GitHub:
Its either that, or there is a weird issue with the client which is still using a PostgreSQL v11 library.
The library does indeed first tries ssl, if that fails it tries without.
@BlackDex commented on GitHub:
I tried this my self using a postgre docker container with a self-signed ssl-cert.
I'm not seeing any issues so far.
I created a personal vault with 9000+ items in it and a org vault with 2200+ items.
It seems to keep working.
Looking the the version string of your PostgreSQL Instance, you are probably using the exact same container.
I'm not sure which parameters you used to start it, but i used the following:
And i started the Vaultwarden container like this:
I then used the Bitwarden Desktop, CLI and Browser extension to login to the instance and add/sync items.
I left it running for a long time and did some more testing and no issues as of yet.
Not sure what could be the issue on your side then though.
Have you tried to restart the PostgreSQL instance/server?
@BlackDex commented on GitHub:
When a newer version of the testing will be released it will be using a newer version of OpenSSL. Maybe that helps, but i doubt it actually. But who knows.
But please keep us posted.
Edit:
If needed, i could build a version which uses PostgreSQL v14 btw instead of PQ11
@JeDaYoshi commented on GitHub:
I restarted it before creating this issue.
So far, it has still been working fine. No crashes or any odd errors. I'll try switching back to TLS.
@JeDaYoshi commented on GitHub:
...And nothing.
It's just.. working.
Software.
@BlackDex commented on GitHub:
Still strange.
I can understand that you would prefer a secure db connection.
I dived a bit into the specific errors, the only thing i can see is that it could be some weird OpenSSL version difference somewhere. The Alpine image has a statically linked OpenSSL which could differ a bit from the OpenSSL installed by Alpine, but i'm not seeing how those two would even interact, since the vaultwarden application shouldn't be using the OS libraries at all.
Maybe a newer build of the Alpine image would solve this, since they then probably both use OpenSSL v1.1.1n on all levels.
@JeDaYoshi commented on GitHub:
I have no idea what's happening in here either, but yeah, it's functional..
Probably a newer build would be fine. The crashes are indeed strange.