Skip to content

allLifeCycleData and other domains fail at TestLabDB #106

Description

@christoph-maurer

When I query the TestLabDB in development for allOpticalData, allCalorimetricData, allGeometricData, allHygrothermalData, allLifeCycleDataandallPhotovoltaicData`, I get exception errors like

backend-1        | [15:07:43 ERR] Resolver error. Field: 'allLifeCycleData'. Document: {
backend-1        |   allOpticalData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        |   allCalorimetricData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        |   allGeometricData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        |   allHygrothermalData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        |   allLifeCycleData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        |   allPhotovoltaicData {
backend-1        |     edges {
backend-1        |       node {
backend-1        |         componentId
backend-1        |         uuid
backend-1        |       }
backend-1        |     }
backend-1        |   }
backend-1        | }
backend-1        | Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
backend-1        |    at Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken)
backend-1        |    at Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.Consume(RelationalDataReader reader, Boolean async, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChangesAsync(IList`1 entries, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
backend-1        |    at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
backend-1        |    at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
backend-1        |    at Database.Services.AccessPolicyService.IncrementAccessCounts[TData](IReadOnlyList`1 allData, String openIdConnectClientId, Nullable`1 userId, Guid[] institutionIds, ApplicationDbContext databaseContext, CancellationToken cancellationToken) in /home/me/app/src/Services/AccessPolicyService.cs:line 155
backend-1        |    at Database.Services.AccessPolicyService.Apply[TData,TResult](IQueryable`1 data, Func`2 then, ApplicationDbContext databaseContext, CancellationToken cancellationToken) in /home/me/app/src/Services/AccessPolicyService.cs:line 54
backend-1        |    at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task)
backend-1        |    at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<<CreateResolverMiddleware>b__0>d.MoveNext()
backend-1        | --- End of stack trace from previous location ---
backend-1        |    at HotChocolate.Types.UnwrapFieldMiddlewareHelper.<>c__DisplayClass0_1.<<CreateDataMiddleware>b__1>d.MoveNext()
backend-1        | --- End of stack trace from previous location ---
backend-1        |    at HotChocolate.Types.UnwrapFieldMiddlewareHelper.<>c__DisplayClass0_1.<<CreateDataMiddleware>b__1>d.MoveNext()
backend-1        | --- End of stack trace from previous location ---
backend-1        |    at HotChocolate.Types.Pagination.PagingMiddleware.InvokeAsync(IMiddlewareContext context)
backend-1        |    at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)
backend-1        |    at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)
backend-1        | [15:07:43 INF] Executed DbCommand (6ms) [Parameters=[@p1='019ee58f-7418-7dde-bcb9-dfaca6ca0656', @p2='985' (DbType = Object), @p0='2' (Nullable = true)], CommandType='Text', CommandTimeout='30']
backend-1        | UPDATE database.user_access_policy SET "AccessCountSinceStartTime_AccessCount" = @p0
backend-1        | WHERE "Id" = @p1 AND xmin = @p2
backend-1        | RETURNING xmin;
backend-1        | [15:07:43 DBG] Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
backend-1        | [15:07:43 DBG] Closing data reader to 'xbase' on server 'tcp://database:5432'.
backend-1        | [15:07:43 DBG] A data reader for 'xbase' on server 'tcp://database:5432' is being disposed after spending 0ms reading results.
backend-1        | [15:07:43 DBG] Closing connection to database 'xbase' on server 'tcp://database:5432'.
backend-1        | [15:07:43 DBG] Closed connection to database 'xbase' on server 'tcp://database:5432' (0ms).
backend-1        | [15:07:43 ERR] Resolver error. Field: 'allHygrothermalData'. Document: {

for several domains. The graphql response is

  "errors": [
    {
      "message": "Unexpected Execution Error",
      "path": [
        "allGeometricData"
      ],
      "extensions": {
        "exception": {
          "message": "The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.",
          "stackTrace": "   at Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken)\n   at Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.Consume(RelationalDataReader reader, Boolean async, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChangesAsync(IList`1 entries, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\n   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n   at Database.Services.AccessPolicyService.IncrementAccessCounts[TData](IReadOnlyList`1 allData, String openIdConnectClientId, Nullable`1 userId, Guid[] institutionIds, ApplicationDbContext databaseContext, CancellationToken cancellationToken) in /home/me/app/src/Services/AccessPolicyService.cs:line 155\n   at Database.Services.AccessPolicyService.Apply[TData,TResult](IQueryable`1 data, Func`2 then, ApplicationDbContext databaseContext, CancellationToken cancellationToken) in /home/me/app/src/Services/AccessPolicyService.cs:line 54\n   at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task)\n   at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<<CreateResolverMiddleware>b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n   at HotChocolate.Types.UnwrapFieldMiddlewareHelper.<>c__DisplayClass0_1.<<CreateDataMiddleware>b__1>d.MoveNext()\n--- End of stack trace from previous location ---\n   at HotChocolate.Types.UnwrapFieldMiddlewareHelper.<>c__DisplayClass0_1.<<CreateDataMiddleware>b__1>d.MoveNext()\n--- End of stack trace from previous location ---\n   at HotChocolate.Types.Pagination.PagingMiddleware.InvokeAsync(IMiddlewareContext context)\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)"
        }

@simonwacker What can we do?

Metadata

Metadata

Labels

2601ISEFraunhofer Institute for Solar Energy Systems ISE

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions