You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Npgsql.NpgsqlException (0x80004005): Received backend message RowDescription while expecting ParseCompleteMessage. Please file a bug. #2201
Oct 23 00:02:41 kpwkafka iothub[52602]: Npgsql.NpgsqlException (0x80004005): Received backend message RowDescription while expecting ParseCompleteMessage. Please file a bug.
Oct 23 00:02:41 kpwkafka iothub[52602]: at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Npgsql.NpgsqlDataReader.NextResult()
Oct 23 00:02:41 kpwkafka iothub[52602]: at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider._TrackEntities[TOut,TIn](IEnumerable`1 results, QueryContext queryContext, IList`1 entityTrackingInfos, IList`1 entityAccessors)+MoveNext()
Oct 23 00:02:41 kpwkafka iothub[52602]: at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
Oct 23 00:02:41 kpwkafka iothub[52602]: at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
Oct 23 00:02:41 kpwkafka iothub[52602]: at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Sorry for taking so long with this. Does this bug happen in a regular way, or randomly? I'm very interested in working on it, but I'll need some sort of code sample that reproduces it. Is it possible to put together a small console app for this?
Hello, I also ran into this a few times while using a listener. I finally traced it back to a race condition with the cancellation token. Seems if a cancelled token gets sent to WaitAsync(), then the next command fails with this error. Here's some sample code (TableA is a non-existent). I tested with 4.0.7:
using (NpgsqlConnection connection = new NpgsqlConnection(connectionString))
{
connection.Open();
using (NpgsqlCommand command = new NpgsqlCommand("LISTEN TableA", connection))
{
command.ExecuteNonQuery();
}
using (CancellationTokenSource tokenSource = new CancellationTokenSource())
{
try
{
tokenSource.Cancel();
connection.WaitAsync(tokenSource.Token).Wait();
}
catch (AggregateException ex) when (ex.InnerExceptions.Any(x => (x is TaskCanceledException)))
{
}
}
using (NpgsqlCommand command = new NpgsqlCommand("SELECT NULL", connection))
{
command.ExecuteNonQuery();
}
}
This happened to me when I put a breakpoint between two new async connections a select, second an insert. It's only thrown when the to-be-inserted List was empty, and that the breakpoint is after the first connection and before the second. Tested with 5.0.7.
@bali-ibrahim if you can reproduce the bug for 5.0.5 and not for 5.0.7, then we've probably fixed it - it's recommended to always run on the latest patch level of Npgsql. If you can reproduce a bug with the latest patch level, a new issue with a minimal example would be great.
Activity
maikebing commentedon Oct 23, 2018
It seems that the new version of PG will not have this problem, perhaps the version difference?
roji commentedon Nov 19, 2018
Sorry for taking so long with this. Does this bug happen in a regular way, or randomly? I'm very interested in working on it, but I'll need some sort of code sample that reproduces it. Is it possible to put together a small console app for this?
maikebing commentedon Nov 19, 2018
Appears to be caused by multithreaded execution of SQL statements with the same connection. That seems to be the case.
maikebing commentedon Nov 19, 2018
It's been a long time, and I don't remember it very well.
roji commentedon Nov 19, 2018
OK, thanks for getting back to me - multithreaded execution on the same connection would definitely produce this kind of error.
I'll close this for now, but if this happens again post back and we'll revisit.
worldleaderpretend commentedon Jun 25, 2019
Hello, I also ran into this a few times while using a listener. I finally traced it back to a race condition with the cancellation token. Seems if a cancelled token gets sent to WaitAsync(), then the next command fails with this error. Here's some sample code (TableA is a non-existent). I tested with 4.0.7:
worldleaderpretend commentedon Jun 26, 2019
Opened a new issue: #2506
n-ae commentedon Jun 16, 2021
This happened to me when I put a breakpoint between two new async connections a
select, second aninsert. It's only thrown when the to-be-insertedListwas empty, and that the breakpoint is after the first connection and before the second. Tested with5.0.7.roji commentedon Jun 16, 2021
@bali-ibrahim please open a new issue with a runnable code sample, so that we can investigate.
n-ae commentedon Jun 20, 2021
@roji I am sorry to have misinformed you, I couldn't reproduce it for
5.0.7however, I could for5.0.5with the abovementioned scenario.I can try to come up with a minimal reproducible example if it would still be helpful.
roji commentedon Jun 20, 2021
@bali-ibrahim if you can reproduce the bug for 5.0.5 and not for 5.0.7, then we've probably fixed it - it's recommended to always run on the latest patch level of Npgsql. If you can reproduce a bug with the latest patch level, a new issue with a minimal example would be great.