Обсуждение: A question regarding postgresql log messages,

Поиск
Список
Период
Сортировка

A question regarding postgresql log messages,

От
AYahorau@ibagroup.eu
Дата:
Hello PostgreSQL Community!

I have a question regarding PostgreSQL log messages.

Operating with PostgreSQL and configuring it we need to understand that everything  goes well. To do this we monitor PostgreSQL log to be sure that database works properly indeed.
We can do it based on error codes described here:
https://www.postgresql.org/docs/11/errcodes-appendix.html
and based on these error codes we can see if something is wrong.

But in my view this is not enough.  For example a message
53400        configuration_limit_exceeded
can be represented in log with different severities:  PANIC/ERROR/WARNING.
And there are a number of other similar examples.

So, the problem is that it is not easy to understand if the error is really critical for system or not.

As far as I know a number of object-relational database management systems provide full list of possible messages and relations between them.
It helps to understand that some critical error is not active any more and the database works properly.


Is there such a list for PostgreSQL which contains all the possible events and their error codes. Is there a tool which helps to realize that some FATAL/PANIC message is not actual now?

Thank You in advance,
Andrei Yahorau

Re: A question regarding postgresql log messages,

От
nunks
Дата:
I think the error codes are documented mainly to be used in a
development environment, like when writing a function that needs to
listen to abnormal behaviour. If you're doing log based monitoring, I
think it's safe to rely on the severity shown in the log file itself.

The multiple possible severity levels for an error code are probably
due to PostgreSQL's modular architecture: maybe an error is relatively
negligible when raised to a client backend process, but a very severe
one when coming from the postmaster.

On 3/21/19, AYahorau@ibagroup.eu <AYahorau@ibagroup.eu> wrote:
> Hello PostgreSQL Community!
>
> I have a question regarding PostgreSQL log messages.
>
> Operating with PostgreSQL and configuring it we need to understand that
> everything  goes well. To do this we monitor PostgreSQL log to be sure
> that database works properly indeed.
> We can do it based on error codes described here:
> https://www.postgresql.org/docs/11/errcodes-appendix.html
> and based on these error codes we can see if something is wrong.
>
> But in my view this is not enough.  For example a message
> 53400   configuration_limit_exceeded
> can be represented in log with different severities:  PANIC/ERROR/WARNING.
> And there are a number of other similar examples.
>
> So, the problem is that it is not easy to understand if the error is
> really critical for system or not.
>
> As far as I know a number of object-relational database management systems
> provide full list of possible messages and relations between them.
> It helps to understand that some critical error is not active any more and
> the database works properly.
>
> Is there such a list for PostgreSQL which contains all the possible events
> and their error codes. Is there a tool which helps to realize that some
> FATAL/PANIC message is not actual now?
>
> Thank You in advance,
> Andrei Yahorau


--
----------
“Life beats down and crushes the soul and art reminds you that you have one.”


- Stella Adler


Re: A question regarding postgresql log messages,

От
AYahorau@ibagroup.eu
Дата:
Thank you for your response.

I agree with you concerning  the significance of messages.

I also consider that there is no need to pay attention to such type of errors:
28P01 FATAL :  password authentication failed for user "user1"

despite its FATAL severity.

But how can I distinguish between really significant errors and the errors which can be ignored?
Is there some kind of indicator  for it?


Best regards,
Andrei Yahorau



From:        nunks <nunks.lol@gmail.com>
To:        AYahorau@ibagroup.eu,
Cc:        pgsql-admin@postgresql.org, MikalaiKeida@ibagroup.eu
Date:        21/03/2019 16:31
Subject:        Re: A question regarding postgresql log messages,




I think the error codes are documented mainly to be used in a
development environment, like when writing a function that needs to
listen to abnormal behaviour. If you're doing log based monitoring, I
think it's safe to rely on the severity shown in the log file itself.

The multiple possible severity levels for an error code are probably
due to PostgreSQL's modular architecture: maybe an error is relatively
negligible when raised to a client backend process, but a very severe
one when coming from the postmaster.

On 3/21/19, AYahorau@ibagroup.eu <AYahorau@ibagroup.eu> wrote:
> Hello PostgreSQL Community!
>
> I have a question regarding PostgreSQL log messages.
>
> Operating with PostgreSQL and configuring it we need to understand that
> everything  goes well. To do this we monitor PostgreSQL log to be sure
> that database works properly indeed.
> We can do it based on error codes described here:
>
https://www.postgresql.org/docs/11/errcodes-appendix.html
> and based on these error codes we can see if something is wrong.
>
> But in my view this is not enough.  For example a message
> 53400   configuration_limit_exceeded
> can be represented in log with different severities:  PANIC/ERROR/WARNING.
> And there are a number of other similar examples.
>
> So, the problem is that it is not easy to understand if the error is
> really critical for system or not.
>
> As far as I know a number of object-relational database management systems
> provide full list of possible messages and relations between them.
> It helps to understand that some critical error is not active any more and
> the database works properly.
>
> Is there such a list for PostgreSQL which contains all the possible events
> and their error codes. Is there a tool which helps to realize that some
> FATAL/PANIC message is not actual now?
>
> Thank You in advance,
> Andrei Yahorau


--
----------
“Life beats down and crushes the soul and art reminds you that you have one.”


- Stella Adler

Re: A question regarding postgresql log messages,

От
Ron
Дата:
If you see many of these errors, it could very well be an indication of a hack attempt.

On 3/21/19 9:03 AM, AYahorau@ibagroup.eu wrote:
Thank you for your response.

I agree with you concerning  the significance of messages.

I also consider that there is no need to pay attention to such type of errors:
28P01 FATAL :  password authentication failed for user "user1"

despite its FATAL severity.

But how can I distinguish between really significant errors and the errors which can be ignored?
Is there some kind of indicator  for it?


Best regards,
Andrei Yahorau



From:        nunks <nunks.lol@gmail.com>
To:        AYahorau@ibagroup.eu,
Cc:        pgsql-admin@postgresql.org, MikalaiKeida@ibagroup.eu
Date:        21/03/2019 16:31
Subject:        Re: A question regarding postgresql log messages,




I think the error codes are documented mainly to be used in a
development environment, like when writing a function that needs to
listen to abnormal behaviour. If you're doing log based monitoring, I
think it's safe to rely on the severity shown in the log file itself.

The multiple possible severity levels for an error code are probably
due to PostgreSQL's modular architecture: maybe an error is relatively
negligible when raised to a client backend process, but a very severe
one when coming from the postmaster.

On 3/21/19, AYahorau@ibagroup.eu <AYahorau@ibagroup.eu> wrote:
> Hello PostgreSQL Community!
>
> I have a question regarding PostgreSQL log messages.
>
> Operating with PostgreSQL and configuring it we need to understand that
> everything  goes well. To do this we monitor PostgreSQL log to be sure
> that database works properly indeed.
> We can do it based on error codes described here:
>
https://www.postgresql.org/docs/11/errcodes-appendix.html
> and based on these error codes we can see if something is wrong.
>
> But in my view this is not enough.  For example a message
> 53400   configuration_limit_exceeded
> can be represented in log with different severities:  PANIC/ERROR/WARNING.
> And there are a number of other similar examples.
>
> So, the problem is that it is not easy to understand if the error is
> really critical for system or not.
>
> As far as I know a number of object-relational database management systems
> provide full list of possible messages and relations between them.
> It helps to understand that some critical error is not active any more and
> the database works properly.
>
> Is there such a list for PostgreSQL which contains all the possible events
> and their error codes. Is there a tool which helps to realize that some
> FATAL/PANIC message is not actual now?
>
> Thank You in advance,
> Andrei Yahorau


--
----------
“Life beats down and crushes the soul and art reminds you that you have one.”


- Stella Adler


--
Angular momentum makes the world go 'round.

Re: A question regarding postgresql log messages,

От
nunks
Дата:
Maybe you can use an informative log_line_prefix configuration, like
the proposed pg_badger one:

'%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '

This should give you more information about the real importance of the
error message to your use case. A FATAL error from user "postgres" or
"[unknown]" can be potentially more problematic than an error from
"user1". Also, postmaster messages won't have any of these variables
set:

2019-03-21 12:21:32 -03 [1714]: [17-1] user=,db=,app=,client= LOG:
checkpoint starting: time

--
----------
“Life beats down and crushes the soul and art reminds you that you have one.”


- Stella Adler


Re: A question regarding postgresql log messages,

От
AYahorau@ibagroup.eu
Дата:
> Maybe you can use an informative log_line_prefix configuration, like
> the proposed pg_badger one:

> '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
> This should give you more information about the real importance of the
> error message to your use case. A FATAL error from user "postgres" or
> "[unknown]" can be potentially more problematic than an error from
> "user1". Also, postmaster messages won't have any of these variables
> set:

> 2019-03-21 12:21:32 -03 [1714]: [17-1] user=,db=,app=,client= LOG:
> checkpoint starting: time


Thank you so much for this suggestion.
I have another question. As far as I know there is a number of tools which collect some statistic concerning  some Postgres issues

(connections, disconnections, queries, most frequent events etc.) based on Postgres Log and so on and so forth.

Do you know is there such a tool or a set of some actions which can give a precise final answer whether db server /db is operable or not?

So in this case does not matter how this answer can be got (postgres log parsing or some sql queries).


Thank you in advance,
Andrei Yahorau



From:        nunks <nunks.lol@gmail.com>
To:        AYahorau@ibagroup.eu,
Cc:        pgsql-admin@postgresql.org, MikalaiKeida@ibagroup.eu
Date:        21/03/2019 16:31
Subject:        Re: A question regarding postgresql log messages,




I think the error codes are documented mainly to be used in a
development environment, like when writing a function that needs to
listen to abnormal behaviour. If you're doing log based monitoring, I
think it's safe to rely on the severity shown in the log file itself.

The multiple possible severity levels for an error code are probably
due to PostgreSQL's modular architecture: maybe an error is relatively
negligible when raised to a client backend process, but a very severe
one when coming from the postmaster.

On 3/21/19, AYahorau@ibagroup.eu <AYahorau@ibagroup.eu> wrote:
> Hello PostgreSQL Community!
>
> I have a question regarding PostgreSQL log messages.
>
> Operating with PostgreSQL and configuring it we need to understand that
> everything  goes well. To do this we monitor PostgreSQL log to be sure
> that database works properly indeed.
> We can do it based on error codes described here:
>
https://www.postgresql.org/docs/11/errcodes-appendix.html
> and based on these error codes we can see if something is wrong.
>
> But in my view this is not enough.  For example a message
> 53400   configuration_limit_exceeded
> can be represented in log with different severities:  PANIC/ERROR/WARNING.
> And there are a number of other similar examples.
>
> So, the problem is that it is not easy to understand if the error is
> really critical for system or not.
>
> As far as I know a number of object-relational database management systems
> provide full list of possible messages and relations between them.
> It helps to understand that some critical error is not active any more and
> the database works properly.
>
> Is there such a list for PostgreSQL which contains all the possible events
> and their error codes. Is there a tool which helps to realize that some
> FATAL/PANIC message is not actual now?
>
> Thank You in advance,
> Andrei Yahorau


--
----------
“Life beats down and crushes the soul and art reminds you that you have one.”


- Stella Adler