While installing or upgrading Red Hat Satellite 6, katello-installer fails with error "/usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]"
Environment
- Red Hat Satellite 6.x
katello-installer/satellite-installer
Issue
- While installing Red Hat Satellite v 6, the installer fails with the error below:
# satellite-installer # or katello-installer before 6.2
.
.
/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
Installing Done [100%] [.....................................................................]
Something went wrong! Check the log for ERROR-level output
The full log is at /var/log/katello-installer/katello-installer.log
- During Satellite Server minor upgrade from v.6.2.8 to v.6.2.9, fails with below error :
[DEBUG 2017-05-10 15:04:54 main] /Stage[main]/Certs::Candlepin/Exec[import client certificate into Candlepin keystore]/unless: keytool error: java.lang.Exception: Alias <katello-default-ca> does not exist
[ WARN 2017-05-10 15:05:13 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Net::HTTPFatalError: 502 "Proxy Error ( Forefront TMG denied the specified Uniform Resource Locator (URL). )"
[ERROR 2017-05-10 15:05:13 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
[ERROR 2017-05-10 15:05:13 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
[ INFO 2017-05-10 15:05:13 main] /usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:106:in `fail'
[ERROR 2017-05-10 15:05:35 main] Upgrade failed during the installation phase. Fix the error and re-run the upgrade.
- Satellite Installer for v.6.3.x fails at
foreman-rake-db:seedstep with below error:
[ INFO 2018-07-18 08:36:31 main] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[satellite.example.com]: Starting to evaluate the resource
[DEBUG 2018-07-18 08:36:31 main] Foreman_smartproxy[satellite.example.com](provider=rest_v3): Making get request to https://satellite.example.com/api/v2/smart_proxies?search=name=%22satellite.example.com%22
:
:
[DEBUG 2018-07-18 08:36:31 main] The environment variable HTTP_PROXY is discouraged. Use http_proxy.
:
:
[ERROR 2018-07-18 08:37:51 main] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[satellite.example.com]: Could not evaluate: Exception 500 "Internal Server Error" in get request to: https://satellite.example.com/api/v2/smart_proxies?search=name=%22satellite.example.com%22
Resolution
-
Ensure the fully qualified (FQDN) hostname contains only letters, numbers, dots (
.), and dashes (-). -
Ensure the hostname consists of at least 3 components (like
satellite.example.com). -
Refer to RHEL 6 and RHEL 7 to set the hostname for RHEL 6 and RHEL 7 respectively.
-
In case of a static IP address with no DNS, ensure
/etc/hostscontains the FQDN hostname in the first position, for example:
192.168.1.1 satellite.example.com satellite
- Note that if changing the hostname at this stage of deployment, first ensure that you can successfully run these pings:
ping -c1 localhost
ping -c1 `hostname -s` # my_system
ping -c1 `hostname -f` # my_system.domain.com
- If the environment variables for the proxy is enable then try to disable the environment variables and re-run the satellite-installer with the correct proxy information
# unset http_proxy
# unset https_proxy
# satellite-installer --scenario satellite --katello-proxy-url=http://proxy.example.com --katello-proxy-port=3128 --katello-proxy-username=user1 --katello-proxy-password=changeme --upgrade
- Note For the satellite-installer, 3128 is just for reference, and should change the proxy URL/Port/Username/Password/ according to environment.
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
There can be multiple reasons for this error. Below are the possible causes.
- Fully qualified hostname that either:
- contains invalid characters (like underscore) - see relevant documentation This content is not included.bugzilla 1171697
- has two components only (e.g.
satellite.com) - see relevant This content is not included.bugzilla 1170790
- The environment variables for the proxy is enabled over the Satellite Server
- The reason for disabling the Proxy variable, is during the upgrade the Satellite URL calls are made, which is going through Proxy as an inbound request from external world, which seems to blocked or not allowed causing the installer to fail.
- When un-setting the proxy, the requests are all internal and it worked without any issues.
To identify the particular failure reason (different from the two above), please open a new support case and provide:
- sosreport
- foreman-debug
- output of command
foreman-rake db:seed --trace
Diagnostic Steps
- Error message in /var/log/foreman-installer/satellite.log while running katello-installer in debug mode:
[ INFO 2014-07-28 02:05:20 verbose] Class[Certs::Pulp_parent]: Scheduling refresh of Class[Pulp]
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: rake aborted!
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Task f3e0e49b-e2df-42cd-ace7-f4e444f282cf: RestClient::InternalServerError: 500 Internal Server Error
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns:
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Tasks: TOP => db:seed
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: (See full trace by running task with --trace)
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/05-architectures.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/07-config_templates.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/11-permissions.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/11-roles.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb
[ WARN 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Seeding /usr/share/foreman/db/seeds.d/12-auth_sources.rb
[ERROR 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
[ERROR 2014-07-28 02:05:53 verbose] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
- Confirm ownership and permissions of the files below. Correct them as needed.
# ls -l /usr/share/tomcat/conf/keystore
lrwxrwxrwx. 1 tomcat foreman 25 Sep 11 18:12 /usr/share/tomcat/conf/keystore -> /etc/pki/katello/keystore
# ls -l /etc/pki/katello/keystore
-rw-r--r--. 1 root root 2954 Sep 11 18:12 /etc/pki/katello/keystore
# ls -l /etc/foreman-proxy/ssl_cert.pem
-rw-r--r--. 1 root root 5579 Sep 11 18:11 /etc/foreman-proxy/ssl_cert.pem
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.