Bug 1022391 - "Ruby (Rack) application could not be started" for ruby normal app and 503 error returns for ruby scalable app after deploying with dependencies
"Ruby (Rack) application could not be started" for ruby normal app and 503 er...
Status: CLOSED NOTABUG
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: Hiro Asari
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 04:12 EDT by Lei Zhang
Modified: 2015-05-14 19:31 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-24 12:29:11 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 Lei Zhang 2013-10-23 04:12:04 EDT
Description of problem:
Given one ruby normal app created(e.g.,myruby19), add Gemfile and bundle check, and then git push. After deploying, access the home page via browser,  found "Ruby (Rack) application could not be started" displays. For scalable ruby app, 503 error returns when accessing the home page after deploying with dependencies.

[rayzhang@ray Work]$ curl -I http://myruby19-chunchen.dev.rhcloud.com/
HTTP/1.0 500 Internal Server Error
Date: Wed, 23 Oct 2013 07:37:36 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 7633
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding,User-Agent
ProxyTime: D=407445
X-Cache: MISS from file01.intranet.prod.int.rdu2.redhat.com
X-Cache-Lookup: MISS from file01.intranet.prod.int.rdu2.redhat.com:8080
Via: 1.0 file01.intranet.prod.int.rdu2.redhat.com (squid/3.1.10)
Connection: keep-alive

[rayzhang@ray Work]$ curl -I http://myruby18s-chunchen.dev.rhcloud.com/
HTTP/1.0 503 Service Unavailable
Date: Wed, 23 Oct 2013 07:47:49 GMT
Cache-Control: no-cache
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding,User-Agent
ProxyTime: D=46261
X-Cache: MISS from file01.intranet.prod.int.rdu2.redhat.com
X-Cache-Lookup: MISS from file01.intranet.prod.int.rdu2.redhat.com:8080
Via: 1.0 file01.intranet.prod.int.rdu2.redhat.com (squid/3.1.10)
Connection: keep-alive


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

How reproducible:
always

Steps to Reproduce:
1.Create one ruby app
#rhc app create myruby19 ruby-1.9
2.Add Gemfile and bundle check
#cat Gemfile
source 'http://rubygems.org'
gem 'rhc'
#bundle check
[rayzhang@ray myruby18s]$ cat Gemfile.lock 
GEM
  remote: http://rubygems.org/
  specs:
    archive-tar-minitar (0.5.2)
    commander (4.1.5)
      highline (~> 1.6.11)
    highline (1.6.19)
    httpclient (2.3.4.1)
    net-ssh (2.7.0)
    open4 (1.3.0)
    rhc (1.14.7)
      archive-tar-minitar
      commander (>= 4.0)
      highline (~> 1.6.11)
      httpclient (>= 2.2)
      net-ssh (>= 2.0.11)
      open4
PLATFORMS
  ruby
DEPENDENCIES
  rhc
3. git push and access the home page via browser
#git add -A &&git commit -amp&&git push

Actual results:
"Ruby (Rack) application could not be started" for ruby normal app and 503 error returns for scalable ruby app after deploying with dependencies. 

Expected results:
Can be accessed after deploying with dependencies for ruby app

Additional info:
No error info was found during deploying:

Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 558 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Stopping Ruby cartridge
remote: [Wed Oct 23 03:04:38 2013] [warn] PassEnv variable SHELL was undefined
remote: [Wed Oct 23 03:04:38 2013] [warn] PassEnv variable USER was undefined
remote: [Wed Oct 23 03:04:38 2013] [warn] PassEnv variable LOGNAME was undefined
remote: Waiting for stop to finish
remote: Syncing git content to other proxy gears
remote: Building git ref 'master', commit 5967469
remote: Building Ruby cartridge
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching source index for http://rubygems.org/
remote: which: no sudo in (/var/lib/openshift/5267749feee51f3750000614/.gem/bin:/var/lib/openshift/5267749feee51f3750000614/haproxy/usr/bin:/bin:/usr/bin:/usr/sbin)
remote: Installing archive-tar-minitar (0.5.2) 
remote: Installing highline (1.6.19) 
remote: Installing commander (4.1.5) 
remote: Installing httpclient (2.3.4.1) 
remote: Installing net-ssh (2.7.0) 
remote: Installing open4 (1.3.0) 
remote: Installing rhc (0.71.2) 
remote: Using bundler (1.0.21) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Preparing build for deployment
remote: Prepared deployment artifacts in /var/lib/openshift/5267749feee51f3750000614/app-deployments/2013-10-23_03-04-40.238
remote: Deployment id is 7ae02396
remote: Activating deployment
remote: Starting Ruby cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5267749feee51f3750000614@myruby18s-chunchen.dev.rhcloud.com/~/git/myruby18s.git/
   eefe7af..5967469  master -> master
Comment 1 Paul Morie 2013-10-23 09:27:55 EDT
Please retest on the latest libra_ami; I cannot recreate this issue in my devenv.
Comment 2 Lei Zhang 2013-10-24 03:58:57 EDT
devenv_3937, still can reproduce this issue. when remote execute "Fetching source index for http://rubygems.org/", it took long time about 3~4 minutes, and no error happened. But after git push, 503 error return when access the app.


Step 1
#rhc app create myruby18s ruby-1.8 -s
 
Step 2
Create Gemfile and bundle install

[rayzhang@ray myruby18s]$ cat Gemfile
source 'http://rubygems.org'
gem 'rhc'

[rayzhang@ray myruby18s]$ bundle install
Fetching gem metadata from http://rubygems.org/......
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system: 
Using archive-tar-minitar (0.5.2) 
Using highline (1.6.20) 
Using commander (4.1.5) 
Using httpclient (2.3.4.1) 
Using net-ssh (2.7.0) 
Using net-ssh-gateway (1.2.0) 
Using net-ssh-multi (1.2.0) 
Using open4 (1.3.0) 
Using rhc (1.15.6) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

Step 3
#sed -i "s/rhc \(.*\)/rhc \(0.71.2\)/g" Gemfile.lock

Step 4
#git add -A &&git commit -amp&&git push
[rayzhang@ray myruby18s]$ git add -A &&git commit -amp&&git push
[master 5cdf9a7] p
 2 files changed, 31 insertions(+)
 create mode 100644 Gemfile
 create mode 100644 Gemfile.lock
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 594 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Stopping Ruby cartridge
remote: [Thu Oct 24 03:42:01 2013] [warn] PassEnv variable SHELL was undefined
remote: [Thu Oct 24 03:42:01 2013] [warn] PassEnv variable USER was undefined
remote: [Thu Oct 24 03:42:01 2013] [warn] PassEnv variable LOGNAME was undefined
remote: Syncing git content to other proxy gears
remote: Building git ref 'master', commit 5cdf9a7
remote: Building Ruby cartridge
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching source index for http://rubygems.org/
remote: which: no sudo in (/var/lib/openshift/5268ce76fa7bab8715000149/.gem/bin:/var/lib/openshift/5268ce76fa7bab8715000149/haproxy/usr/bin:/bin:/usr/bin:/usr/sbin)
remote: Installing archive-tar-minitar (0.5.2) 
remote: Installing highline (1.6.20) 
remote: Installing commander (4.1.5) 
remote: Installing httpclient (2.3.4.1) 
remote: Installing net-ssh (2.7.0) 
remote: Installing net-ssh-gateway (1.2.0) 
remote: Installing net-ssh-multi (1.2.0) 
remote: Installing open4 (1.3.0) 
remote: Installing rhc (0.71.2) 
remote: Using bundler (1.0.21) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Preparing build for deployment
remote: Deployment id is 9700fa17
remote: Activating deployment
remote: Starting Ruby cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5268ce76fa7bab8715000149@myruby18s-chunchen.dev.rhcloud.com/~/git/myruby18s.git/
   321f793..5cdf9a7  master -> master

Step 5
#access the app 
[rayzhang@ray Work]$ curl http://myruby18s-chunchen.dev.rhcloud.com/
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
Comment 3 Hiro Asari 2013-10-24 12:29:11 EDT
The template application does not contain Gemfile and it works, right? If you add your own Gemfile, it is your responsibility to ensure that the application works with bundler.

Your Gemfile does not contain 'rack', which the template application requires. So when the application starts with bundler, it fails.

Add the following line to your Gemfile, and repeat the procedure. It should work.

gem 'rack'

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