Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 971586 - cron's PATH is not correct in v2 cart
Summary: cron's PATH is not correct in v2 cart
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
Depends On: 971527
TreeView+ depends on / blocked
Reported: 2013-06-06 20:50 UTC by Jhon Honce
Modified: 2015-05-14 23:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 971527
Last Closed: 2013-08-07 22:54:31 UTC
Target Upstream Version:

Attachments (Terms of Use)

Comment 1 Jhon Honce 2013-06-06 20:54:30 UTC
Description of problem:
(Broke out two issues into two tickets)



1) Ruby

I did not changed anything when this happens
in row:

gem 'twitter'

==> ruby-1.9/logs/iDispenser.log <==
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in report_activate_error: Could not find RubyGem twitter (>= 0) (Gem::LoadError)
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in activate
	from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in gem

>env | grep RUBY


Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 2 Hiro Asari 2013-06-07 15:47:47 UTC
I tried reproducing this bug, but so far I have been unsuccessful.

The steps I tried:
1. Create a v1 Ruby 1.9 application (the log file directory "ruby-1.9/logs" indicates that it was a v1 cart).
2. The user indicates that the application did not have Gemfile.
3. Add 'gem "twitter"' to config.ru.
4. Commit and push.

Passenger will fail with "Gem::LoadError", but the error is logged in ~/ruby-1.9/logs/error* (v1) and ~/ruby/logs/error* (v2 after migration). The user indicates that the errors were logged in ruby-1.9/logs/iDispenser.log, which I believe OpenShift does not write.

Furthermore, in all cases, the path looks like:
indicating that the process was started via Passenger.

The user's error log indicates to me that the erroneous process was not started by Passenger.

Comment 3 Hiro Asari 2013-06-10 13:53:57 UTC
The user reports that this is a custom script executed via cron.

Comment 4 Hiro Asari 2013-06-10 20:17:29 UTC
OK, so it looks like this is an issue with `cron` cartridge not setting up $PATH correctly in the v2.

For a v1 Ruby app, $PATH is set to:


while for a v2 Ruby app, it is:


Comment 5 Jhon Honce 2013-06-10 23:33:00 UTC
Yes the paths between V1 and V2 are different, all path elements containing abstract or libexec at no longer valid.

Comment 7 Xiaoli Tian 2013-07-10 02:59:45 UTC
(In reply to Hiro Asari from comment #6)
> https://github.com/openshift/origin-server/pull/2811

Hi, Hiro

Not sure if you've already known it: above pull request has not been merged yet, and this bug has been in Modified status for some time.


Comment 8 Hiro Asari 2013-07-10 05:17:45 UTC
Thank you for the reminder. Yes, I was aware. :-)

Some further discussion is necessary, so I didn't move the PR forward.

Comment 9 openshift-github-bot 2013-07-29 17:33:30 UTC
Commit pushed to master at https://github.com/openshift/origin-server

Bug 971586

Set up cron's PATH to use primary cartridge's *_PATH_ELEMENT so that
cron can use the cartridge's executables.

Comment 10 Hiro Asari 2013-07-29 17:34:47 UTC
Let's give this a shot. :-)

Comment 11 Meng Bo 2013-07-30 07:24:26 UTC
Checked on devenv_3580,

With cron script:
# cat test.sh 

echo $PATH >> $OPENSHIFT_TMP_DIR/env.log

The result as below

[ruby19-bmengdev.dev.rhcloud.com tmp]\> cat env.log 

Move bug to veified.

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