Bug 1030873 - Error occurs during git push of rails quick start
Error occurs during git push of rails quick start
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
2.0.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: John W. Lamb
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-15 05:13 EST by Gaoyun Pei
Modified: 2017-03-08 12 EST (History)
5 users (show)

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

  None (edit)
Description Gaoyun Pei 2013-11-15 05:13:34 EST
Description of problem:
After making some changes in the git repo of rails app, an error leads to rake aborted during the git push.

Version-Release number of selected component (if applicable):
2.0/2013-11-14.3

How reproducible:
always

Steps to Reproduce:
1.create a rails quick-start

rhc app create rails ruby-1.9 mysql-5.1 --from-code=git://github.com/openshift/rails-example.git

2.make changes in the git repo of rails app, git push the changes

[root@dhcp-8-133 rails]# git push 
[master ab33243] update
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bb
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 248 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Stopping MySQL cartridge
remote: Stopping Ruby cartridge
remote: [Fri Nov 15 04:22:10 2013] [warn] PassEnv variable RAILS_DB was undefined
remote: Waiting for stop to finish
remote: Saving away previously bundled RubyGems
remote: Building git ref 'master', commit ab33243
remote: Building Ruby cartridge
remote: Restoring previously bundled RubyGems (note: you can commit .openshift/markers/force_clean_build at the root of your repo to force a clean bundle)
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Using rake (10.0.3) 
remote: Using i18n (0.6.1) 
remote: Using multi_json (1.7.1) 
remote: Using activesupport (3.2.13) 
remote: Using builder (3.0.4) 
remote: Using activemodel (3.2.13) 
remote: Using erubis (2.7.0) 
remote: Using journey (1.0.4) 
remote: Using rack (1.4.5) 
remote: Using rack-cache (1.2) 
remote: Using rack-test (0.6.2) 
remote: Using hike (1.2.1) 
remote: Using tilt (1.3.6) 
remote: Using sprockets (2.2.2) 
remote: Using actionpack (3.2.13) 
remote: Using mime-types (1.21) 
remote: Using polyglot (0.3.3) 
remote: Using treetop (1.4.12) 
remote: Using mail (2.5.3) 
remote: Using actionmailer (3.2.13) 
remote: Using arel (3.0.2) 
remote: Using tzinfo (0.3.37) 
remote: Using activerecord (3.2.13) 
remote: Using activeresource (3.2.13) 
remote: Using coffee-script-source (1.6.1) 
remote: Using execjs (1.4.0) 
remote: Using coffee-script (2.2.0) 
remote: Using rack-ssl (1.3.3) 
remote: Using json (1.7.7) 
remote: Using rdoc (3.12.2) 
remote: Using thor (0.14.6) 
remote: Using railties (3.2.13) 
remote: Using coffee-rails (3.2.2) 
remote: Using jquery-rails (2.2.1) 
remote: Using minitest (4.6.2) 
remote: Using mysql2 (0.3.11) 
remote: Using pg (0.17.0) 
remote: Using bundler (1.1.4) 
remote: Using rails (3.2.13) 
remote: Using sass (3.2.7) 
remote: Using sass-rails (3.2.6) 
remote: Using sqlite3 (1.3.7) 
remote: Using uglifier (1.3.0) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Preparing build for deployment
remote: Deployment id is daaf77ca
remote: Activating deployment
remote: Starting MySQL cartridge
remote: rake aborted!
remote: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/config/application.rb:7:in `<top (required)>'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/Rakefile:5:in `require'
remote: /var/lib/openshift/5285e64a5bd223d41c000182/app-root/runtime/repo/Rakefile:5:in `<top (required)>'
remote: (See full trace by running task with --trace)
remote: Starting Ruby cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5285e64a5bd223d41c000182@rails-oooo.ose-1114.com.cn/~/git/rails.git/
   1bda36c..ab33243  master -> master

Actual results:

Expected results:
There's no errors

Additional info:
This action works well on devenv_4038.
Comment 2 Dave Neary 2014-02-20 04:44:09 EST
I am also seeing this issue.

Dave.
Comment 3 Johnny Liu 2014-03-10 07:24:14 EDT
After install nodejs.x86_64, libuv.x86_64 andhttp-parser.x86_64 from epel, this issue disappeared. Seem like ose need ship these packages into openshift channel.
Comment 4 John W. Lamb 2014-03-18 11:31:06 EDT
mfojtik@redhat.com is looking into how to make the quickstart detect and use the nodejs010 scl packages for the unmet dependencies mentioned in comment 3.
Comment 7 openshift-github-bot 2014-03-24 14:04:55 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/608c94857d26dd3242928c91fd30097b3775896b
Bug 1030873 - Fix the there is no system NodeJS installed which is required for assets compilation
Comment 9 Gaoyun Pei 2014-03-25 02:20:23 EDT
Still get the same error when testing on 2.1/2014-03-24.2 puddle.

Steps:
1. rhc app create railsapp ruby-1.9
2. rhc cartridge add -a railsapp -c mysql-5.5
3. cd railsapp
   git remote add upstream -m master git://github.com/openshift/rails-example.git
   git pull -s recursive -X theirs upstream master
4. git push

[root@broker railsapp]# git push
Counting objects: 582, done.
Compressing objects: 100% (312/312), done.
Writing objects: 100% (572/572), 174.85 KiB, done.
Total 572 (delta 239), reused 559 (delta 231)
remote: Stopping MySQL 5.5 cartridge
remote: Stopping Ruby cartridge
remote: httpd: Could not reliably determine the server's fully qualified domain name, using node2.ose-201403214.com.cn for ServerName
remote: Waiting for stop to finish
remote: Building git ref 'master', commit d74f774
remote: Building Ruby cartridge
remote: bundle install --deployment --path ./app-root/repo/vendor/bundle
remote: NOTE: You can prevent installing certain Gemfile group using: rhc env set BUNDLE_WITHOUT=groupname
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching gem metadata from https://rubygems.org/..
remote: Installing rake (10.1.0) 
remote: Installing i18n (0.6.9) 
remote: Installing multi_json (1.8.2) 
remote: Installing activesupport (3.2.16) 
remote: Installing builder (3.0.4) 
remote: Installing activemodel (3.2.16) 
remote: Installing erubis (2.7.0) 
remote: Installing journey (1.0.4) 
remote: Installing rack (1.4.5) 
remote: Installing rack-cache (1.2) 
remote: Installing rack-test (0.6.2) 
remote: Installing hike (1.2.3) 
remote: Installing tilt (1.4.1) 
remote: Installing sprockets (2.2.2) 
remote: Installing actionpack (3.2.16) 
remote: Installing mime-types (1.25.1) 
remote: Installing polyglot (0.3.3) 
remote: Installing treetop (1.4.15) 
remote: Installing mail (2.5.4) 
remote: Installing actionmailer (3.2.16) 
remote: Installing arel (3.0.3) 
remote: Installing tzinfo (0.3.38) 
remote: Installing activerecord (3.2.16) 
remote: Installing activeresource (3.2.16) 
remote: Installing coffee-script-source (1.6.3) 
remote: Installing execjs (2.0.2) 
remote: Installing coffee-script (2.2.0) 
remote: Installing rack-ssl (1.3.3) 
remote: Installing json (1.8.1) with native extensions 
remote: Installing rdoc (3.12.2) 
remote: Installing thor (0.14.6) 
remote: Installing railties (3.2.16) 
remote: Installing coffee-rails (3.2.2) 
remote: Installing jquery-rails (3.0.4) 
remote: Installing minitest (5.1.0) 
remote: Installing mysql2 (0.3.14) with native extensions 
remote: Installing pg (0.17.0) with native extensions 
remote: Using bundler (1.1.4) 
remote: Installing rails (3.2.16) 
remote: Installing sass (3.2.12) 
remote: Installing sass-rails (3.2.6) 
remote: Installing sqlite3 (1.3.8) with native extensions 
remote: Installing uglifier (2.3.2) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote: 
remote: <= 1.8.6 : unsupported
remote:  = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote:  = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Preparing build for deployment
remote: Deployment id is f5c8fcb2
remote: Activating deployment
remote: Starting MySQL 5.5 cartridge
remote: rake aborted!
remote: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/config/application.rb:7:in `<top (required)>'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/Rakefile:5:in `require'
remote: /var/lib/openshift/5330f649cfb77f5db400002e/app-root/runtime/repo/Rakefile:5:in `<top (required)>'
remote: (See full trace by running task with --trace)
remote: Compilation of assets is disabled or assets not detected.
remote: exec rake db:migrate RAILS_ENV=production
remote: Starting Ruby cartridge
remote: httpd: Could not reliably determine the server's fully qualified domain name, using node2.ose-201403214.com.cn for ServerName
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5330f649cfb77f5db400002e@railsapp-123.ose-201403214.com.cn/~/git/railsapp.git/
   3bca57c..d74f774  master -> master
Comment 10 Johnny Liu 2014-03-25 10:38:30 EDT
After dig into this issue, seem like dev miss one place to wrap command with ruby_with_nodejs_context.

In ruby/lib/util, "bundle exec" will cause asset, so need wrap it.
<--snip-->
function has_assets {
  [ -f .openshift/markers/disable_asset_compilation ] && return 1

  [ ! -f Gemfile ] && return 1
  [ ! -f Rakefile ] && return 1
  ! grep " rails " Gemfile.lock >/dev/null && return 1
  ! grep " execjs " Gemfile.lock >/dev/null && return 1
  ! bundle exec "rake -T" | grep "assets:precompile" >/dev/null && return 1  
   # This line need to be wrapped. 

  return 0
}
<--snip-->



Replace it using the following line:
  ! ruby_with_nodejs_context "bundle exec \"rake -T\"" | grep "assets:precompile" >/dev/null && return 1
Comment 11 John W. Lamb 2014-03-26 11:04:46 EDT
(In reply to Johnny Liu from comment #10)
> After dig into this issue, seem like dev miss one place to wrap command with
> ruby_with_nodejs_context.
> 
> In ruby/lib/util, "bundle exec" will cause asset, so need wrap it.
> <--snip-->
> function has_assets {
>   [ -f .openshift/markers/disable_asset_compilation ] && return 1
> 
>   [ ! -f Gemfile ] && return 1
>   [ ! -f Rakefile ] && return 1
>   ! grep " rails " Gemfile.lock >/dev/null && return 1
>   ! grep " execjs " Gemfile.lock >/dev/null && return 1
>   ! bundle exec "rake -T" | grep "assets:precompile" >/dev/null && return 1  
>    # This line need to be wrapped. 
> 
>   return 0
> }
> <--snip-->
> 
> 
> 
> Replace it using the following line:
>   ! ruby_with_nodejs_context "bundle exec \"rake -T\"" | grep
> "assets:precompile" >/dev/null && return 1

Thanks, getting ready to look at this now.
Comment 12 John W. Lamb 2014-03-26 16:30:43 EDT
Should be resolved by https://github.com/openshift/origin-server/pull/5080 - tested in Enterprise and Online.
Comment 14 John W. Lamb 2014-03-27 16:21:08 EDT
This should be fixed in the most recent puddle
Comment 16 Johnny Liu 2014-03-28 07:09:53 EDT
Verified this bug with 2.1/2014-03-27.2, and PASS.

No error is seen for rails quick-start.

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