Foreman 3.9 katello 4.11 upgrade problem

Problem:
By upgrading from Foreman 3.8 - Katello 4.10 to Froreman 3.9 - katello 4.11 i am getting that error:

Error 1: Puppet Postgresql_conf resource ‘work_mem’ failed. Logs:
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[work_mem]/Postgresql_conf[work_mem]/require
require to Class[Postgresql::Server::Initdb]
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[work_mem]/Postgresql_conf[work_mem]/notify
notify to Class[Postgresql::Server::Reload]
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[work_mem]/Postgresql_conf[work_mem]
Starting to evaluate the resource (663 of 2037)
Could not evaluate: uninitialized constant ParserError
Did you mean? ParseError
Evaluated in 0.01 seconds
Error 2: Puppet Postgresql_conf resource ‘log_min_duration_statement’ failed. Logs:
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[log_min_duration_statement]/Postgresql_conf[log_min_duration_statement]/require
require to Class[Postgresql::Server::Initdb]
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[log_min_duration_statement]/Postgresql_conf[log_min_duration_statement]/notify
notify to Class[Postgresql::Server::Reload]
/Stage[main]/Postgresql::Server/Postgresql::Server::Config_entry[log_min_duration_statement]/Postgresql_conf[log_min_duration_statement]
Starting to evaluate the resource (667 of 2037)
Could not evaluate: uninitialized constant ParserError
Did you mean? ParseError
Evaluated in 0.01 seconds
Error 3: Puppet Postgresql_conf resource ‘port_for_instance_main’ failed. Logs:
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]/require
require to Class[Postgresql::Server::Initdb]
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]/notify
notify to Class[Postgresql::Server::Service]
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]
Starting to evaluate the resource (1041 of 2046)
Could not evaluate: uninitialized constant ParserError
Did you mean? ParseError
Evaluated in 0.00 seconds

Expected outcome:

Foreman and Proxy versions:
Foreman 3.8
Katello 4.10
RHEL 8.9
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

The ParserError was recently fixed in (#1532) Replace ParserError with Puppet::Error by bastelfreak · Pull Request #1540 · puppetlabs/puppetlabs-postgresql · GitHub
But the actual issue (according to the code where the error is raised) is that your postgresql.conf contains the same config entry multiple times, which confuses the parser.

Thanks.
I have changed the first file but I can not find file spec/unit/provider/postgresql_conf/ruby_spec.rb ?

Don’t need to, those are just unit tests, which aren’t shipped.

What do i have to change so that it will work?

Your postgresql.conf so it does not contain duplicate entries.

Which one?

/etc/systemd/system/postgresql.service.d/postgresql.conf
/etc/postgresql-setup/upgrade/postgresql.conf
/var/lib/pgsql/data/postgresql.conf
/var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf
/usr/lib/tmpfiles.d/postgresql.conf

/var/lib/pgsql/data/postgresql.conf

Now i have only one error and i can not find the entry ‘port_for_instance_main’ in /var/lib/pgsql/data/postgresql.conf?

Error 1: Puppet Postgresql_conf resource ‘port_for_instance_main’ failed. Logs:
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]/require
require to Class[Postgresql::Server::Initdb]
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]/notify
notify to Class[Postgresql::Server::Service]
/Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]
Starting to evaluate the resource (1041 of 2046)
Could not evaluate: uninitialized constant ParserError
Did you mean? ParseError
Evaluated in 0.00 seconds

Thanks. I found it. It is named just port and not port_for_instance_main.

Now i have that errors:

Error 1: Puppet Service resource ‘foreman’ failed. Logs:
/Stage[main]/Foreman::Service/Service[foreman]/before
before to Service[foreman.socket]
/Service[foreman]
Starting to evaluate the resource (4797 of 5052)
Evaluated in 6.21 seconds
/Stage[main]/Foreman::Service/Service[foreman]/ensure
change from ‘stopped’ to ‘running’ failed: Systemd start for foreman failed!

Error 2: Puppet Service resource ‘redis’ failed. Logs:
/Service[redis]
Starting to evaluate the resource (4907 of 5052)
Evaluated in 0.66 seconds
/Stage[main]/Redis::Service/Service[redis]/ensure
change from ‘stopped’ to ‘running’ failed: Systemd start for redis failed!

Any other output why they are not starting?

That is it:

For Foreman, try running foreman-rake db:migrate and foreman-rake db:seed as root.

No idea about Redis tho.

Now i get:

Hmm, that didn’t change much :frowning:

What’s the version of the remote execution plugin you have? (rpm -q rubygem-foreman_remote_execution)

rubygem-foreman_remote_execution-12.0.5-1.fm3_9.el8.noarch

Now i have done that and it helped for foreman but the redis is still there:

Commented out /usr/share/foreman/app/models/role.rb:335

  def permission_records(permissions)
    perms = permissions.flatten
    collection = Permission.where(:name => perms).all
    #if collection.size != perms.size
    #  raise ::Foreman::PermissionMissingException.new(N_("some permissions were not found: %s"),
    #    not_found_permissions(collection.pluck(:name), perms))
    #end
    collection
  end

REDIS error:

2024-04-17 13:04:52 [NOTICE] [configure] 4750 configuration steps out of 5052 steps complete.
2024-04-17 13:05:25 [ERROR ] [configure] Systemd start for redis failed!
2024-04-17 13:05:25 [ERROR ] [configure] journalctl log for redis:
2024-04-17 13:05:25 [ERROR ] [configure] – Logs begin at Fri 2024-01-19 17:37:09 CET, end at Wed 2024-04-17 13:05:25 CEST. –
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: Starting Redis persistent key-value database…
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Failed with result ‘exit-code’.
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: Failed to start Redis persistent key-value database.
2024-04-17 13:05:25 [ERROR ] [configure] /Stage[main]/Redis::Service/Service[redis]/ensure: change from ‘stopped’ to ‘running’ failed: Systemd start for redis failed!
2024-04-17 13:05:25 [ERROR ] [configure] journalctl log for redis:
2024-04-17 13:05:25 [ERROR ] [configure] – Logs begin at Fri 2024-01-19 17:37:09 CET, end at Wed 2024-04-17 13:05:25 CEST. –
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: Starting Redis persistent key-value database…
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Failed with result ‘exit-code’.
2024-04-17 13:05:25 [ERROR ] [configure] Apr 17 13:05:25 foreman.com systemd[1]: Failed to start Redis persistent key-value database.
2024-04-17 13:05:25 [NOTICE] [configure] 5000 configuration steps out of 5052 steps complete.
2024-04-17 13:05:36 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Service resource ‘redis’ failed. Logs:
/Service[redis]
Starting to evaluate the resource (4907 of 5052)
Evaluated in 0.25 seconds
/Stage[main]/Redis::Service/Service[redis]/ensure
change from ‘stopped’ to ‘running’ failed: Systemd start for redis failed!
journalctl log for redis:
– Logs begin at Fri 2024-01-19 17:37:09 CET, end at Wed 2024-04-17 13:05:25 CEST. –
Apr 17 13:05:25 foreman.com systemd[1]: Starting Redis persistent key-value database…
Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Apr 17 13:05:25 foreman.com systemd[1]: redis.service: Failed with result ‘exit-code’.
Apr 17 13:05:25 foreman.com systemd[1]: Failed to start Redis persistent key-value database.

After reboot foreman-installer has finished successful.
Thank you for your help.

1 Like