Domanda

Ho Postgres 9.2 e PGBouncer (la versione fornita con il "Stack Builder"). Ho un'applicazione .NET che si collega tramite NPGSQL versione 2.0.12 su una macchina Win7.

La mia applicazione può connettersi felicemente direttamente al server Postgres, ma non riesce sempre a connettersi tramite PGBouncer.

La mia stringa di connessione a NPGSQL (dopo una certa sostituzione è)

Sslmode=Prefer;Timeout=40;Server={0};Port={3};User Id={4};Password={1};Database={2};Pooling=False;

(Ho anche provato a connettermi a PGBounce con protocollo = 3 esplicitamente e questo non ha funzionato.)

La riga del database da pgBounce Ini è:

[databases]
something = host=localhost port=5433 dbname=somethingelse user=someone password=aaa

e in UserList.txt ho "qualcuno" "AAA" come richiesto.

Quando la mia app esegue l'NPGSQL dice "Connessione con forza" e il registro degli errori di PGBouncer dice:

2013-02-06 20:16:57.594 2444 LOG File descriptor limit: -1 (H:-1), max_client_conn: 1000, max fds possible: 1030
2013-02-06 20:16:57.649 2444 LOG listening on ::/6433
2013-02-06 20:16:57.657 2444 LOG listening on 0.0.0.0:6433
2013-02-06 20:16:57.659 2444 LOG process up: pgbouncer 1.5.2, libevent 2.0.19-stable (win32), adns: evdns2
2013-02-06 20:17:22.066 2444 LOG C-01819410: something/someone@fe80::997b:396e:eacc:dd2b:3013 login attempt: db=somethingelse user=someone
2013-02-06 20:17:22.130 2444 LOG S-01836648: something/someone@127.0.0.1:5433 new connection to server
2013-02-06 20:17:24.069 2444 LOG C-01819410: something/someone@fe80::997b:396e:eacc:dd2b:3013 closing because: client close request (age=2)
2013-02-06 20:17:26.319 2444 LOG C-01819410: (nodb)/(nouser)@fe80::997b:396e:eacc:dd2b:3023 closing because: bad packet header (age=0)
2013-02-06 20:17:26.322 2444 WARNING C-01819410: (nodb)/(nouser)@fe80::997b:396e:eacc:dd2b:3023 Pooler Error: bad packet header

L'eccezione NPGSQL dice: (Da un file di registro nell'app, l'eccezione più alta segue le eccezioni nidificate):

Exception message:  Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
Exception source:  Npgsql
Exception stacktrace:     at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context) in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlClosedState.cs:line 232
at Npgsql.NpgsqlConnector.Open() in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlConnector.cs:line 695
at Npgsql.NpgsqlConnectorPool.GetNonPooledConnector(NpgsqlConnection Connection) in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlConnectorPool.cs:line 346
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection) in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlConnectorPool.cs:line 185
at Npgsql.NpgsqlConnection.Open() in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlConnection.cs:line 543
at *snip* the thing in my code that goes and opens the connection *snip*
-----------------------------------------------------
Exception message:  Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
Exception source:  System
Exception stacktrace:     at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.Stream.ReadByte()
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context) in Z:\Projectdirectory\Npgsql2.0.12.0.src\src\Npgsql\NpgsqlClosedState.cs:line 184
-----------------------------------------------------
Exception message:  An established connection was aborted by the software in your host machine
Exception source:  System
Exception stacktrace:     at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

Inoltre, Window Firewall è spento e anti -virus ho spento temporaneamente.

Il file Conf HBA per Postgres ha:

host    all             all             127.0.0.1/32            md5
host    all             all           192.168.0.1/16            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
host    all             all         fe80::1/16                  md5

Ho cercato su Google e non ho trovato alcuna soluzione. Aiuto! Grazie.

Peter.

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a dba.stackexchange
scroll top