Attachment upload fails with 400 Error #1423

Closed
opened 2026-04-06 01:53:06 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @seifane on 9/29/2023

Subject of the issue

Upload of attachements is failing with a 400 error.

Deployment environment

  • vaultwarden version: 1.29.2

  • Install method: Docker image on Kubernetes

  • Clients used: desktop linux CLI 2023.9.0-1

  • Reverse proxy and version: ingress nginx v1.7.0

  • MySQL/MariaDB or PostgreSQL version: N/A

  • Other relevant details: Host is Ubuntu 22LTS, kernel 5.15

Steps to reproduce

Run bw create attachment --file config.json --itemid 85be4aea-[...]

Expected behaviour

Upload succeeds.

Actual behaviour

Upload fails with 400 response.

Troubleshooting data

HTTP response from the server

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>400 Bad Request</title>
</head>
<body align="center">
    <div role="main" align="center">
        <h1>400: Bad Request</h1>
        <p>The request could not be understood by the server due to malformed syntax.</p>
        <hr />
    </div>
    <div role="contentinfo" align="center">
        <small>Rocket</small>
    </div>
</body>
</html>

Logs from the container

[2023-09-29 11:24:11.004][request][INFO] POST /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/v2                                            
[2023-09-29 11:24:11.010][response][INFO] (post_attachment_v2) POST /api/ciphers/<uuid>/attachment/v2 => 200 OK                                          
[2023-09-29 11:24:11.660][request][INFO] POST /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/6fd958c334b6165e60ac 
[2023-09-29 11:24:11.661][vaultwarden::api::core::ciphers::_][WARN] Data guard `Form < UploadData < '_ > >` failed: Errors([Error { name: Some("data"),  value: None, kind: Io(Custom { kind: Other, error: field "data" received with incomplete data }), entity: Form }]).       
[2023-09-29 11:24:11.661][response][INFO] (post_attachment_v2_data) POST /api/ciphers/<uuid>/attachment/<attachment_id> multipart/form-data => 400 Bad Request                                                                                                                                                   
[2023-09-29 11:24:12.262][request][INFO] DELETE /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/6fd958c334b6165e60ac              
[2023-09-29 11:24:12.263][response][INFO] (delete_attachment) DELETE /api/ciphers/<uuid>/attachment/<attachment_id> => 200 OK 

Let me know if you need any more details / logs.
I checked the attachment folder and it the user / group as the one vaultwarden process is running. The container should have access to it.

*Originally created by @seifane on 9/29/2023* ### Subject of the issue Upload of attachements is failing with a 400 error. ### Deployment environment * vaultwarden version: 1.29.2 * Install method: Docker image on Kubernetes * Clients used: desktop linux CLI 2023.9.0-1 * Reverse proxy and version: ingress nginx v1.7.0 * MySQL/MariaDB or PostgreSQL version: N/A * Other relevant details: Host is Ubuntu 22LTS, kernel 5.15 ### Steps to reproduce Run `bw create attachment --file config.json --itemid 85be4aea-[...]` ### Expected behaviour Upload succeeds. ### Actual behaviour Upload fails with 400 response. ### Troubleshooting data HTTP response from the server ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>400 Bad Request</title> </head> <body align="center"> <div role="main" align="center"> <h1>400: Bad Request</h1> <p>The request could not be understood by the server due to malformed syntax.</p> <hr /> </div> <div role="contentinfo" align="center"> <small>Rocket</small> </div> </body> </html> ``` Logs from the container ``` [2023-09-29 11:24:11.004][request][INFO] POST /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/v2 [2023-09-29 11:24:11.010][response][INFO] (post_attachment_v2) POST /api/ciphers/<uuid>/attachment/v2 => 200 OK [2023-09-29 11:24:11.660][request][INFO] POST /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/6fd958c334b6165e60ac [2023-09-29 11:24:11.661][vaultwarden::api::core::ciphers::_][WARN] Data guard `Form < UploadData < '_ > >` failed: Errors([Error { name: Some("data"), value: None, kind: Io(Custom { kind: Other, error: field "data" received with incomplete data }), entity: Form }]). [2023-09-29 11:24:11.661][response][INFO] (post_attachment_v2_data) POST /api/ciphers/<uuid>/attachment/<attachment_id> multipart/form-data => 400 Bad Request [2023-09-29 11:24:12.262][request][INFO] DELETE /api/ciphers/85be4aea-2c00-4336-84a1-da8b576b7e84/attachment/6fd958c334b6165e60ac [2023-09-29 11:24:12.263][response][INFO] (delete_attachment) DELETE /api/ciphers/<uuid>/attachment/<attachment_id> => 200 OK ``` Let me know if you need any more details / logs. I checked the attachment folder and it the user / group as the one vaultwarden process is running. The container should have access to it.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1423