Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-3406

Augeas fails with Postgresql 13

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: puppet-agent 6.22.0
    • Component/s: None
    • Environment:

      CentOS 7.8 64 Bit

      Puppet Agent: puppet-agent-6.18.0-1.el7.x86_64

    • Template:
    • Team:
      Night's Watch
    • Story Points:
      2
    • Sprint:
      NW - 2021-03-03
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fix PostgreSQL 13 configuration file parsing by patching the vendored Augeas in puppet-agent
    • QA Risk Assessment:
      Needs Assessment

      Description

      The augeas module of puppet can't parse the config file of PGSQL 13.
      Using PGSQL 12 will work fine.

      To reproduce:
      /opt/puppetlabs/puppet/bin/augtool print /files/var/lib/pgsql/12/data/postgresql.conf

      /files/var/lib/pgsql/12/data/postgresql.conf
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[1] = "-----------------------------"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[2] = "PostgreSQL configuration file"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[3] = "-----------------------------"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[4] = "This file consists of lines of the form:"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[5] = "name = value"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[6] = "(The \"=\" is optional.)  Whitespace may be used.  Comments are introduced with"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[7] = "\"#\" anywhere on a line.  The complete list of parameter names and allowed"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[8] = "values can be found in the PostgreSQL documentation."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[9] = "The commented-out settings shown in this file represent the default values."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[10] = "Re-commenting a setting is NOT sufficient to revert it to the default value;"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[11] = "you need to reload the server."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[12] = "This file is read on server startup and when the server receives a SIGHUP"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[13] = "signal.  If you edit the file on a running system, you have to SIGHUP the"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[14] = "server for the changes to take effect, run \"pg_ctl reload\", or execute"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[15] = "\"SELECT pg_reload_conf()\".  Some parameters, which are marked below,"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[16] = "require a server shutdown and restart to take effect."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[17] = "Any parameter can also be given as a command-line option to the server, e.g.,"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[18] = "\"postgres -c log_connections=on\".  Some parameters can be changed at run time"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[19] = "with the \"SET\" SQL command."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[20] = "Memory units:  kB = kilobytes        Time units:  ms  = milliseconds"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[21] = "MB = megabytes                     s   = seconds"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[22] = "GB = gigabytes                     min = minutes"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[23] = "TB = terabytes                     h   = hours"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[24] = "d   = days"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[25] = "------------------------------------------------------------------------------"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[26] = "FILE LOCATIONS"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[27] = "------------------------------------------------------------------------------"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[28] = "The default values of these variables are driven from the -D command-line"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[29] = "option or PGDATA environment variable, represented here as ConfigDir."
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[30] = "data_directory = 'ConfigDir'\t\t# use data in another directory"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[31] = "(change requires restart)"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[32] = "hba_file = 'ConfigDir/pg_hba.conf'\t# host-based authentication file"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[33] = "(change requires restart)"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[34] = "ident_file = 'ConfigDir/pg_ident.conf'\t# ident configuration file"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[35] = "(change requires restart)"
      /files/var/lib/pgsql/12/data/postgresql.conf/#comment[36] = "If external_pid_file is not explicitly set, no extra PID file is written."
      

      /opt/puppetlabs/puppet/bin/augtool print /files/var/lib/pgsql/13/data/postgresql.conf

      no result
      

      using it in puppet it self:

      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error = parse_failed
      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error/pos = 3754
      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error/line = 91
      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error/char = 22
      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/postgresql.aug:69.10-.46:
      Debug: Augeas[postgresql_conf](provider=augeas): /augeas/files/var/lib/pgsql/13/data/postgresql.conf/error/message = Iterated lens matched less than it should
      

      Line 91:

      password_encryption = scram-sha-256             # md5 or scram-sha-256
      

        Attachments

          Activity

            People

            Assignee:
            gabriel.nagy Gabriel Nagy
            Reporter:
            puppetTux Frank
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support