Bug 1029404

Summary: Fail to install gems for ruby-1.8 apps due to "remote: Too many redirects " error during deployments
Product: OpenShift Online Reporter: Zhe Wang <zhewang>
Component: ContainersAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: mfojtik, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:29:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zhe Wang 2013-11-12 11:00:23 UTC
Description of problem:
Given a ruby-1.8 app, when trying to install some gem, it almost always fails because of the error: 

remote: Fetching source index from http://rubygems.org/
remote: Too many redirects 

On the other hand, there is no such problem for ruby-1.9 apps.

I reserved my ruby-1.8 app in INT (rb8-zwint.int.rhcloud.com) for your debugging.

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

How reproducible:
almost always(>90%)

Steps to Reproduce:
1. create a ruby-1.8
2. try to install a ref gem with the following Gemfile and Gemfile.lock
<----Gemfile---->

source 'http://rubygems.org'

gem 'ref'
gem 'rack'
gem 'thread-dump'

<--------------->

<----Gemfile.lock---->

GEM
  remote: http://rubygems.org/
  specs:
    rack (1.5.2)
    ref (1.0.5)
    thread-dump (0.0.5)

PLATFORMS
  ruby

DEPENDENCIES
  rack
  ref
  thread-dump


<-------------------->

3. push the files and trigger a build


Actual results:
The build fails with the error:

remote: Fetching source index from http://rubygems.org/
remote: Too many redirects
remote: An error occurred executing 'gear postreceive' (exit code: 17)
remote: Error message: Failed to execute: 'control build' for /var/lib/openshift/5281fe6f03ef6422b60001c5/ruby
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://5281fe6f03ef6422b60001c5.rhcloud.com/~/git/rb8.git/
   610d16a..2e72643  master -> master

And this is the msg in the error log (ruby/logs/error_log*):

/usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:105:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
        from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:105:in `new'
        from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:105:in `connect'
        from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:86:in `socket'
        from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:90:in `head_request'
        from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21/helper-scripts/prespawn:145


Expected results:
Installing gems for ruby-1.8 apps should succeed.

Additional info:

Comment 1 Michal Fojtik 2013-11-12 11:18:37 UTC
Zhe Wang: The source should be 'https://rubygems.org' as that is now preffered in bundler world.

Also there was a bug in rubygem-bundler that was fixed recently:

https://bugzilla.redhat.com/show_bug.cgi?id=1025713

Can you please try to reproduce this bug on latest devenv?

Comment 2 Zhe Wang 2013-11-13 01:49:27 UTC
Verified this bug in devenv_4025

After changing the source to https://rubygems.org , the installation succeeded.

remote: Fetching gem metadata from https://rubygems.org/..........
remote: Installing rack (1.5.2) 
remote: Installing ref (1.0.5) 
remote: Installing thread-dump (0.0.5) 
remote: Using bundler (1.3.5) 
remote: Your bundle is complete!