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

Npgsql.NpgsqlException (0x80004005): Unknown message code: 0 #2281

Open
tanngocIT opened this Issue Jan 4, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@tanngocIT
Copy link

tanngocIT commented Jan 4, 2019

The issue

View log in my linux server, i see some error.

An unhandled exception has occurred while executing the request.
Npgsql.NpgsqlException (0x80004005): Unknown message code: 0
   at Npgsql.PGUtil.ValidateBackendMessageCode(BackendMessageCode code)
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
Npgsql.NpgsqlException (0x80004005): Received backend message RowDescription while expecting ParseCompleteMessage. Please file a bug.
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)

It will be stop my api after few minutes

Further technical details

Npgsql version: 2.1.1.1
PostgreSQL version:10.6
Operating system: Linux

Other details about my project setup:

@roji

This comment has been minimized.

Copy link
Member

roji commented Jan 4, 2019

This probably indicates that your application has concurrency issues - you may be trying to using the same NpgsqlConnection object from two different threads at the same time. Carefully review your connection management strategy to make sure it is only ever accessed by one thread at a time.

Otherwise, this could be a bug in Npgsql, but we'd need to see a code sample that reproduces the error to do anything about it.

Try to work on a minimal code sample which reproduces the error. If the error doesn't occur deterministically (e.g. because of a race condition), you can try running your code in a tight loop until it does trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment