mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Unable to create attachments via the Bitwarden CLI #1647
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 @ambrozticar on GitHub (Jul 21, 2023).
Subject of the issue
Unable to create attachments via the Bitwarden CLI
Deployment environment
Install method: docker
Clients used: BitWarden CLI 2023.7.0
Reverse proxy and version: /
MySQL/MariaDB or PostgreSQL version: /
Other relevant details: tried multiple CLI install methods on both Windows and Ubuntu
Steps to reproduce
bw create attachment --file test.txt --itemid [ITEMID] --session '[SESSIONID]'
Expected behaviour
An attachment should be created on the specified item
Actual behaviour
The following error is returned by the CLI:
400: Bad Request
The request could not be understood by the server due to malformed syntax.
Troubleshooting data
Output from docker logs (trace level):
[2023-07-21 20:17:02.288][request][INFO] POST /api/ciphers/5a578fe6-e212-4d52-aa02-2b16a1d6f1ce/attachment/v2
[2023-07-21 20:17:02.346][response][INFO] (post_attachment_v2) POST /api/ciphers//attachment/v2 => 200 OK
[2023-07-21 20:17:02.346][tracing::span][TRACE] encode_headers;
[2023-07-21 20:17:02.346][tracing::span::active][TRACE] -> encode_headers;
[2023-07-21 20:17:02.346][tracing::span::active][TRACE] <- encode_headers;
[2023-07-21 20:17:02.346][tracing::span][TRACE] -- encode_headers;
[2023-07-21 20:17:02.438][tracing::span][TRACE] parse_headers;
[2023-07-21 20:17:02.438][tracing::span::active][TRACE] -> parse_headers;
[2023-07-21 20:17:02.438][tracing::span::active][TRACE] <- parse_headers;
[2023-07-21 20:17:02.438][tracing::span][TRACE] -- parse_headers;
[2023-07-21 20:17:02.478][tracing::span][TRACE] parse_headers;
[2023-07-21 20:17:02.478][tracing::span::active][TRACE] -> parse_headers;
[2023-07-21 20:17:02.478][tracing::span::active][TRACE] <- parse_headers;
[2023-07-21 20:17:02.478][tracing::span][TRACE] -- parse_headers;
[2023-07-21 20:17:02.478][tracing::span][TRACE] parse_headers;
[2023-07-21 20:17:02.478][tracing::span::active][TRACE] -> parse_headers;
[2023-07-21 20:17:02.478][tracing::span::active][TRACE] <- parse_headers;
[2023-07-21 20:17:02.478][tracing::span][TRACE] -- parse_headers;
[2023-07-21 20:17:02.478][request][INFO] POST /api/ciphers/5a578fe6-e212-4d52-aa02-2b16a1d6f1ce/attachment/474f2023242c83b77194
[2023-07-21 20:17:02.479][rocket::form::parser::][TRACE] multipart field: Field { state: Mutex { data: MultipartState { buffer: StreamBuffer, boundary: "--------------------------008683523461881203688262", stage: ReadingFieldData, next_field_idx: 1, curr_field_name: Some("data"), curr_field_size_limit: 18446744073709551615, curr_field_size_counter: 0, constraints: Constraints { size_limit: SizeLimit { whole_stream: 18446744073709551615, per_field: 18446744073709551615, field_map: {} }, allowed_fields: None } }}, done: false, headers: {"content-disposition": "form-data; name="data"; filename="2.06l17qYisTYV9HU8allwTw==|Uq+dR9R7aS7LcovQcSx5hw==|n02O8g0frqYUvynjw77xlnkLQpmL45DsQHWRiJbUku8="", "content-type": "application/octet-stream"}, content_disposition: ContentDisposition { field_name: Some("data"), file_name: Some("2.06l17qYisTYV9HU8allwTw==|Uq+dR9R7aS7LcovQcSx5hw==|n02O8g0frqYUvynjw77xlnkLQpmL45DsQHWRiJbUku8=") }, content_type: Some("application/octet-stream"), idx: 0 }
[2023-07-21 20:17:02.479][multer::buffer][TRACE] finding next field: Some("data")
[2023-07-21 20:17:02.479][multer::buffer][TRACE] no new field found: EOF. terminating
[2023-07-21 20:17:02.479][multer::buffer][TRACE] finding next field: Some("data")
[2023-07-21 20:17:02.479][multer::buffer][TRACE] no new field found: EOF. terminating
[2023-07-21 20:17:02.479][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-07-21 20:17:02.479][rocket::server::_][WARN] No 400 catcher registered. Using Rocket default.
[2023-07-21 20:17:02.479][response][INFO] (post_attachment_v2_data) POST /api/ciphers//attachment/<attachment_id> multipart/form-data => 400 Bad Request
Wireshark packet capture:
create_attachment.zip
@ambrozticar commented on GitHub (Jul 21, 2023):
The attachment upload works with BitWarden CLI version 2023.4.0
@BlackDex commented on GitHub (Jul 22, 2023):
Bitwarden updated to Node v18 which introduced this issue.
I reported it to Bitwarden https://github.com/bitwarden/clients/issues/5876