Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5212

Pip package provider fails to honor HTTP proxy settings


    • Template:
    • Story Points:
    • Sprint:
      Client 2015-12-30, Client 2016-01-13, Client 2016-01-27
    • Release Notes:
      New Feature
    • Release Notes Summary:
      The pip provider formerly did not support the {{http_proxy_host}} and {{http_proxy_port}} settings when querying pypi.python.org for the latest package version for {{ensure => latest}}. This change adds that support.


      Having some trouble getting the pip package provider to work behind a http proxy.

      I know that the install_options feature for pip hasn't been backported to puppet 3.8.x, which is unfortunate (will this happen btw?), but I've found a reasonable workaround by setting a global proxy option in /etc/pip.conf (on unixy systems) - see https://pip.pypa.io/en/latest/user_guide.html#config-file. I can confirm that, once this config file is in place, manually running pip install --upgrade $pkg works via the proxy, even without environment variables being set. Trying this via puppet's native pip provider fails with the following error:

      Error: Could not get latest version: Timeout while contacting pypi.python.org: execution expired
      Error: /Package[$pkg]/ensure: change from 1.0.0 to latest failed: Could not get latest version: Timeout while contacting pypi.python.org: execution expired

      Have tried a few variations, including:

      puppet resource package $pkg ensure=latest provider=pip
      puppet resource --http_proxy_host=proxy.example.com --http_proxy_port=3128 package $pkg ensure=latest provider=pip

      Ruby is still new to me, but I think the problem is on this line: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/pip.rb#L63

      Which, according to this reference on the XMLRPC::Client class, might need to be modified to pass proxy details?

      It would be good to get this fixed in 3.8.x - I'd like to avoid dumping the native pip package provider....




            • Assignee:
              john.duarte John Duarte
              apuppetfan A Puppet Fan
              QA Contact:
              Eric Thompson
            • Votes:
              1 Vote for this issue
              6 Start watching this issue


              • Created:

                Zendesk Support