Skip to content

Attachments uploading not working v2025.11.1 #6660

@Semmy-17

Description

@Semmy-17

Steps To Reproduce

  1. Open an existing login
  2. Edit the login and click 'Attachments'
  3. Select a file and upload it

Expected Result

I expect that the attachment is correctly uploaded

Actual Result

The first attempt will display an error 'An unhandled server error has occurred'. The request is a POST to the endpoint: /api/ciphers/{id}/attachment/{attachmentId} and the response is:

{
    "message": "An unhandled server error has occurred.",
    "validationErrors": null,
    "exceptionMessage": null,
    "exceptionStackTrace": null,
    "innerExceptionMessage": null,
    "object": "error"
}

The second try will display an error 'The cipher you are updating is out of date. Please save your work, sync your vault, and try again.'. The request is a POST to the endpoint:
api/ciphers/{id}/attachment/v2 and the response is:

{
    "message": "The cipher you are updating is out of date. Please save your work, sync your vault, and try again.",
    "validationErrors": null,
    "exceptionMessage": null,
    "exceptionStackTrace": null,
    "innerExceptionMessage": null,
    "object": "error"
}

If I see the docker logs of bitwarden-api container i'll see:

fail: Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
      => SpanId:ec0b30615effca6e, TraceId:7aaac3c96093994bc83a13f2a9a7bbd7, ParentId:0000000000000000 => ConnectionId:0HNHGPH23445N => RequestPath:/ciphers/580517a7-d231-4032-ae21-b36f0081f460/attachment/ppvqj7cjtfeuj1e2dzqsyfnvbguhchlm RequestId:0HNHGPH23445N:00000001 => IpAddress*redacted ip* UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 DeviceType:9 Origin:9 ClientVersion:2025.11.1 => Bit.Api.Vault.Controllers.CiphersController.PostFileForExistingAttachment (Api)
      Unhandled exception
      System.IO.IOException: Unexpected end of Stream, the content may have already been read by another component.
         at Microsoft.AspNetCore.WebUtilities.MultipartReaderStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.DrainAsync(Stream stream, ArrayPool`1 bytePool, Nullable`1 limit, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.WebUtilities.MultipartReader.ReadNextSectionAsync(CancellationToken cancellationToken)
         at Bit.Api.Utilities.MultipartFormDataHelper.GetFileAsync(HttpRequest request, Func`2 callback) in /source/src/Api/Utilities/MultipartFormDataHelper.cs:line 109
         at Bit.Api.Vault.Controllers.CiphersController.PostFileForExistingAttachment(Guid id, String attachmentId) in /source/src/Api/Vault/Controllers/CiphersController.cs:line 1425
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Screenshots or Videos

No response

Additional Context

No response

Build Version

2025.11.1+28469e0

Environment

Self-Hosted

Environment Details

  • Operating system: Debian
  • Environment: Docker

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions