Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1135989 - Installation occasionally fails: failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0] with "Validation failed: Name has already been taken" in katello-installer.log
Installation occasionally fails: failed to call refresh: /usr/sbin/foreman-ra...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer (Show other bugs)
6.0.4
Unspecified Unspecified
unspecified Severity high (vote)
: Unspecified
: Unused
Assigned To: Ivan Necas
Elyézer Rezende
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-01 08:11 EDT by Ivan Necas
Modified: 2017-02-23 16:00 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:15:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Ivan Necas 2014-09-01 08:11:24 EDT
Version-Release number of selected component (if applicable):
katello-installer-0.0.64-1.el7sat.noarch

How reproducible:
rare

Steps to Reproduce:

yum install -y katello
katello-installer


Actual results:

[...]
[31m /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]
[0m[31m /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]
[0mNotice: /Stage[main]/Foreman::Database/Foreman::Ra: 488/489, 99%, 0.0/s, elapsed: 00:07:03
[...]
E, [2014-08-31T22:46:53.324338 #29233] ERROR -- : : 488/489, 99%, 0.0/s, elapsed: 00:12:33
[31m /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[ibm-ls22-03.rhts.eng.brq.redhat.com]: Could not evaluate: 500 Internal Server Error
[0m[32mDone                                              [0m: 489/489, 100%, 0.0/s, elapsed: 00:12:37
[32mDone                                              [0m: 489/489, 100%, 0.0/s, elapsed: 00:12:37
  [1m[31mSomething went wrong![0m Check the log for ERROR-level output
  The full log is at [1m[36m/var/log/katello-installer/katello-installer.log[0m
:: [   FAIL   ] :: Command 'katello-installer --foreman-admin-email 'root@localhost' --foreman-admin-username 'admin' --foreman-admin-password 'changeme'' (Expected 0, got 6)


Expected results:
Installer succeeds

Additional info:

The issue seems to be caused by race-condition in initializing the settings data (happen in an initializer). The httpd was sterted just before the db:seed (so that the rails environments started to be loaded at the same time, and probably started also filling the settings table: when initializing, the code first checks whether the settings are there, and if not, it creates them.

It seems the case here is two parallel processes (on from passenger, the second form db:seed) look if some settings exist (bot get an information, that the settings are not there yet), so both try to create the settings, but the second one fails on conflict, because in the meantime, the first process have already managed to save that.

Workaround:

    echo >> /etc/foreman/database.yml
    katello-installer
Comment 3 Ivan Necas 2014-09-04 07:52:57 EDT
Created redmine issue http://projects.theforeman.org/issues/7353 from this bug
Comment 5 Mike McCune 2014-09-16 14:52:36 EDT
WORKAROUND:

Clear the database.yml file:

# echo >> /etc/foreman/database.yml

Re-run the installer:

# katello-installer
Comment 6 Lukas Zapletal 2014-09-17 03:24:09 EDT
For the record, we are not clearing the yml file but rather changing it's MD5 content tag to trigger some actions in Puppet.
Comment 8 Ivan Necas 2014-11-07 08:00:08 EST
The fix should be part of https://github.com/theforeman/puppet-foreman/pull/225, but it seems we will need to go other direction (still not enough support for getting the changes in so far)
Comment 9 Bryan Kearney 2014-11-19 10:03:55 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/7353 has been closed
-------------
Ivan Necas
Applied in changeset commit:puppet-foreman|dcde67122d8151e16b905201196a764671f0d63d.
Comment 13 Jason Montleon 2015-02-05 15:36:34 EST
What is the corresponding upstream katello-installer commit?
Comment 17 Elyézer Rezende 2015-03-06 14:07:50 EST
Verified on: Satellite-6.1.0-RHEL-7-20150303.0

Steps to reproduce:

Have been installing multiple times using recent versions of Satellite 6 on both RHEL 6.6 and RHEL 7.1 and was not able to raise that error. Seems that the bug is now fixed.
Comment 18 Nick Strugnell 2015-03-23 11:43:49 EDT
Just done a fresh deploy on a fully up to date RHEL 7.1 and hit this error.
Comment 19 Bryan Kearney 2015-08-11 09:33:34 EDT
This bug is slated to be released with Satellite 6.1.
Comment 20 errata-xmlrpc 2015-08-12 01:15:44 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592

Note You need to log in before you can comment on or make changes to this bug.