Bug 994326 - Fatal Installation Error: rake not found
Fatal Installation Error: rake not found
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer (Show other bugs)
6.0.1
Unspecified Unspecified
urgent Severity urgent (vote)
: Unspecified
: --
Assigned To: Mike McCune
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-07 00:27 EDT by Mike McCune
Modified: 2014-04-24 13:12 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)

  None (edit)
Description Mike McCune 2013-08-07 00:27:00 EDT
When running katello-configure during installation of Satellite 6 with Foreman you will receive the following error in the katello-configure log file:

30731-11:21:08 Debug: Exec[foreman_migrate_db](provider=posix): Executing '/usr/bin/ruby193-rake db:migrate --trace --verbose && touch /var/lib/foreman/foreman_db_migrate_done'
130731-11:21:08 Debug: Executing '/usr/bin/ruby193-rake db:migrate --trace --verbose && touch /var/lib/foreman/foreman_db_migrate_done'
130731-11:21:08 Error: /var/tmp/sclVlBn0j: line 8: rake: command not found

There is no known workaround without modification to the puppet manifest that we use to configure Foreman.  The results of this is that Satellite 6 can not be installed.

Will be posting a patch shortly.
Comment 1 Mike McCune 2013-08-07 00:40:06 EDT
made a modified [/usr/bin/ruby193-rake] that included output of the path and 'which rake':

#!/bin/bash

COMMAND="echo $PATH && which rake &&  rake $@"
scl enable ruby193 "$COMMAND"

when ran from normal shell you see:

# /usr/bin/ruby193-rake
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
/opt/rh/ruby193/root/usr/bin/rake
rake aborted!

I'm not familiar enough with how SCL works to know how it includes commands that are not in the shell's PATH to be found as an executable but when ran from within puppet with a simple manifest:

 exec {"test_rake":
    cwd         => "/tmp",
    environment => ["HOME=/tmp"],
    command     => "/usr/bin/ruby193-rake",
    path        => "/sbin:/usr/sbin:/bin:/usr/bin",
    user        => "root";
  }

you get:

# ruby193-puppet apply repro.pp 
Notice: /Stage[main]//Exec[test_rake]/returns: /sbin:/usr/sbin:/bin:/usr/bin
Notice: /Stage[main]//Exec[test_rake]/returns: which: no rake in (/sbin:/usr/sbin:/bin:/usr/bin)
Error: /usr/bin/ruby193-rake --help returned 1 instead of one of [0]
Error: /Stage[main]//Exec[test_rake]/returns: change from notrun to 0 failed: /usr/bin/ruby193-rake --help returned 1 instead of one of [0]
Notice: Finished catalog run in 0.55 seconds

but if ran *without* the path =? ...  it runs rake just fine:

# ruby193-puppet apply repro.pp 
Notice: /Stage[main]//Exec[test_rake]/returns: executed successfully
Notice: Finished catalog run in 0.81 seconds
[root@sat6-mdp1 ~]# vim repro.pp 
[root@sat6-mdp1 ~]# ruby193-puppet apply repro.pp 
Notice: /Stage[main]//Exec[test_rake]/returns: /opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Notice: /Stage[main]//Exec[test_rake]/returns: /opt/rh/ruby193/root/usr/bin/rake
Notice: /Stage[main]//Exec[test_rake]/returns: rake aborted!
Notice: /Stage[main]//Exec[test_rake]/returns: No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
Notice: /Stage[main]//Exec[test_rake]/returns: 
Notice: /Stage[main]//Exec[test_rake]/returns: (See full trace by running task with --trace)
Error: /usr/bin/ruby193-rake returned 1 instead of one of [0]
Error: /Stage[main]//Exec[test_rake]/returns: change from notrun to 0 failed: /usr/bin/ruby193-rake returned 1 instead of one of [0]
Notice: Finished catalog run in 0.75 seconds
Comment 3 Dominic Cleal 2013-08-07 06:54:33 EDT
I've narrowed this down to the update of scl-utils from scl-utils-20120927-2.el6.x86_64 to scl-utils-20120927-2.el6_4.6.x86_64.  Before updating my host from one to the other, I couldn't reproduce it using the example in comment #1, now I can.  I'm pretty sure this is due to the change introduced in bug #976551.

The scl tool now checks to see if the SCL is already enabled by checking the $SCLS environment variable, then doesn't run the enable script to export $PATH etc if it was already enabled.  Since we're running Puppet under the SCL (via ruby193-puppet), $SCLS is already "ruby193".  By specifying "path" in Puppet, it exports PATH and since $SCLS still contains "ruby193", the scl tool doesn't re-enable/export $PATH for the collection.

So yes, I think your fix is correct Mike, we shouldn't override $PATH.
Comment 6 Corey Welton 2013-08-07 13:52:25 EDT
QE test notes:

Install latest and greatest RHEL 6.4, then install/configure katello*

Both repo and ISO will need to be tested.
Comment 7 Corey Welton 2013-08-07 15:58:55 EDT
Additional note:  this involves foreman so of course install katello-foreman-all, etc.
Comment 8 Mike McCune 2013-08-07 18:31:34 EDT
HOTFIX:

If you wish to deploy a fix ASAP do the following:

1) Download hotfix RPMS:

# wget http://mmccune.fedorapeople.org/hotfix/994326/katello-configure-1.4.3-17.el6sat.noarch.rpm
# wget http://mmccune.fedorapeople.org/hotfix/994326/katello-configure-foreman-1.4.3-17.el6sat.noarch.rpm


2) Upgrade RPMs on your Satellite 6 host:

# rpm -Uvh katello-configure-1.4.3-17.el6sat.noarch.rpm katello-configure-foreman-1.4.3-17.el6sat.noarch.rpm

3) proceed with katello-configure as indicated in the Installation Guide
Comment 9 Corey Welton 2013-08-08 09:57:47 EDT
Verified in install from repo (cswiii) and from ISO (gkhachik). With latest RHEL packages (and specifically scl-utils), installer does not fail, and no rake "command not found" errors occur in log(s). 

QE Verified.
Comment 12 Bryan Kearney 2014-04-24 13:11:14 EDT
This was verified and delivered with MDP2. Closing it out.
Comment 13 Bryan Kearney 2014-04-24 13:12:12 EDT
This was delivered and verified with MDP2. Closing the bug.

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