Skip to content

Can't delete items from Collection/Organization #5808

@thesnallygaster

Description

@thesnallygaster

Steps To Reproduce

  1. Go to 'an item belonging to Orgnization/Collection'
  2. Click on 'Delete'

Expected Result

Item gets moved to Trash

Actual Result

Nothing happens

Screenshots or Videos

No response

Additional Context

Snippet below appears in web console

[HTTP/2 500  279ms]
Object { response: {…}, message: "An unhandled server error has occurred.", validationErrors: null, captchaSiteKey: undefined, captchaRequired: false, statusCode: 500 }
main.cce87d4a5909f265782e.js:1056:340055

This appears in api.log

2025-05-12 11:05:49.236 +02:00 [ERR] Nullable object must have a value.
System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1.get_Value()
   at Bit.Infrastructure.EntityFramework.Vault.Repositories.CipherRepository.ReplaceAsync(CipherDetails cipher) in /home/runner/work/server/server/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs:line 573
   at Bit.Infrastructure.EntityFramework.Vault.Repositories.CipherRepository.UpsertAsync(CipherDetails cipher) in /home/runner/work/server/server/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs:line 966
   at Bit.Core.Vault.Services.CipherService.SoftDeleteAsync(CipherDetails cipherDetails, Guid deletingUserId, Boolean orgAdmin) in /home/runner/work/server/server/src/Core/Vault/Services/Implementations/CipherService.cs:line 725
   at Bit.Api.Vault.Controllers.CiphersController.PutDelete(Guid id) in /home/runner/work/server/server/src/Api/Vault/Controllers/CiphersController.cs:line 896
   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)

I suspect this is related to recently merged #5543 because moving items to Organizations/Collections started working but deleting them broke

Build Version

2025.4.3

Environment

Self-Hosted

Environment Details

Docker, using postgresql

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