mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-09 04:32:44 -05:00
Uploading files to Vaultwarden for Attachments or Send using Bitwarden Android app v2.18.0 (4572) does not work. #4930
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 @mrclschstr on GitHub (May 29, 2022).
Originally assigned to: @BlackDex on GitHub.
Subject of the issue
Uploading files to Bitwarden Send using Bitwarden Android app v2.18.0 (4572) does not work.
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: DOMAIN, ADMIN_TOKEN
Steps to reproduce
Open latest BItwarden Android app and create a new file in Send. Clicking
Saveresults in an error message:Es ist ein Fehler aufgetreten(german, translates to "An error occurred").Expected behaviour
A Send file is created and can be shared with others.
Actual behaviour
File is not uploaded to Send.
Troubleshooting data
You can upload a file via the web interface without any issue. I just discovered this error using the Bitwarden Android app v2.18.0 (4572). The vaultwarden trace logs show the following:
Vaultwarden Trace Log
It seems that the Bitwarden Android app uses the API
/api/sends/file/v2(resulting in422 Unprocessable Entity) whereas the the web interface uses the API/api/sends/file.To rule out the possibility that the error is coming from the nginx reverse proxy, I've executed the command
curl -sD - -o /dev/null http://localhost/api/sends/file/v2directly in the vaultwarden container shell. I still get the 404 error:Does vaultwarden not yet implement the v2 api endpoint?
@BlackDex commented on GitHub (May 29, 2022):
Looks like the mobile clients send the data in a different way then the web-vault.
The same goes for Attachments as reported in #2512
@nathanael-h commented on GitHub (May 31, 2022):
Indeed:
b8b41fe847/src/Core/Services/ApiService.cs (L253)@BlackDex commented on GitHub (May 31, 2022):
They still also support v1, but they seem to send different kind of parameters.
@BlackDex commented on GitHub (Jun 1, 2022):
It looks like this is an issue of some interpretation of the RFC's and what is commonly used currently.
During a multipart/data stream it is encouraged to use quotes around field names, and most clients seem to do that, and a lot of servers seem to not allow unquoted items. This is the same for Rocket. For some reason the Android client doesn't quote some field names, and that causes Rocket to not parse the request correctly.
Now they have created a PR after some debugging together with me, but that PR now causes it to be the other way around 😆 .
I got it working on the Android app, but not via the web-vault anymore. So, we just have to wait until that is solved for this to work unfortunately.
For those who are interested: https://github.com/rousan/multer-rs/pull/42
@KnightTim commented on GitHub (Jun 23, 2022):
Using web vault Version 2022.05.0 I can no longer upload attachments, I believe this is likely caused by the same issue.
Your environment (Generated via diagnostics page)
I can upload any other info needed, please let me know.
@BlackDex commented on GitHub (Jun 23, 2022):
@KnightTim uploading attachments via the web-vault is broken? Or using the other clients?? Because for me uploading via the web-vault works without issues. Only the mobile and cli clients give issues.
@KnightTim commented on GitHub (Jun 23, 2022):
@BlackDex I get this error

What version of the web-vault are you running?
Edit: created a discussion https://github.com/dani-garcia/vaultwarden/discussions/2573
@BlackDex commented on GitHub (Jun 23, 2022):
The exact same version. I suggest to start a discussion regarding this (not a new issue) and not clutter this issue, since i think you have some reverse proxy config issues.
@svenstaro commented on GitHub (Jul 15, 2022):
As an update, the upstream PR was merged in
677ce5cd1band released in multer 2.0.3.@mrclschstr commented on GitHub (Aug 7, 2022):
Unfortunately this issue seems still not fixed for me; same issue, same 404 error. Meanwhile I'm currently using vaultwarden v1.25.1 and the Android app v2022.6.2 (4851).
@BlackDex commented on GitHub (Aug 7, 2022):
Have you installed the
testingtagged image? Or are you using thelatesttagged image?Because the fix is only in the
testingtagged image.@BlackDex commented on GitHub (Aug 7, 2022):
To give a bit more context. We thought it would have been fixed in 1.25.1, though it caused an issue with mobile client uploads to be broken. So if you are still using that version and have uploaded files via the mobile client. They are probably broken.
In 1.25.2 we disabled this, and prevented those file uploads from reporting a false positive successful upload.
Now, in the current
testingversion there is a patch which allows these files to be uploaded again.So, either use 1.25.2 which prevents broken uploads, or use the current
testingimage which has a fix for this.@mrclschstr commented on GitHub (Aug 7, 2022):
I'm sorry, small typo: I'm currently using the latest vaultwarden v1.25.2.
The issue itself has not changed since my bug report: During a file upload in Sends via the Android app I'm still seeing an API access to
/api/sends/file/v2which gives me a 404 error. To rule out the reverse proxy, I've executed the commandcurl -sD - -o /dev/null http://localhost/api/sends/file/v2directly in the vaultwarden container shell which also gives me a 404.I'll give the
testingbranch a shot.@BlackDex commented on GitHub (Aug 7, 2022):
Well, that is correct, and that is no issue. Vaultwarden does not support /api/sends/file/v2 (yet). And that causes the clients to switch to the v1 way which works just fine.
So that 404 is as intended. But still, uploading works fine since it will use a different way.
@mrclschstr commented on GitHub (Aug 7, 2022):
Well, that's the point: The app is not switching to the v1 API for me; does it work for you? Is that an issue of the Android app or the reverse proxy configuration? Using the web app upload works just fine!
@BlackDex commented on GitHub (Aug 7, 2022):
If you are using the
latesttagged version then currently you can't upload files via the mobile clients.Use the
testingtagged image for that.And, yes, it works fine for me. Both
Sendand CipherAttachments@mrclschstr commented on GitHub (Oct 17, 2022):
Works perfectly with 1.26.0., thank you!