连接到Azure Postgres的“从流中读取时发生异常”错误

时间:2019-08-02 22:59:20

标签: .net azure azure-postgresql

我有一个运行在连接到Azure Postgres服务器的Azure Windows VM中的.Net应用程序。

从今天上午10:53开始,我开始遇到Exception while reading from stream, Attempted to read past the end of the stream错误。起初它是断断续续的,然后变得更加频繁,现在却一直失败。我的服务死在水里。

在生产服务器上,这总是在首次尝试open()连接时发生。在我的开发计算机上,以调试模式运行代码时,它发生在代码中的随机位置。 conn.open()adapter.fill()。它将成功连接一次运行,然后在“ fill()”处失败,但是另一次运行可能根本无法open()连接。

Google搜索似乎表明这主要是超时问题。但是,失败立即发生,没有超时的机会,我尝试将Timeout和CommandTimeout值添加到我的连接字符串中没有任何作用。

另一个提示:当我从pgAdmin III或PgAdmin IV连接到服务器时,间歇性地收到“ SSL SYSCALL错误:检测到EOF”

由于提到了SSL,因此我也尝试将Use SSL Stream=true添加到我的连接字符串中。没有运气。

我还重新启动了数据库(两次)。 (如有疑问,请重新启动)

因此,我假设这是数据库的问题,或者是Microsoft今天早上在此处进行的配置更改导致了这些问题。但是我不知道如何检测或确定这一点。

在有更多线索的情况下,这是InnerException:

{"Attempted to read past the end of the stream."}
    Data: {System.Collections.ListDictionaryInternal}
    HResult: -2147024858
    HelpLink: Nothing
    InnerException: Nothing
    Message: "Attempted to read past the end of the stream."
    Source: "Npgsql"
    StackTrace: "   at Npgsql.ReadBuffer.Ensure(Int32 count, Boolean dontBreakOnTimeouts)"
    TargetSite: {Void Ensure(Int32, Boolean)}

0 个答案:

没有答案