Windows 2012 r2。 Npgsql v 3.1.8。 postgres 9.6.3、同じシステム上のクライアントとサーバ( 'localhost'を使用)。クライアントはc#dllを呼び出すシングルスレッドのPowerShellスクリプトです。サービスとしてのDB runnig。sslを使用したnpgsqlのランダムな障害
データベースの初期化中(私の製品のインストーラ)。 1つの大きなトランザクションでcreate tableなど(〜200テーブル)の大きなバッチを送信しています。クライアントは、相手側が接続を切断したことを訴える。 PGログは
ERROR: invalid string in message
FATAL: invalid frontend message type 233
又は
ERROR: invalid byte sequence for encoding "UTF8": 0x86
FATAL: invalid frontend message type 104
又は
ERROR: invalid byte sequence for encoding "UTF8": 0xe5 0x5e 0xaa
FATAL: invalid frontend message type 198
又は
ERROR: invalid byte sequence for encoding "UTF8": 0xeb 0xa6 0x02
FATAL: invalid frontend message type 162
問題は、所与の構成における100%REPROであるが、によって変更することができると言いますさまざまなもの。最も厄介なことは、サーバー上のログレベルを最大にするとバグが止まることです(いくつかのログを追加すると失敗に変わります)。ステートメントトレースでエラーが発生し、長いバッチの作成の途中でエラーが発生することがありますテーブル。しかし、どこでバッチが失敗するのかはまちまちです。動作を変更する他のものは、DBのより高速のディスクを使用してサーバ(そのVM)上のメモリを増やすことです。
クライアントは接続を有効にしてsslを有効にします。ここで
文脈でのより詳細なトレースwihtエラー
LOG: 00000: execute <unnamed>: create table locks44_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks45_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks46_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks47_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks48_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks49_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
LOG: 00000: execute <unnamed>: create table locks50_ ("_rowkey" text NOT NULL, "acquired" timestamptz, "expires" timestamptz, "ownerrole" Text, "ownertx" Text, "name" Text, "uniquevalue" Text, "_partitionkey" text NOT NULL, primary key (_partitionkey,_rowkey))
LOCATION: exec_execute_message, postgres.c:1952
ERROR: 08P01: invalid string in message
LOCATION: pq_getmsgstring, pqformat.c:637
FATAL: 08P01: invalid frontend message type 97
EDIT2です:UseSslStream =で固定既知のバグ、のようですUseSslStreamのデフォルトの選択肢(偽私は思う)
EDITを使用しています真
それに加えて、固定されているようだ - https://github.com/npgsql/npgsql/issues/1362