Foreman-installer tries to install RedHat packages for postgres on OS where these are not fully available

Problem:
foreman-installer tries to install RedHat packages for postgres on OS where these are not fully available

[ERROR 2020-04-27T15:45:26 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run'
[ERROR 2020-04-27T15:45:26 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
[ERROR 2020-04-27T15:45:26 main] /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
[ERROR 2020-04-27T15:45:26 main]  /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install rh-postgresql12-postgresql-server-syspaths' returned 1: Error: rh-postgresql12-postgresql-server-syspaths conflicts with postgresql12-server-12.2-2PGDG.rhel7.x86_64
[ERROR 2020-04-27T15:45:26 main]  You could try using --skip-broken to work around the problem
[ERROR 2020-04-27T15:45:26 main]  You could try running: rpm -Va --nofiles --nodigest
[DEBUG 2020-04-27T15:45:26 main] Cleaning /tmp/kafo_installation20200427-3196-1oix79z
[DEBUG 2020-04-27T15:45:26 main] Cleaning /tmp/kafo_installation20200427-3196-1w7tcd9
[DEBUG 2020-04-27T15:45:26 main] Cleaning /tmp/default_values.yaml
[ INFO 2020-04-27T15:45:26 main] Installer finished in 734.027513748 seconds

Expected outcome:
Installer taking already installed postgresql database, not trying to install a version not available for CentOS.

Foreman and Proxy versions:

foreman-2.0.0-1.el7.noarch
foreman-cli-2.0.0-1.el7.noarch
foreman-debug-2.0.0-1.el7.noarch
foreman-dynflow-sidekiq-2.0.0-1.el7.noarch
foreman-installer-2.0.0-1.el7.noarch
foreman-postgresql-2.0.0-1.el7.noarch
foreman-proxy-2.0.0-1.el7.noarch
foreman-release-2.0.0-1.el7.noarch
foreman-release-scl-7-2.el7.noarch
foreman-selinux-2.0.0-1.el7.noarch
rubygem-foreman_maintain-0.6.2-1.el7.noarch
tfm-rubygem-hammer_cli_foreman-2.0.2-1.el7.noarch
foreman-postgresql-2.0.0-1.el7.noarch
postgresql12-12.2-2PGDG.rhel7.x86_64
postgresql12-contrib-12.2-2PGDG.rhel7.x86_64
postgresql12-devel-12.2-2PGDG.rhel7.x86_64
postgresql12-libs-12.2-2PGDG.rhel7.x86_64
postgresql12-llvmjit-12.2-2PGDG.rhel7.x86_64
postgresql12-plperl-12.2-2PGDG.rhel7.x86_64
postgresql12-plpython-12.2-2PGDG.rhel7.x86_64
postgresql12-plpython3-12.2-2PGDG.rhel7.x86_64
postgresql12-server-12.2-2PGDG.rhel7.x86_64

Foreman and Proxy plugin versions:

Distribution and version:

CentOS Linux release 7.7.1908 (Core)
Derived from Red Hat Enterprise Linux 7.7 (Source)

Other relevant data:

I am curious, was this a new install or an upgrade? (asking as I have an existing installation and am considering updating to katello 3.15 from 3.14).

You can overcome this problem by giving foreman-installer --foreman-db-manage=false while installing. Seems to work. At least while doing a fresh install.

Having the same problem but doing an upgrade from 3.14. Running on Centos7 with postgres installed from the pg repos but the upgrade wants 12. I guess I could upgrade to 12 then do the katello upgrade but I’m surprised there’s no mention of this in the release notes

Maybe that’s skipped because it’s part of the basic Foreman release. Perhaps the Katello release notes should state that the Foreman release notes also apply.

For what it’s worth, the next release will introduce a PostgreSQL extension and by default we only build it for the Red Hat SCL. If you use external packages, you need to make sure the extension is available. We’ve also seen incompatibilities in with Pulp 3 where postgresql-python3 was built different. See Katello 3.15 upgrade failure with "python3-django-admin migrate --noinput" as well.

added the centos software collections and got passed this error thanks.

Now I have more woes!!

I seem to be having a simular problem, upgrade from Foreman-Katello 3.14 to 3.15

Upgrade Step: Running installer…
rh-postgresql12-postgresql-syspaths conflicts with postgresql10-10.13-1PGDG.rhel7.x86_64
rh-postgresql12-postgresql-syspaths conflicts with postgresql96-9.6.18-1PGDG.rhel7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigestThis text will be hidden
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:297:in `execute’

You said “added the centos software collections” ← Could you give some in-site?

I attempted to disable the RedHat repo that it was polling the rh-postgresql12-postgresql-server-syspaths from to see if I could get it to use the CentOS Software Collections.

]# yum provides rh-postgresql12
rh-postgresql12-3.4-1.el7.x86_64 : Package that installs rh-postgresql12
Repo : centos-sclo-rh

But now it just gives me an error that it can’t install it while running the foreman upgrade.

‘present’ failed: Execution of ‘/bin/yum -d 0 -e 0 -y install rh-postgresql12-postgresql-server-syspaths’ returned 1: Error: Nothing to do

So basically it seems that It is trying to install something that has a conflict with my current postgres instance but I can’t remove my postgres instance or the installer wont run.

@tps800 It does seem like that only works on new installs. I attempted it with the upgrade with the same results I was experiencing.

> [root@satellite]# foreman-installer --scenario katello --upgrade  --foreman-db-manage=false
> puppet-agent-oauth-0.5.1-3.el7.noarch
> Upgrading, to monitor the progress on all related services, please do:
>   foreman-tail | tee upgrade-$(date +%Y-%m-%d-%H%M).log
> Upgrade Step: stop_services...
> Running Stop Services
> ================================================================================
> Check if command is run as root user:                                 [OK]
> --------------------------------------------------------------------------------
> Stop applicable services: 
> Stopping the following service(s):
> rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, rh-redis5-redis, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, tomcat, dynflow-sidekiq@orchestrator, httpd, puppetserver, dynflow-sidekiq@worker, dynflow-sidekiq@worker-hosts-queue, foreman-proxy
> | All services stopped                                                [OK]      
> --------------------------------------------------------------------------------
> 
> foreman-maintain service stop finished successfully!
> Upgrade Step: Running installer...
>  Execution of '/bin/yum -d 0 -e 0 -y install rh-postgresql12-postgresql-syspaths' returned 1: Error: Nothing to do

Update:

After restoring to snapshot, I removed all Postgres versions besides 9.2 Which allowed the installer to move past this error.

Since this happened yesterday my error has changed which has lead me to this document.