pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connection loosing at some places - caused by firewall
5+ messages / 2 participants
[nested] [flat]

* Connection loosing at some places - caused by firewall
@ 2017-11-14 11:09  Durumdara <durumdara@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Durumdara @ 2017-11-14 11:09 UTC (permalink / raw)
  To: pgsql-general

Dear Members!


Windows 10, PGSQL 9.4 and 9.6 (Debian with SSL, and Windows without it - it
doesn't matter).

When I (or my boss) work(s) at home, I got connection lost errors from
PGAdmin (3/4) or from other applications too.


server closed the connection unexpectedly
 This probably means the server terminated abnormally
 before or while processing the request.


PGAdmin, EMS PostgreSQL manager, Navicat for PGSQL, and psql too.

When minimum 5 minutes passed after the last request (select, insert, or
any communication what I did) the connection lost.

The keepalive timer is 10 minutes in the server - so it is not the source
of the problem.

I tried to set keepalive in the clients (EMS, Navicat called ping) to lower
- no effect.

When I did any request in my side before the 5 minutes "limit" passed, I
got a new 5 minutes.

It seems to be libpq.dll applications need traffic (started by the client)
in 5 minute periods to keep the connection.

In the office I don't have this limitation.

My colleauge can work at home without time limit, and he has same Internet
Provider as mine.

It's not PGSQL server based.
When I use VPN connection from home to reach office PG server, I also got
this problem.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection loosing at some places - caused by firewall
@ 2018-02-13 07:35  Durumdara <durumdara@gmail.com>
  parent: Durumdara <durumdara@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Durumdara @ 2018-02-13 07:35 UTC (permalink / raw)
  To: pgsql-general

Hello!

2017-11-14 12:09 GMT+01:00 Durumdara <durumdara@gmail.com>:

>
> Windows 10, PGSQL 9.4 and 9.6 (Debian with SSL, and Windows without it -
> it doesn't matter).
>
> When I (or my boss) work(s) at home, I got connection lost errors from
> PGAdmin (3/4) or from other applications too.
>
>
> server closed the connection unexpectedly
>  This probably means the server terminated abnormally
>  before or while processing the request.
>
>
> PGAdmin, EMS PostgreSQL manager, Navicat for PGSQL, and psql too.
>
> When minimum 5 minutes passed after the last request (select, insert, or
> any communication what I did) the connection lost.
>
>
>

For PGAdmin III I found a solution-like thing.

https://superuser.com/questions/729034/any-way-to-keep-connection-alive-in-pgadmin-without-setting-i...

dd

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection loosing at some places - caused by firewall
@ 2018-02-13 20:21  George Neuner <gneuner2@comcast.net>
  parent: Durumdara <durumdara@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: George Neuner @ 2018-02-13 20:21 UTC (permalink / raw)
  To: pgsql-general

On Tue, 14 Nov 2017 12:09:31 +0100, Durumdara <durumdara@gmail.com>
wrote:


>*I disabled my firewall at home - the [keepalive] problem vanished!!!*

What firewall are you using?  Windows own firewall doesn't interfere
with keepalive packets.  Most commercial SOHO firewalls won't either.

George





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection loosing at some places - caused by firewall
@ 2018-02-19 12:02  Durumdara <durumdara@gmail.com>
  parent: George Neuner <gneuner2@comcast.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Durumdara @ 2018-02-19 12:02 UTC (permalink / raw)
  To: George Neuner <gneuner2@comcast.net>; +Cc: pgsql-general

Hello!


2018-02-13 21:21 GMT+01:00 George Neuner <gneuner2@comcast.net>:

> On Tue, 14 Nov 2017 12:09:31 +0100, Durumdara <durumdara@gmail.com>
> wrote:
>
>
> >*I disabled my firewall at home - the [keepalive] problem vanished!!!*
>
> What firewall are you using?  Windows own firewall doesn't interfere
> with keepalive packets.  Most commercial SOHO firewalls won't either.
>
>
Normal Windows Firewall (Defender). An ASUS test notebook works. The DELL
isn't.
So something is different in the FW on DELL. With manually defined (faster)
keepalive it's working.

dd

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection loosing at some places - caused by firewall
@ 2018-02-20 05:54  George Neuner <gneuner2@comcast.net>
  parent: Durumdara <durumdara@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: George Neuner @ 2018-02-20 05:54 UTC (permalink / raw)
  To: pgsql-general

On Mon, 19 Feb 2018 13:02:30 +0100, Durumdara <durumdara@gmail.com>
wrote:

>2018-02-13 21:21 GMT+01:00 George Neuner <gneuner2@comcast.net>:
>
>> On Tue, 14 Nov 2017 12:09:31 +0100, Durumdara <durumdara@gmail.com>
>> wrote:
>>
>> >*I disabled my firewall at home - the [keepalive] problem vanished!!!*
>>
>> What firewall are you using?  Windows own firewall doesn't interfere
>> with keepalive packets.  Most commercial SOHO firewalls won't either.
>>
>Normal Windows Firewall (Defender). An ASUS test notebook works. The DELL
>isn't.
>So something is different in the FW on DELL. With manually defined (faster)
>keepalive it's working.

Keepalive is part of the TCP protocol - it's an ACK that repeats the
last used packet sequence number.  Under normal circumstances, the
sequence number is incremented (modulo rollover) for each new packet.
Keepalive is recognized as a deliberate and particular breaking of the
packet sequence.

Windows firewall has no settings pertaining to keepalive separate from
the operating system.  Once you have permitted TCP connections to the
port or program, if any keepalive packets are sent, the firewall must
allow them through.

[Of course, both sides must agree on the keepalive settings for it to
work, but that is a different issue.]


It may be that your firewall is f'd up.  The firewall doe perform
"stateful inspection" of open TCP connections - essentially looking
for protocol mistakes that may indicate intrusion hacks or replayed
connections.  It could be that the SI module is losing synchronization
when the connection goes idle.
[Back in the day, there were a number of SOHO NAT routers that had
this and other problems with their stateful inspection code.]


You can try running a system file check to see if something has gotten
corrupted:
https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-o...

You also can try resetting the firewall rules to default from the
control panel.  Of course then you'll have to reauthorize every
program that requires a connection.  


for more information on how the firewall works, see: 
https://technet.microsoft.com/en-us/library/cc779199(v=ws.10).aspx


Hope this helps,
George





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-02-20 05:54 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 11:09 Connection loosing at some places - caused by firewall Durumdara <durumdara@gmail.com>
2018-02-13 07:35 ` Durumdara <durumdara@gmail.com>
2018-02-13 20:21 ` George Neuner <gneuner2@comcast.net>
2018-02-19 12:02   ` Durumdara <durumdara@gmail.com>
2018-02-20 05:54     ` George Neuner <gneuner2@comcast.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox