Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-4875

PostgreSQL error log gets flooded with warnings when pg_stat_statements extension is not installed in the database used by PMM Server or when PostgreSQL user is unable to connect to it

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Done
    • 2.0.1
    • 2.1.0
    • PMM Agent
    • None
    • 2
    • Yes
    • Yes

    Description

      When creating and using a custom PMM user without creating a namesake database as well, PostgreSQL error log gets flooded with errors:

      2019-10-22 07:38:06.066 PDT [27434] FATAL: database "pmm_user" does not exist
      2019-10-22 07:39:00.008 PDT [27455] FATAL: database "pmm_user" does not exist
      2019-10-22 07:40:00.007 PDT [27461] FATAL: database "pmm_user" does not exist
      2019-10-22 07:41:00.005 PDT [27521] FATAL: database "pmm_user" does not exist
      2019-10-22 07:42:00.004 PDT [27538] FATAL: database "pmm_user" does not exist
      2019-10-22 07:43:00.003 PDT [27544] FATAL: database "pmm_user" does not exist
      2019-10-22 07:44:00.007 PDT [27549] FATAL: database "pmm_user" does not exist
      2019-10-22 07:45:00.005 PDT [27572] FATAL: database "pmm_user" does not exist

      Steps to reproduce, adding a PostgreSQL 11 server to PMM:

      $ sudo yum install pmm2-client
      $ sudo pmm-admin config --server-insecure-tls --server-url=https://admin:[email protected]:443
      
      postgres=# CREATE USER pmm_user WITH SUPERUSER ENCRYPTED PASSWORD 'secret';
      $ pmm-admin add postgresql --username=pmm_user --password=secret postgres 127.0.0.1:5432

      If we alter the postgres user by setting a password to the role and use it instead then no errors are reported in the error log.

      This seems to be related to PostgreSQL defaulting to use the client's username for database name when no database name is supplied in the connection. Either PMM should default to the postgres database or provide a parameter to set which database to use.

      Despite the warnings in the error log, PMM is being able to capture PostgreSQL data and display it.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fernando.laudares@percona.com Fernando Laudares
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 6 hours, 15 minutes
                  6h 15m

                  Smart Checklist