Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot bulk copy items to Organization #2624

Open
1 task done
Tracked by #2480
haraldinho2000 opened this issue Jan 24, 2023 · 0 comments
Open
1 task done
Tracked by #2480

Cannot bulk copy items to Organization #2624

haraldinho2000 opened this issue Jan 24, 2023 · 0 comments
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@haraldinho2000
Copy link

haraldinho2000 commented Jan 24, 2023

Steps To Reproduce

  1. Make sure you have an organization setup in your vault
  2. Go to your personal vault items
  3. Select 2 items from the vault
  4. Select from Options dropdown "Move selection to Organization"
  5. Choose e.g. your default organization and your default collection
  6. Click Save
  7. Get an "Unhandled Exception" error

Expected Result

The expected result is that the items get bulk moved to the Organization

Actual Result

You get an unhandled exception error and log entries

�[40m�[1m�[33mwarn�[39m�[22m�[49m: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {a47145b9-03d1-453e-85e5-a3ccce1cf8b0} may be persisted to storage in unencrypted form.
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:5001
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Hosting.Lifetime[0]
      Content root path: /app/Api
�[41m�[30mfail�[39m�[22m�[49m: Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
      => SpanId:5188d76cea964eeb, TraceId:dd3f75823997a04748016be757282526, ParentId:0000000000000000 => ConnectionId:0HMNUAHT9M40F => RequestPath:/ciphers/share RequestId:0HMNUAHT9M40F:00000002 => Bit.Api.Controllers.CiphersController.PutShareMany (Api)
      Duplicate entry 'd714387a-f6c1-4d99-a3c7-af940167e362' for key 'PRIMARY'
      MySqlConnector.MySqlException (0x80004005): Duplicate entry 'd714387a-f6c1-4d99-a3c7-af940167e362' for key 'PRIMARY'
         at MySqlConnector.Core.ServerSession.ReceiveReplyAsyncAwaited(ValueTask`1 task) in /_/src/MySqlConnector/Core/ServerSession.cs:line 956
         at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 44
         at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 108
         at MySqlConnector.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 456
         at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 56
         at MySqlConnector.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 282
         at LinqToDB.Data.DataConnection.ExecuteNonQueryAsync(CancellationToken cancellationToken)
         at LinqToDB.Data.DataConnection.ExecuteNonQueryDataAsync(CancellationToken cancellationToken)
         at LinqToDB.Data.DataConnection.ExecuteNonQueryDataAsync(CancellationToken cancellationToken)
         at LinqToDB.Data.CommandInfo.ExecuteAsync(CancellationToken cancellationToken)
         at LinqToDB.DataProvider.MultipleRowsHelper.ExecuteAsync(CancellationToken cancellationToken)
         at LinqToDB.DataProvider.BasicBulkCopy.MultipleRowsCopyHelperAsync(MultipleRowsHelper helper, IEnumerable source, String from, Action`1 prepFunction, Action`3 addFunction, Action`1 finishFunction, CancellationToken cancellationToken, Int32 maxParameters, Int32 maxSqlLength)
         at LinqToDB.EntityFrameworkCore.LinqToDBForEFTools.BulkCopyAsync[T](DbContext context, BulkCopyOptions options, IEnumerable`1 source, CancellationToken cancellationToken)
         at Bit.Infrastructure.EntityFramework.Repositories.CipherRepository.UpdateCiphersAsync(Guid userId, IEnumerable`1 ciphers) in /source/src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs:line 701
         at Bit.Core.Services.CipherService.ShareManyAsync(IEnumerable`1 cipherInfos, Guid organizationId, IEnumerable`1 collectionIds, Guid sharingUserId) in /source/src/Core/Services/Implementations/CipherService.cs:line 571
         at Bit.Api.Controllers.CiphersController.PutShareMany(CipherBulkShareRequestModel model) in /source/src/Api/Controllers/CiphersController.cs:line 547
         at lambda_method1533(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(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

Githash Version

3997def-dirty

Environment Details

No response

Database Image

No response

Issue-Link

#2480

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.
@haraldinho2000 haraldinho2000 added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment
Projects
None yet
Development

No branches or pull requests

1 participant