Why foreman installation is failling?

Hi All,

I have install all in one foreman 2.3.1 with below switch-to serve as CA & Puppet Server, which is installed success fully. ( fqdn of the CA & Puppet Server uatca.uatlab.com )

Server1 (FQDN uatca.uatlab.com ) foreman Installer Switch :
foreman-installer --foreman-db-manage=false --foreman-db-host=uatdb.uatlab.com --foreman-db-database=newuatdb --foreman-db-username=postgres --foreman-db-password=XXXX

I have generated the Cert also also using the command on server1

/opt/puppetlabs/bin/puppetserver ca generate --certname   forman.uatlab.com & copy this cert on server2 location  
scp -pr /etc/puppetlabs/puppet/ssl forman.uatlab.com:/etc/puppetlabs/puppet

Now I am trying to install the foreman server on another machine with below switches but its failing

Server2 ( FQDN – formanuat.uatlab.com) foreman Installer Switch :
foreman-installer --enable-foreman --enable-foreman-cli --enable-foreman-proxy --enable-foreman-plugin-bootdisk --enable-foreman-plugin-setup --no-enable-puppet --puppet-server-ca=false --puppet-server-foreman-url=https://uatca.uatlab.com --foreman-proxy-puppetca=false --foreman-proxy-puppet=false --foreman-proxy-tftp=false --foreman-proxy-foreman-base-url=https://uatca.uatlab.com --foreman-proxy-trusted-hosts=uatca.uatlab.com --foreman-proxy-oauth-consumer-key="SOME_KEY" --foreman-proxy-oauth-consumer-secret="SOME_SECRET" --foreman-proxy-bmc-ssh-powerstatus=true --foreman-proxy-dhcp-managed=true --foreman-proxy-dns-managed=true --foreman-proxy-freeipa-remove-dns=true --foreman-proxy-logs=true --foreman-proxy-manage-puppet-group=true --foreman-proxy-manage-sudoersd=true --foreman-proxy-register-in-foreman=true --foreman-proxy-ssl=true --foreman-plugin-memcache-compress=true --foreman-db-manage=false --foreman-db-host=uatdb.uatlab.com --foreman-db-database=newuatd --foreman-db-username=postgres --foreman-db-password=xxxxx

Error on the screen

2021-01-13 13:25:03 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[forman.uatlab.com]: Could not evaluate: Proxy forman.uatlab.com cannot be retrieved: unknown error (response 401)

2021-01-13 13:25:03 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[forman.uatlab.com]: Failed to call refresh: Proxy forman.uatlab.com cannot be retrieved: unknown error (response 401)

2021-01-13 13:25:03 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[forman.uatlab.com]: Proxy forman.uatlab.com cannot be retrieved: unknown error (response 401)

2021-01-13 13:25:15 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

2021-01-13 13:25:15 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

2021-01-13 13:25:27 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

2021-01-13 13:25:27 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

2021-01-13 13:25:34 [NOTICE] [configure] System configuration has finished.

2021-01-13 13:25:34 [NOTICE] [post] Executing hooks in group post

There were errors detected during install.

Please address the errors and re-run the installer to ensure the system is properly configured.

Failing to do so is likely to result in broken functionality.

The full log is at /var/log/foreman-installer/foreman.log

2021-01-13 13:25:34 [NOTICE] [post] All hooks in group post finished

Can someone please suggest where I am going wrong

Thanks

I did some reformatting and replaced the oauth secret and key but it was already mailed out to some users so I’d recommend treating those as leaked.

HTTP 401 means it failed to authorize. Since registration happens using oauth credentials, that must be wrong.

I also wonder why you install Foreman on both server1 and server2. You don’t need to run Foreman on the PuppetCA server. In my own setup I have puppet.example.com running Puppet Server, PuppetDB and PostgreSQL (for PuppetDB) and Foreman Proxy. Then on foreman.example.com there’s Foreman with PostgreSQL without a Foreman Proxy. It looks like you want a similar setup.

1 Like

Thanks for your reply ekohl…

So these oauth credentials need to be used from its own machine genetared by foreman-installer?

I wanted to have active /passive setup–
Hence need to build as below but i dont know the exact foreman-installer flags

1- Two Server for foreman ( without puppet master with CA )
2- Two server puppet master with CA
3- Two server for DNS/DHCP/TFTP
4- Two server for Postgres

Thanks