Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect "no_proxy" environment variable #51

Open
majewsky opened this issue May 11, 2015 · 0 comments
Open

respect "no_proxy" environment variable #51

majewsky opened this issue May 11, 2015 · 0 comments

Comments

@majewsky
Copy link

We are behind a corporate proxy and use a custom default source for our Chef cookbooks which is reachable without the proxy. My setup looks something like this:

$ export http_proxy=http;//proxy.$companyname.corp:$port
$ export no_proxy=.corp,localhost

$ cat Cheffile
site "http://supermarket.$companyname.corp/api/v1"
cookbook "myapplication"

In fact, I'm setting a bunch of additional environment variables to the same values, since some programs recognize upper-case env variables only, some check for a https proxy, and so on.

With this setup active, I'm seeing various errors during "librarian-chef install" (see example backtraces below). When I remove all the proxy environment variables, everything works fine. The error traces indicate that the proxy is being used, so http_proxy (or one of its various siblings) is being recognized, but no_proxy (or NO_PROXY) is not, since that one would cause librarian-chef to skip the proxy when talking to the configured default source.

Example backtraces (some values have been [redacted]):

$ git clean -dxf && bundle exec librarian-chef install
Installing build-essential (2.2.3)
Installing yum (3.5.3)
/Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:110:in `read': No such file or directory @ rb_sysopen - /Users/[username redacted]/[reponame redacted]/tmp/librarian/cache/source/chef/site/d72d2d4ed6e6fa75/yum/version/3.5.3 (Errno::ENOENT)
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:110:in `read'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:110:in `block in to_version_uri'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:381:in `memo'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:108:in `to_version_uri'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:211:in `cache_version_unpacked!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:30:in `install_version!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:437:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/manifest.rb:101:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:49:in `block in install_manifests'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `each'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `install_manifests'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:39:in `perform_installation'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:12:in `run'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:165:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/cli.rb:42:in `install'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block in bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/bin/librarian-chef:7:in `<top (required)>'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/bin/librarian-chef:23:in `load'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/bin/librarian-chef:23:in `<main>'


$ git clean -dxf && bundle exec librarian-chef install
Installing build-essential (2.2.3)
Installing yum (3.5.3)
/Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `initialize': Operation timed out - connect(2) for "proxy.wdf.sap.corp" port 8080 (Errno::ETIMEDOUT)
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `open'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:878:in `connect'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:852:in `start'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:353:in `block in http_get'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:348:in `loop'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:348:in `http_get'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:238:in `cache_remote_object!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:228:in `cache_remote_json!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:180:in `cache_version_uri_metadata!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:81:in `block in version_uri_metadata'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:381:in `memo'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:80:in `version_uri_metadata'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:188:in `block in cache_version!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:187:in `each'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:187:in `cache_version!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:109:in `block in to_version_uri'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:381:in `memo'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:108:in `to_version_uri'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:211:in `cache_version_unpacked!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:30:in `install_version!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:437:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/manifest.rb:101:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:49:in `block in install_manifests'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `each'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:48:in `install_manifests'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:39:in `perform_installation'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/action/install.rb:12:in `run'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:165:in `install!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/lib/librarian/chef/cli.rb:42:in `install'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block in bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/gems/librarian-chef-0.0.4/bin/librarian-chef:7:in `<top (required)>'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/bin/librarian-chef:23:in `load'
    from /Users/[username redacted]/.rbenv/versions/2.1.2/gemsets/[reponame redacted]/bin/librarian-chef:23:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant