question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Received backend message ReadyForQuery while expecting ParseCompleteMessage.

See original GitHub issue

Steps 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:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vonzshikcommented, May 21, 2021

@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).

0reactions
rojicommented, Jul 26, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found