Issue #18053 has been updated by Ruth Linehan.
I think that the primary cause of this is a bug upstream in Rubygems 1.8: if you have multiple gem sources, but can't connect to one of them during a `gem install`, the install will try to connect to that source and fail, causing the whole install to fail, even if your other sources are available. See https://github.com/rubygems/rubygems/issues/101 for the GitHub issue. I think this bug has been fixed in Rubygems 2.0.0 (https://github.com/rubygems/rubygems/commit/056c533688bb20e971bd5e87f237f3fc5021bccb). `http://rubygems.org/` is hard coded as a default source in rubygems/defaults.rb. When you pass `--source <new gem source>` to the gem command, you are adding an additional source, but you still have `http://rubygems.org/` as a source. So, the result of this is that while Puppet will respect an additional source passed in as a --source to an exec'd gem command, or with the source parameter given to the gem provider, because of the bug in rubygems, if `http://rubygems.org/` can't be accessed, the command will fail. The only way for rubygems to not use `http://rubygems.org/` as a source is to have a gemrc that lists the sources you want (and that you can connect to) and NOT http://rubygems.org/. Starting in Puppet 3.0, environment variables for HOME and USER get unset when Puppet is run. As a result, when Puppet looks for a gemrc, it looks in `/.gemrc/` or `/etc/gemrc` (for the system gem configuration; for PE's rubygems this is `/opt/puppet/etc/gemrc`). ---------------------------------------- Bug #18053: source attribute not honored for gem provider https://projects.puppetlabs.com/issues/18053#change-99986 * Author: Gerard Hickey * Status: Needs More Information * Priority: Normal * Assignee: Gerard Hickey * Category: package * Target version: * Affected Puppet version: 3.0.1 * Keywords: customer * Branch: ---------------------------------------- When attempting to provide another source for a package resource using the gem provider, the install fails. Error output from 'puppet agent -tv': <pre> Error: Execution of '/usr/bin/gem install --include-dependencies --source http://<internal.gemrepo.com>/ passenger' returned 1: ERROR: Could not find a valid gem 'passenger' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ETIMEDOUT: Connection timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz) INFO: `gem install -y` is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list Error: /Stage[main]/Puppet::Master/Package[passenger]/ensure: change from absent to present failed: Execution of '/usr/bin/gem install --include-dependencies --source http://<internal.gemrepo.com>/ passenger' returned 1: ERROR: Could not find a valid gem 'passenger' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ETIMEDOUT: Connection timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz) INFO: `gem install -y` is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list Finished catalog run in 106.88 seconds ghickey@slc4b01c-69c8:rack:6$ gem source *** CURRENT SOURCES *** http://rubygems.org/ ghickey@slc4b01c-69c8:rack:0$ sudo gem install --include-dependencies --source http://<internal.gemrepo.com>/ passenger [sudo] password for ghickey: INFO: `gem install -y` is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list Fetching: fastthread-1.0.7.gem (100%) Building native extensions. This could take a while... Fetching: daemon_controller-1.1.0.gem (100%) Fetching: passenger-3.0.18.gem (100%) Successfully installed fastthread-1.0.7 Successfully installed daemon_controller-1.1.0 Successfully installed passenger-3.0.18 3 gems installed Installing ri documentation for fastthread-1.0.7... Installing ri documentation for daemon_controller-1.1.0... Installing ri documentation for passenger-3.0.18... Installing RDoc documentation for fastthread-1.0.7... Installing RDoc documentation for daemon_controller-1.1.0... Installing RDoc documentation for passenger-3.0.18... </pre> The system that produced the output is behind a firewall and can not directly connect to rubygems.org. There is an internal gem repo inside the firewall that contains mirrored gems for the purpose of distributing within the firewall. As you can see if the same command is executed from the command line, it succeeds. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
