Project

General

Profile

Bug #28902

Foreman 2.0 nightly installation fails on RHEL-7.7

Added by Vladimir Sedmik 8 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
foreman-installer script
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

When installing F20 nightly on RHEL-7.7 the installer fails due to wrong selinux context of /var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf which prevents postgres from being started. Restoring the context manually helps.

[root@dhcp-2-111 ~]# foreman-installer -v
...
[ INFO 2020-01-30T04:28:24 verbose]  Concat[05-foreman-ssl.conf]: Scheduling refresh of Class[Apache::Service]
[ INFO 2020-01-30T04:28:24 verbose]  Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::begin]
[ INFO 2020-01-30T04:28:24 verbose]  Class[Postgresql::Server::Service]: Scheduling refresh of Service[postgresqld]
[ INFO 2020-01-30T04:28:24 verbose]  Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::end]
[ WARN 2020-01-30T04:28:24 verbose]  /Stage[main]/Postgresql::Server::Service/Anchor[postgresql::server::service::begin]: Triggered 'refresh' from 1 event
[ERROR 2020-01-30T04:28:25 verbose]  Systemd start for postgresql failed!
[ERROR 2020-01-30T04:28:25 verbose] journalctl log for postgresql:
[ERROR 2020-01-30T04:28:25 verbose] -- Logs begin at Thu 2020-01-30 03:48:52 EST, end at Thu 2020-01-30 04:28:25 EST. --
[ERROR 2020-01-30T04:28:25 verbose] Jan 30 04:28:25 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: Starting PostgreSQL database server...
[ERROR 2020-01-30T04:28:25 verbose] Jan 30 04:28:25 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: postgresql.service: main process exited, code=exited, status=2/INVALIDARGUMENT
[ERROR 2020-01-30T04:28:25 verbose] Jan 30 04:28:25 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: Failed to start PostgreSQL database server.
[ERROR 2020-01-30T04:28:25 verbose] Jan 30 04:28:25 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: Unit postgresql.service entered failed state.
[ERROR 2020-01-30T04:28:25 verbose] Jan 30 04:28:25 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: postgresql.service failed.
...

[root@dhcp-2-111 ~]# journalctl -xe
...
-- Unit postgresql.service has begun starting up.
Jan 30 04:38:31 dhcp-2-111.vms.sat.rdu2.redhat.com sh[5922]: postmaster: could not access the server configuration file "/var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf": Permission denied
Jan 30 04:38:31 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: postgresql.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 30 04:38:31 dhcp-2-111.vms.sat.rdu2.redhat.com systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed

[root@dhcp-2-111 ~]# ls -lZ /var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf
-rw-------. postgres postgres system_u:object_r:var_t:s0       /var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf

[root@dhcp-2-111 ~]# chcon -t postgresql_db_t /var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf
[root@dhcp-2-111 ~]# systemctl restart postgresql
[root@dhcp-2-111 ~]# systemctl status postgresql
‚óŹ postgresql.service - PostgreSQL database server
   Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-01-30 05:16:13 EST; 3min 9s ago

Related issues

Related to Installer - Feature #28697: Upgrade to Postgresql 12Closed
Related to Installer - Bug #28903: Foreman 2.0 nightly installer shows errors when a package can't be installed but doesn't failClosed

History

#1 Updated by Ewoud Kohl van Wijngaarden 8 months ago

  • Description updated (diff)

#2 Updated by Ewoud Kohl van Wijngaarden 8 months ago

#3 Updated by Ewoud Kohl van Wijngaarden 8 months ago

  • Related to Bug #28903: Foreman 2.0 nightly installer shows errors when a package can't be installed but doesn't fail added

#4 Updated by Tomer Brisker 8 months ago

  • Project changed from Installer to SELinux

#5 Updated by Ewoud Kohl van Wijngaarden 8 months ago

  • Target version set to 2.0.0
  • Category set to foreman-installer script
  • Project changed from SELinux to Installer

The root cause of this is that the PostgreSQL 12 and Redis 5 SCLs are not available. Then #28903 further complicates this by continuing to execute.

The user is expected to configure their repositories. Typically this can be done by enabling rhel-server-rhscl-7-rpms.

#6 Updated by Ewoud Kohl van Wijngaarden 6 months ago

  • Target version deleted (2.0.0)
  • Status changed from New to Closed

Since #28903 is now fixed and the manual tells the user to install the SCL repos on RHEL, this can be considered done.

Also available in: Atom PDF