Re: [HACKERS] Incomplete startup packet errors

Lists: pgsql-hackers
From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Incomplete startup packet errors
Date: 2016-04-13 08:02:22
Message-ID: CABUevEzKFAaVWAM=-UPPYp56OG_pkNPibECyROhFuMCjwOVJVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

It's fairly common to see a lot of "Incomplete startup packet" in the
logfiles caused by monitoring or healthcheck connections.

I wonder if it would make sense to only log that error if *at least one
byte* has been received and then it becomes empty. Meaning that if the
client just connects+disconnects without sending anything, we don't log
anything. At least at the default log level (we could have a DEBUG level
that logged "connection closed immediately").

That would get rid of a lot of logspam.

Would that make sense?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 08:04:06
Message-ID: 20160413080406.GA6216@toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

At 2016-04-13 10:02:22 +0200, magnus(at)hagander(dot)net wrote:
>
> I wonder if it would make sense to only log that error if *at least
> one byte* has been received and then it becomes empty.

Yes, it would be very nice to eliminate that logspam, as you say.

-- Abhijit


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 08:21:49
Message-ID: CA+OCxoydn7sFxFhf4XaJk+abmXyDJ1MoX=7m3vynBGnPRu3GDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 9:02 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> It's fairly common to see a lot of "Incomplete startup packet" in the
> logfiles caused by monitoring or healthcheck connections.
>
> I wonder if it would make sense to only log that error if *at least one
> byte* has been received and then it becomes empty. Meaning that if the
> client just connects+disconnects without sending anything, we don't log
> anything. At least at the default log level (we could have a DEBUG level
> that logged "connection closed immediately").
>
> That would get rid of a lot of logspam.
>
> Would that make sense?

Absolutely. It would be very nice to get rid of such noise.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 08:24:17
Message-ID: CAM3SWZT6zqhva2Snz5MLiCoS2ydw+VjZNMDhW3hHCLARTnm6jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 1:02 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> It's fairly common to see a lot of "Incomplete startup packet" in the
> logfiles caused by monitoring or healthcheck connections.

I've also seen it caused by port scanning.

--
Peter Geoghegan


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 08:25:35
Message-ID: CABUevEw0ii+tnQs1ynoPuOJybb7JbW2ZO8BCDGm=YC3+Kg4VqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 10:24 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:

> On Wed, Apr 13, 2016 at 1:02 AM, Magnus Hagander <magnus(at)hagander(dot)net>
> wrote:
> > It's fairly common to see a lot of "Incomplete startup packet" in the
> > logfiles caused by monitoring or healthcheck connections.
>
> I've also seen it caused by port scanning.
>

Yes, definitely. Question there might be if that's actually a case when we
*want* that logging?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 13:56:43
Message-ID: 20758.1460555803@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Wed, Apr 13, 2016 at 10:24 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>> On Wed, Apr 13, 2016 at 1:02 AM, Magnus Hagander <magnus(at)hagander(dot)net>
>> wrote:
>>> It's fairly common to see a lot of "Incomplete startup packet" in the
>>> logfiles caused by monitoring or healthcheck connections.

>> I've also seen it caused by port scanning.

> Yes, definitely. Question there might be if that's actually a case when we
> *want* that logging?

I should think someone might. But I doubt we want to introduce another
GUC for this. Would it be okay to downgrade the message to DEBUG1 if
zero bytes were received?

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 14:04:49
Message-ID: CABUevEzq8_nSq7fwe0-fbOAK8S2YNN-PkfsamfEvy2-d3dRUoA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 3:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > On Wed, Apr 13, 2016 at 10:24 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> >> On Wed, Apr 13, 2016 at 1:02 AM, Magnus Hagander <magnus(at)hagander(dot)net>
> >> wrote:
> >>> It's fairly common to see a lot of "Incomplete startup packet" in the
> >>> logfiles caused by monitoring or healthcheck connections.
>
> >> I've also seen it caused by port scanning.
>
> > Yes, definitely. Question there might be if that's actually a case when
> we
> > *want* that logging?
>
> I should think someone might. But I doubt we want to introduce another
> GUC for this. Would it be okay to downgrade the message to DEBUG1 if
> zero bytes were received?
>
>
Yeah, that was my suggestion - I think that's a reasonable compromise. And
yes, I agree that a separate GUC for it would be a huge overkill.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: magnus(at)hagander(dot)net
Cc: pg(at)heroku(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 14:30:24
Message-ID: 20160413.233024.257952548457606609.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>> I've also seen it caused by port scanning.
>>
>
> Yes, definitely. Question there might be if that's actually a case when we
> *want* that logging?

Is it possible a user want the log because he/she wants to notice that
the system is being attacked?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Peter Geoghegan <pg(at)heroku(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 17:03:26
Message-ID: CA+Tgmoa17zZFtRXOdEb08u0RPFTvSwu4xAd_=wS4pvr-qNY4+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 10:30 AM, Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
>>> I've also seen it caused by port scanning.
>>
>> Yes, definitely. Question there might be if that's actually a case when we
>> *want* that logging?
>
> Is it possible a user want the log because he/she wants to notice that
> the system is being attacked?

Yeah, but it doesn't seem very likely, because:

1. If the system is on the Internet, it's definitely being attacked, and

2. The attacks that connect to a port and then disconnect are not the
ones you should be most worried about, and

3. The right way to detect attacks is through OS-level monitoring or
firewall-level monitoring, and nothing we do in PG is going to come
close to the same value.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: robertmhaas(at)gmail(dot)com
Cc: magnus(at)hagander(dot)net, pg(at)heroku(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incomplete startup packet errors
Date: 2016-04-13 21:34:14
Message-ID: 20160414.063414.1697793311576261462.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>> Is it possible a user want the log because he/she wants to notice that
>> the system is being attacked?
>
> Yeah, but it doesn't seem very likely, because:
>
> 1. If the system is on the Internet, it's definitely being attacked, and
>
> 2. The attacks that connect to a port and then disconnect are not the
> ones you should be most worried about, and
>
> 3. The right way to detect attacks is through OS-level monitoring or
> firewall-level monitoring, and nothing we do in PG is going to come
> close to the same value.

Ok, that makes sense.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


From: Christoph Berg <myon(at)debian(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Geoghegan <pg(at)heroku(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: [HACKERS] Incomplete startup packet errors
Date: 2019-02-28 15:13:36
Message-ID: 20190228151336.GB7550@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Re: Magnus Hagander 2016-04-13 <CABUevEzq8_nSq7fwe0-fbOAK8S2YNN-PkfsamfEvy2-d3dRUoA(at)mail(dot)gmail(dot)com>
> > >>> It's fairly common to see a lot of "Incomplete startup packet" in the
> > >>> logfiles caused by monitoring or healthcheck connections.
> >
> > >> I've also seen it caused by port scanning.
> >
> > > Yes, definitely. Question there might be if that's actually a case when
> > we
> > > *want* that logging?
> >
> > I should think someone might. But I doubt we want to introduce another
> > GUC for this. Would it be okay to downgrade the message to DEBUG1 if
> > zero bytes were received?
> >
> >
> Yeah, that was my suggestion - I think that's a reasonable compromise. And
> yes, I agree that a separate GUC for it would be a huge overkill.

There have been numerous complaints about that log message, and the
usual reply is always something like what Pavel said recently:

"It is garbage. Usually it means nothing, but better to work live
without this garbage." [1]

[1] /message-id/CAFj8pRDtwsxj63%3DLaWSwA8u7NrU9k9%2BdJtz2gB_0f4SxCM1sQA%40mail.gmail.com

Let's get rid of it.

Christoph

Attachment Content-Type Size
0001-Demote-incomplete-startup-packet-to-DEBUG1.patch text/x-diff 1.4 KB