Received backend message ReadyForQuery while expecting ParseCompleteMessage.
See original GitHub issueSteps to reproduce
not deterministic.
The issue
On reading and writing data, following exception is thrown:
Npgsql.NpgsqlException (0x80004005): Received backend message ReadyForQuery while expecting ParseCompleteMessage. Please file a bug.
Exception Message:
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
---> Npgsql.NpgsqlException (0x80004005): Received backend message ReadyForQuery while expecting ParseCompleteMessage. Please file a bug.
Stacktrace:
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(DbContext _, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Npgsql version: Npgsql.EntityFrameworkCore.PostgreSQL v 5.0.5.1 Postgres: AWS Aurora 9.6.16 Operating system: (Debian 10) k8s -> docker-image -> mcr.microsoft.com/dotnet/aspnet:5.0 -> buster-slim-amd64
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Received backend message ReadyForQuery while ...
Message: "Received backend message ReadyForQuery while expecting ParseCompleteMessage. Please file a bug." ErrorCode/HResult: -2147467259
Read more >AWS Aurora Npgsql.NpgsqlException (0x80004005)
NpgsqlException (0x80004005): Received backend message CopyData while expecting CommandCompleteMessage. I can create, update and delete single ...
Read more >Npgsql with EF5: Received unexpected backend message ...
I'm using CrateDB via EntityFramework 5 (5.0.13) and Npgsql 5.0.10. I want to add/update multiple entities at once. var newItems = new List<Item> ......
Read more >Exception that raised the event:Npgsql.NpgsqlException ( ...
Exception that raised the event:Npgsql.NpgsqlException (0x80004005): Received backend message ReadyForQuery while expecting ParseCompleteMessage.
Read more >Documentation: 15: 55.2. Message Flow
ReadyForQuery is issued when the entire string has been processed and the backend is ready to accept a new query string. If a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@efmk it actually did help. I took a look not so long ago and found a potential bug with keepalive (npgsql/npgsql#3765). And your logs do confirm that it’s possible that’s the reason for your specific issue (as there is a race condition between connection closing and keepalive performing).
Duplicate of https://github.com/npgsql/npgsql/issues/3765