Issue #18053 has been updated by Gerard Hickey.

As I stated when I created the bug, the systems that Puppet is executing on are 
behind firewalls and are unable to connect to rubygems.org. Hence the reason 
for having the internal gem repo for installing necessary gems on the systems. 

The gem source looks fine under root, but if I look at the gem source under the 
Puppet user, I see a reference to rubygems.org. But then I would not expect 
that the gem is being installed as the user puppet since puppet would not have 
write access to the directories where the gem gets installed. 

    ghickey@slc4b01c-727136:~:0$ sudo gem source
    [sudo] password for ghickey: 
    *** CURRENT SOURCES ***

    http://gemrepo.example.com/
    ghickey@slc4b01c-727136:~:0$ sudo -u puppet gem source
    *** CURRENT SOURCES ***

    http://rubygems.org/

Also, since the source attribute is being used, I would expect that value to 
override anything that is provided in the environment. 

I can also confirm that removing the specified environmental variables does not 
have an effect from the command line.

    ghickey@slc4b01c-727136:~:2$ sudo gem uninstall log4r
    Successfully uninstalled log4r-1.1.10
    ghickey@slc4b01c-727136:~:0$ unset LANG LC_ALL LC_MESSAGES LANGUAGE 
LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME
    ghickey@slc4b01c-727136:~:0$ unset HOME USER LOGNAME
    ghickey@slc4b01c-727136:ghickey:0$ sudo /usr/bin/gem install 
--include-dependencies --source http://gemrepo.example.com/ log4r
    INFO:  `gem install -y` is now default and will be removed
    INFO:  use --ignore-dependencies to install only the gems you list
    Fetching: log4r-1.1.10.gem (100%)
    Successfully installed log4r-1.1.10
    1 gem installed
    Installing ri documentation for log4r-1.1.10...
    Installing RDoc documentation for log4r-1.1.10...



----------------------------------------
Bug #18053: source attribute not honored for gem provider
https://projects.puppetlabs.com/issues/18053#change-79406

Author: Gerard Hickey
Status: Needs More Information
Priority: Normal
Assignee: Gerard Hickey
Category: package
Target version: 
Affected Puppet version: 3.0.1
Keywords: 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to