Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.97 KB | None | 0 0
  1. fail: Microsoft.EntityFrameworkCore.Update[10000]
  2.       An exception occurred in the database while saving changes for context type 'IdentityService.DAL.ApplicationDbContext'.
  3.       Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
  4.        ---> Npgsql.PostgresException (0x80004005): 23503: insert or update on table "AspNetUserClaims" violates foreign key constraint "FK_AspNetUserClaims_AspNetUsers_UserId"
  5.          at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
  6.       --- End of stack trace from previous location where exception was thrown ---
  7.          at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
  8.       --- End of stack trace from previous location where exception was thrown ---
  9.          at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
  10.          at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
  11.          at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
  12.          at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  13.          at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  14.          at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  15.          at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  16.         Exception data:
  17.           Severity: ERROR
  18.           SqlState: 23503
  19.           MessageText: insert or update on table "AspNetUserClaims" violates foreign key constraint "FK_AspNetUserClaims_AspNetUsers_UserId"
  20.           Detail: Key (UserId)=(2f47fc5d-055a-44fd-9196-345732b8d2f1) is not present in table "AspNetUsers".
  21.           SchemaName: public
  22.           TableName: AspNetUserClaims
  23.           ConstraintName: FK_AspNetUserClaims_AspNetUsers_UserId
  24.           File: ri_triggers.c
  25.           Line: 2474
  26.           Routine: ri_ReportViolation
  27.          --- End of inner exception stack trace ---
  28.          at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  29.          at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
  30.          at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
  31.          at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
  32.          at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(DbContext _, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
  33.          at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
  34.          at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
  35. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
  36.  ---> Npgsql.PostgresException (0x80004005): 23503: insert or update on table "AspNetUserClaims" violates foreign key constraint "FK_AspNetUserClaims_AspNetUsers_UserId"
  37.    at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
  38. --- End of stack trace from previous location where exception was thrown ---
  39.    at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
  40. --- End of stack trace from previous location where exception was thrown ---
  41.    at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
  42.    at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
  43.    at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
  44.    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  45.    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  46.    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  47.    at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  48.   Exception data:
  49.     Severity: ERROR
  50.     SqlState: 23503
  51.     MessageText: insert or update on table "AspNetUserClaims" violates foreign key constraint "FK_AspNetUserClaims_AspNetUsers_UserId"
  52.     Detail: Key (UserId)=(2f47fc5d-055a-44fd-9196-345732b8d2f1) is not present in table "AspNetUsers".
  53.     SchemaName: public
  54.     TableName: AspNetUserClaims
  55.     ConstraintName: FK_AspNetUserClaims_AspNetUsers_UserId
  56.     File: ri_triggers.c
  57.     Line: 2474
  58.     Routine: ri_ReportViolation
  59.    --- End of inner exception stack trace ---
  60.    at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  61.    at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
  62.    at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
  63.    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
  64.    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(DbContext _, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
  65.    at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
  66.    at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement