Skip to content
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) #1886

Open
wjkhappy14 opened this issue Sep 15, 2024 · 1 comment
Open

Npgsql.NpgsqlException (0x80004005) #1886

wjkhappy14 opened this issue Sep 15, 2024 · 1 comment

Comments

@wjkhappy14
Copy link

在大约1个小时内,没有获取的Http请求调用(访问数据库),然后再次请求,就会出现这个错误提示,再之后,就不会出现这个提示了

System.Exception: Exception while reading from stream ---> Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream. at Npgsql.NpgsqlReadBuffer.g__EnsureLong|40_0(NpgsqlReadBuffer buffer, Int32 count, Boolean async, Boolean readingNotifications) at Npgsql.NpgsqlConnector.g__ReadMessageLong|201_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior) at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReaderMultiple(Int32 multipleResult, DbConnection connection, DbTransaction transaction, Action2 fetchHandler, Action2 schemaHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms) --- End of inner exception stack trace --- at FreeSql.Internal.CommonProvider.AdoProvider.LoggerException(IObjectPool1 pool, PrepareCommandResult pc, Exception ex, DateTime dt, StringBuilder logtxt, Boolean isThrowException) at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReaderMultiple(Int32 multipleResult, DbConnection connection, DbTransaction transaction, Action2 fetchHandler, Action2 schemaHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms) at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReader(DbConnection connection, DbTransaction transaction, Action1 fetchHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms) at FreeSql.Internal.CommonProvider.Select0Provider2.ToListAfPrivate(String sql, GetAllFieldExpressionTreeInfo af, ReadAnonymousTypeOtherInfo[] otherData) at FreeSql.Internal.CommonProvider.Select0Provider2.ToListPrivate(GetAllFieldExpressionTreeInfo af, ReadAnonymousTypeOtherInfo[] otherData) at FreeSql.Internal.CommonProvider.Select0Provider2.ToList(Boolean includeNestedMembers) at FreeSql.Internal.CommonProvider.Select1Provider1.ToList(Boolean includeNestedMembers) at FreeSql.Internal.CommonProvider.Select0Provider2.ToList() at FreeSql.Internal.CommonProvider.Select0Provider2.ToOne() at FreeSql.Internal.CommonProvider.Select0Provider`2.First()

// c# code

数据库版本

PostgreSQL 15.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

安装的Nuget包

FreeSql Version=3.2.810
FreeSql.Provider.PostgreSQL Version=3.2.810

.net framework/. net core? 及具体版本

.NET 6.0

部署环境
K8S(kubesphere)

@2881099
Copy link
Collaborator

2881099 commented Sep 15, 2024

npgsql 连接字符串

connection lifetime 有类似的连接串参数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants