mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #6416] Deleted Items stop login working #2427
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#2427
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @SAS-1 on GitHub (Oct 30, 2025).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/6416
Prerequisites
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Environment settings which are overridden: DOMAIN, ADMIN_TOKEN
Config:
Vaultwarden Build Version
v1.34.3-3cd3d33d
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
SWAG
Host/Server Operating System
Linux
Operating System Version
No response
Clients
Web Vault, Android
Client Version
2025.10.0
Steps To Reproduce
Have deleted item in Vault
Log into App or Web client and it won't let you in just spins - log below
Expected Result
Able to login and deleted items in Recycle Bin
Actual Result
It just spins on Web vault after entering master password and before 2FA.
Logs
Screenshots or Videos
No response
Additional Context
If I run
UPDATE ciphers SET deleted_at = NULL WHERE deleted_at IS NOT NULL;
to remove date and try logging in it works immediately but the record isn't in recycle bin.
It seems to be related to yesterday commit
2ee5819Use Diesels MultiConnections Derive (https://github.com/dani-garcia/vaultwarden/pull/6279)@weiznich commented on GitHub (Oct 31, 2025):
That sounds like yet another instance of https://jira.mariadb.org/browse/CONC-782. So it's likely an upstream issue in libmariadb.
@BlackDex commented on GitHub (Oct 31, 2025):
You could use the Alpine image which shouldn't have this issue.
@tessus commented on GitHub (Oct 31, 2025):
Is this issue only a problem with the container image? After reading all the different issues starting with weiznich's link above it seems that this is always a problem when the mariadb connector lib is greater than 3.3.15.
e.g. Fedora 42 and 43 use mariadb-connector-c-3.4.5
So what is the solution? I compile vaultwarden on Fedora since my server runs Fedora.
@weiznich commented on GitHub (Nov 3, 2025):
@tessus There is no solution you as an end user can apply here other than not using the distro provided libmariadb version as it is not compatible with any diesel based application. You might want to notify the package maintainers of your distribution about this problem as well.
See https://github.com/diesel-rs/diesel/discussions/4806#discussioncomment-14857450 for more steps you can take.
@tessus commented on GitHub (Nov 3, 2025):
@weiznich thanks for the reply. Although I am a bit fuzzy on the situation. Version 3.3.15 is 7 months old. Most distributions have already moved on to 3.4.z, thus - as you mentioned - the only 2 options are: 1) for distros to use a patch or 2) for the libmariadb devs to make the lib compatible with mysql again.
A fix for diesel seems complex, since one would then also have to check for library versions. Hmm. This might be a maintenance burden in the future.
I will also check, whether I can just use the mysql client lib or connector or whatever is required instead of mariadb-connector-c-devel to compile vw.
I can certainly open an issue with the Fedora packagers and bug the mariadb devs, but I doubt that the latter will have any effect on the betterment of the situation. In the ticket you referenced they were rather determined to ignore the truth and live with the inconsistencies in their code. You cannot convince people like that nor have a constructive discussion with them.
@tessus commented on GitHub (Nov 4, 2025):
So... before trying to replace
mariadb-connector-cwithmysql-community-libs, I built the current main HEAD9017ca265aon Fedora withmariadb-connector-c-3.4.5-1. I checked, they are not using any patches, so I should have received the same error as described in this issue.On my test VM with a previous version of vw, I deleted a cipher and it was moved to the trash. Then I installed the new vw version, but was able to login. No errors in the log, no panic, no endless spinner in the webui.
Running
select uuid, deleted_at from ciphers where deleted_at is not nullconfirmed that I had in fact 5 such entries in my database.So now I am even more confused. I should have experienced the same issue as the OP. 🤔
@BlackDex commented on GitHub (Nov 4, 2025):
@tessus, 3.4.5 is not affected. Only versions after that.
@tessus commented on GitHub (Nov 4, 2025):
@BlackDex thanks for the info. I guess I misunderstood https://github.com/diesel-rs/diesel/discussions/4806#discussioncomment-14814651 then, which mentioned downgrading to 3.3.15.
So I think I will work on trying to use the mysql lib instead. The problem is that mysql is not part of Fedora, which means creating a package that requires a lib from a non-Fedora repo makes it less portable/usable. This really sucks. On the other side, I am probably the only one using my Fedora vaultwarden package anyway. Well, first I have to make it work...
@weiznich commented on GitHub (Nov 4, 2025):
A possible solution would be to explicitly add the
mysqlclient-syscrate to thevaultwardendependency list. Then you should be able to usecargo install vaultwarden -F mysql -F mysqlclient-sys/bundledto build and statically link a version oflibmysqlclientthat is known to work with diesel.@BlackDex commented on GitHub (Nov 4, 2025):
That is what I'm thinking about as trying to install older packages is also not really nice and easy. It will make compiling take longer though, at least the first time and as long the cache doesn't gets busted.
@weiznich commented on GitHub (Nov 4, 2025):
I would suggest exposing this as optional feature so users could decide to use this or not. There are reasons to use one or the other variant. Using the system libraries allows you to easily update these libraries if necessary and overall better integrates in how linux distributions want to have their packages. On the other hand that means supporting several different versions of the library which can cause problems if the underlying is not carefully about changes itself. For deployment setups (docker/etc) is often easier to just statically link everything into one binary by using the bundled feature. Also as you already wrote: Buildtimes obviously suffer from this.
For building
libmysqlclient-sysvia the bundled feature it's required to havecmake+ a working c/c++ compiler.@BlackDex commented on GitHub (Nov 4, 2025):
My main problem currently is that we use Debian Trixie, which uses a faulty version, and now causes these issues for our Debian based containers.
@tessus commented on GitHub (Nov 4, 2025):
I can try that tomorrow. I just patch the Cargo.toml before building. Nice.
As for the build time: Mathijs' last improvement PR pushed it down from 18 minutes to 14 minutes on my build VMs. Also, I am not building every 5 minutes, but when there are interesting commits in main. And even if I were building a package every day, I wouldn't care whether it took 14 minutes or 60 minutes. As long as it didn't take more than 24h. ;-) hahaha.
My thoughts exactly. I want to find a proper solution now instead of 6 months from now when older versions of the mariadb-connector are no longer available. That would require me to build my own connector and either statically link that one or build another connector package. I reckon I'd rather go with statically linking the mysql lib....
I will still open a ticket with the Fedora mariadb-connector packager.
@weiznich commented on GitHub (Nov 4, 2025):
Such an feature could also be enabled by "default" with some way to disable it. Eg. by having the
vaultwardenmysqlfeature enable thebundledfeature, but also provide amysql-unbundledfeature that doesn't bundle the lib.Other than that I see the following options:
@tessus commented on GitHub (Nov 4, 2025):
Here's my feedback. It worked mostly great, but interestingly I had to install 3 packages:
libtirpc-devel,perl-Time-Piece, andncurses-devel. (The cargo build process failed 3 times.) While I understand the first 2, ncurses makes no sense for a mysql lib nor for the build process. But it's not an issue, just strange.Then it compiled successfully, but spat out a warning:
I updated with
cargo update num-bigint-dig, but 0.8.5 yielded the same warning. It seems an additional fix has been added after 0.8.5 was released, so that should be solved soon.The size of the binary has increased from 38 MB to 52 MB.
Digging a bit deeper it seems that-F mysqlclient-sys/bundlednot only statically linked mysql, but also openssl. Hmmm. This is rather annoying and makes me slightly unhappy. But I guess I will have to live with it.Another strange thing is that I removed all mariadb* packages before building vw with
-F mysqlclient-sys/bundledand there was nolibmysqlclientlibrary (static or dynamic) on the system, because I forgot to install it after removing the mariadb packages. I ran a find on / and there was definitely not another one hiding somewhere else. Yet, I did not encounter a build error. Both cratesmysqlclient-sysandmysqlclient-srcexplicitly state that thelibmysqlclientlibrary is required for building them.I tested the binary and it works. I don't understand why and how, but it does.
The only explanation I could come up with is that
mysqlclient-sys/bundledbuilds a static library even without the mysql development and library packages installed. But for the default feature set, a dynamic lib from the system is used.Anyhoo, all in all it was successful. Thanks for the
mysqlclient-sys/bundledsuggestion.Now I'll have to decide whether I accept the fact that openssl is statically linked or that the resulting binary depends on a non-Fedora package.Decisions, decisions. (crap, there is no pulling-out-my-hair emoji)
For reference:
ldd before
ldd after
P.S.: I made a mistake. openssl is not linked statically.
@weiznich commented on GitHub (Nov 5, 2025):
These are required by mysql itself. There is unfortunately no way to run their configure script only for libmysqlclient, so you need to have all dependencies for all parts of the code on your system.
As far as I can tell this is correct, but might be something that could be changed.
github.com/sgrif/mysqlclient-sys@65d2f05886/mysqlclient-src/Cargo.toml (L203)specifies that it uses the bundled openssl-sys build. It would need to be something more along this https://github.com/sgrif/pq-sys/blob/master/pq-src/Cargo.toml#L206 line. This likely requires some additional tweaking of the build parameters passed to cmake. Contributions for that are certainly welcome. With a solution like that implemented in pq-sys you would be able to dynamically link openssl or statically link it as well by manually enabling the openssl/vendored feature from the top level crate.The
mysqlclient-srccrate brings it's own copy of the mysql source code. https://docs.rs/crate/mysqlclient-src/latest/source/source/. So yes it still requires libmysqlclient but it brings its own version to satisfy that requirement.@tessus commented on GitHub (Nov 5, 2025):
@weiznich thx for your reply. I made a mistake and it seems that the openssl is not statically linked.
I also found out that Fedora apparently now has mysql in its default repo as well. I don't know when that happened, but it seems it is no longer necessary to use the oracle mysql repo. I recall a rather nasty fight about licensing and whatnot, but I guess this was resolved at one point.
This means I can choose to statically link the mysql client or not. I like to have options, so that's great.
@BlackDex commented on GitHub (Nov 5, 2025):
I think it is, and to make it worse, it's statically linked, and dynamically.
The MySQL Client library uses the statically linked version, and all other parts of Vaultwarden will use the dynamically linked version.
You can verify this by running this command on the resulted binary.
I'm not sure you can fully statically link a glibc library externally provided, but i could be wrong of course. Also, if you build against the Oracle MySQL and only provide the binary, and someone has the MariaDB client installed, that could cause weird issues.
@BlackDex commented on GitHub (Nov 5, 2025):
I tried to use the
OPENSSL_NO_VENDOR=trueoption, but that is causing race-condition and always fails to build, no matter if i point specifically to the correct libraries. So, probably the only way to fix that is by adding ano-bundled-opensslfeature to mysqlclient-sys/src, or make bundled-openssl the default, as Weiznich mentioned@BlackDex commented on GitHub (Nov 5, 2025):
I think we need to stop building Debian images, and only use Alpine from now on.
There we (I my self) control which version is used, and i might even be able to switch to Oracle's version, but that is probably not the best idea either.
@weiznich commented on GitHub (Nov 5, 2025):
Just to mention that as that would be another option to sidestep this mess: Diesel-async doesn't use the c client libraries for mysql/postgres. You could likely use
AsyncConnectionWrapper<AsyncMysqlConnection>as drop in replacement ofdiesel::MysqlConnection.Switching to diesel_async for "everything" is likely more work as it would break e.g.
#[derive(MultiConnection)]@BlackDex commented on GitHub (Nov 5, 2025):
Using diesel_async and those libraries also brings in aws-lc or we need to use ring. I'm not sure how that will break all users which have a secure connection. Only using Alpine/Static build libraries will at least work as a drop-in replacement (for the most part). So i think for now, to at least not causes issues with a new version we want to release soon, is stop building Debian for now.
The Async stuff would be nice in the future, but If that now might cause breaking or different way of working for the just recently merged MultiConnection, that would be a pain.
@BlackDex commented on GitHub (Nov 5, 2025):
I Think i will do something else, ill switch to Ubuntu, that has Oracle's MySQL version in the repo.Scrap that, Ubuntu doesn't support all architectures we provide currently.
@BlackDex commented on GitHub (Nov 5, 2025):
FYI: I created a PR to stop building Debian images #6440
@tessus commented on GitHub (Nov 5, 2025):
I agree, it is not optimal, but in reality not a problem. And unfortunately this happens more often than you might think.
But let's play it through: The statically linked OpenSSL is the same as the one currently installed on the system. (in my case 3.5.4)
So database operations are handled by this version of OpenSSL. Everything works.
The rest of vaultwaden uses the dynamically linked version of OpenSSL, which is currently also 3.5.4. Everyhing works.
In the future, OpenSSL will be updated by the Linux distro. Please note that distros make sure that updates to OpenSSL are ABI compatible. In rare cases when this is not the case, the "old" shared lib is still kept in place. So even though the new version might be 3.5.z or 3.6.z, the binaries using the shared lib will still work. So will the database operations via the statically linked code.
The reason why I am unhappy, is 3-fold: 1) it's a waste of space 2) new features that might be possible with newer versions of OpenSSL would not be available for the database operations 3) security updates. The latter 2 are more or less philosophical, since it takes a while to propagate stuff from OpenSSL, through crates, to vw code. TLS is used by the mysql client for establishing a connection - that's it. No new feature will be that important, especially since a connection will still be established either way. Security updates are important, but by that time I'll have already created a new package.
To circle back, it is not optimal, but it is not an operational showstopper.
No, this wouldn't be the case. There are a bunch of safeguards in place:
The mariadb library has a different name from the mysql library. Even if it were installed on the target system it wouldn't be used.
The Oracle MySQL and Fedora MySQL packages use the same library name, but different package names. However, these packages are pretty much the same - and 100% ABI compatible.
Thus a system could have either one installed and vaultwarden would run just fine.
Adittionally, RPMs allow you to specify dependencies. I could require a specific package (one of the 2), make it conflicting with the other, or I could allow both, or even specify the full path to the library (which is IMO a bad idea).
Thus, if I were to build against Oracle MySQL and allow the target system to use the Fedora MySQL client package, all would be good.
@tessus commented on GitHub (Nov 5, 2025):
@BlackDex why not just use the oracle apt repo? It's quite straightforward to setup. Adding this to the build process should be an easy endeavor.
I am not a fan of Oracle (I was in IBM DB2 development for a long time), but if it is an easy fix, why not use it?
@BlackDex commented on GitHub (Nov 5, 2025):
Oracle only builds amd64 and arm64, so not all architectures we support are available. Kinda the same as with Ubuntu. Only armhf is available, and we currently also provide arm (no hf).
While I'm not sure if that is still used, but i think it is, older NAS devices run on this.
@tessus commented on GitHub (Nov 5, 2025):
@BlackDex Thanks, this makes sense. I haven't thought of that. On the other hand, it doesn't hurt to just provide what is possible. There is no rule that states you have to provide containers/packages for all supported platforms. ;-)
I'm sure that people who are currently using your Debian containers on {amd,arm}64 will appreciate it.
@BlackDex commented on GitHub (Nov 5, 2025):
There is also no main reason to provide all these different container images if we need to jump through hoops.
The static binaries work fine, Alpine has 0 security issues according to trivy, and Debian, 51 and Ubuntu 11, so that is also a win from my point of view.
@BlackDex commented on GitHub (Nov 9, 2025):
Ok.. I found something strange, and please if someone can correct me if I'm wrong here.
But i tried ArchLinux version of Vaultwarden, and that seems to work just fine, though is seems to be using the
12.0.2server version, which uses the3.4.7connecter-c version. And there are no issue there.I see no patches done on the client, so, something most be different?
Maybe @polyzen could help here to clarify this maybe?
@BlackDex commented on GitHub (Nov 9, 2025):
Ok... So.... I tried the Alpine package of Vaultwarden too, and that seems to work also...
This doesn't make it less strange.
@BlackDex commented on GitHub (Nov 9, 2025):
@weiznich, I'm not sure what exactly has changed in v2.3.x of Diesel which could cause this behavior.
But When testing the Alpine/Arch binaries, they worked just fine, then looking at the dependencies, it was still using Diesel v2.2.12.
Now i reverted Diesel back to v2.2.12 in my testing environment, and i needed to make some changes to get it to work like remove BigDecimal (Because that was fixed in a newer version) and some other small stuff, but it builds fine, and also doesn't cause this bug to happen.
Isn't there still a chance something broke in Diesel which caused a regression to happen?
@weiznich commented on GitHub (Nov 9, 2025):
It "works" with older diesel versions because the check that generates this error was only introduced recently with https://github.com/diesel-rs/diesel/pull/4756
These checks were introduced as reaction to a code audit. See the report here.
Without this check the relevant code could and technically does perform a out of bounds read.
Am I 100% sure that this is bug free now? No, but I'm certain that this is now more correct than before.
https://github.com/diesel-rs/diesel/pull/4851 might help to actually address the problem, it still need some time from me to understand if that is sound.
@BlackDex commented on GitHub (Nov 10, 2025):
Ah cool, thanks for the details.