Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql::Server::Config_entry uninitialized constant ParserError #1532

Closed
jlindquist-godaddy opened this issue Oct 12, 2023 · 4 comments · Fixed by #1540
Closed

Postgresql::Server::Config_entry uninitialized constant ParserError #1532

jlindquist-godaddy opened this issue Oct 12, 2023 · 4 comments · Fixed by #1540

Comments

@jlindquist-godaddy
Copy link

jlindquist-godaddy commented Oct 12, 2023

Describe the Bug

Error: /Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[shared_buffers]/Postgresql_conf[shared_buffers]: Could not evaluate: uninitialized constant ParserError
Did you mean?  ParseError
Notice: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Anchor[postgresql::server::service::begin::main]: Dependency Postgresql_conf[shared_buffers] has failures: true

Expected Behavior

Catalog compilation does not fail, and config entry is properly validated and set as necessary

Steps to Reproduce

Include server config entries from Hiera

postgresql::server::config_entries:
  max_connections: 300
  shared_buffers: 4GB

Environment

  • Version 10.0.1
  • Platform CentOS 7

Additional Context

It looks like we're triggering the error here based on a config such as this which does have multiple entries that need to be resolved, but it should raise a proper error:

# grep shared_buffers /var/lib/pgsql/14/data/postgresql.conf
shared_buffers = 128MB # min 128kB
#wal_buffers = -1			# min 32kB, -1 sets based on shared_buffers
shared_buffers = 4GB
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.
@bastelfreak
Copy link
Collaborator

@jlindquist-godaddy can you take a look at #1538 and test it?

bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.
@ekohl ekohl linked a pull request Oct 19, 2023 that will close this issue
5 tasks
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.

Fixes 179472b
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.

Fixes 179472b
@jlindquist-godaddy
Copy link
Author

Looks good, thank you!

bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.

Fixes 179472b
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the provider. This
exception doesn't exist in Ruby. Puppet ships ther own exception,
Puppet::Error. It probably makes sense to raise that instead.

Fixes 179472b
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
@ekohl ekohl linked a pull request Oct 19, 2023 that will close this issue
5 tasks
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 19, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Oct 26, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Nov 13, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Nov 13, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Nov 27, 2023
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Jan 17, 2024
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
@ekolkman
Copy link

ekolkman commented Feb 8, 2024

I just ran into this bug with version 10.0.3 of the module.
Easily reproducable: have multiple listen_addresses lines in the postgresql.conf file (values don't matter) and configure a server with a listen_addresses parameter set to a value.
(Postgres itself usually doesn't mind multiple entries for the same parameter, as only the last one is used. But this version of the module doesn't accept it and now gives an error about giving the error.)

@ekolkman
Copy link

ekolkman commented Apr 8, 2024

Problem persists in 10.1.0.
Reproducable by adding any entry in the postgresql.conf a second time (doesn't matter if the value differs).
Having an override of the value in the postgresql.auto.conf (normally managed from postgresql itself using 'ALTER SYSTEM ...') statements doesn't show the same error.

So there are 2 problems:

  • a situation accepted by postgresql itself is not accepted by this module
  • the errormessage for this situation produces its own error (and the last one is the only one visible in the puppet logs)

bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Apr 8, 2024
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Apr 10, 2024
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
bastelfreak added a commit to bastelfreak/puppetlabs-postgresql that referenced this issue Apr 10, 2024
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
Ramesh7 added a commit that referenced this issue Apr 11, 2024
(#1532) Replace ParserError with Puppet::Error
vaol pushed a commit to vaol/puppetlabs-postgresql that referenced this issue Oct 13, 2024
I'm not sure how we ended up with ParserError in the
provider. This exception doesn't exist in Ruby.
Puppet ships ther own exception, Puppet::Error. It
probably makes sense to raise that instead.

Fixes 179472b

Alternative implementation for puppetlabs#1538
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants