5.0.0: Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
See original GitHub issueHello, after upgrading to 5.0.0 version, this is the error i get for long queries. Long queries get timeout. Happens only on 5.0.0. The same queries / codebase works fine with V3.1.2 or when connected with any local sql client to the same database.
The following is the exception
System.InvalidOperationException
An exception has been raised that is likely due to a transient failure.
System.InvalidOperationException: An exception has been raised that is likely due to a transient failure.
---> Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
---> System.TimeoutException: Timeout during reading attempt
at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
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.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Npgsql Exception while reading from stream, Postgres
All I am doing is SELECTs. Here is the stack trace: Exception while reading from stream at Npgsql.ReadBuffer.Ensure(Int32 count, Boolean ...
Read more >Exception while reading from stream · Issue #4532
Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ---> System.TimeoutException: Timeout during reading attempt
Read more >Solved: Postgresql: Exception while reading from stream
This error may happen when connection string is lacking port number. Try using server:port in connection string to Postgres database. Message 7 of...
Read more >Developers - 5.0.4: Npgsql.NpgsqlException (0x80004005)
5.0.4: Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ... Hello,. we are experiencing the same exception described in ...
Read more >PostgreSQL connections fail with block message
Error on IMSI WCF Pipeline: Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ---> System.IO.IOException: Unable to read data from ...
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
@roji Setting a
Command Timeout=0
still does not fix the issue. I will try to compile a runnable sample hopefully. if there is something else you would like me to try, that would be helpful.@etiennecl’s problem was moved to the new issue, but it’s hard to say what was here. Let’s wait a week for @asadcr and close the issue in case of no response. Otherwise, we can close it right now and reopen later.