Jira (PUP-9990) no_proxy config setting is overridden by http_proxy environment variable

23 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
Sep 4, 2019, 2:04:04 PM9/4/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-9990
no_proxy config setting is overridden by http_proxy environment variable
Change By: Josh Cooper
Summary: no_proxy config setting is ignored overridden by puppet agent http_proxy environment variable
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Sep 4, 2019, 8:00:02 PM9/4/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 4, 2019, 8:00:03 PM9/4/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary: Fixes a bug where puppet would attempt to use a proxy specified in the HTTP_PROXY environment variable, even though Puppet[:no_proxy] said to bypass the proxy.
Release Notes: Bug Fix

Kris Bosland (JIRA)

unread,
Sep 10, 2019, 1:11:04 PM9/10/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 11, 2019, 1:26:04 AM9/11/19
to puppe...@googlegroups.com

Jean Bond (JIRA)

unread,
Sep 13, 2019, 5:46:03 PM9/13/19
to puppe...@googlegroups.com
Jean Bond updated an issue
 
Change By: Jean Bond
Labels: proxy resolved-issue-added

Dhumala (JIRA)

unread,
Sep 18, 2019, 8:26:03 AM9/18/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 24, 2019, 6:13:03 PM9/24/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9990

Dhumala can you open a new ticket and provide more detail about why the issue is not solved, including the result of running puppet agent -t --http_debug?

Ob Rzwo (JIRA)

unread,
Oct 7, 2019, 1:47:05 PM10/7/19
to puppe...@googlegroups.com
Ob Rzwo commented on Bug PUP-9990

Not solved! Should we really open a new ticket?

6.7.2 is working on Ubuntu 16.04 and 18.04 with:

 

$ sudo vi /etc/apt/preferences.d/puppet-agent

 

 

Package: puppet-agent
Pin: version 6.7*
Pin-Priority: 550

$ sudo apt update
$ sudo apt purge puppet-agent
$ sudo apt install puppet-agent

$ sudo puppet agent -t
Info: Using configured environment '***'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for ***
Info: Applying configuration version '1570470218'
Notice: /Stage[main]/***/***/returns: executed successfully (corrective)
Notice: /Stage[main]/***/***/returns: executed successfully (corrective)
Notice: /Stage[main]/***/***/returns: executed successfully (corrective)
Notice: Applied catalog in 0.79 seconds

6.8, 6.9 and 6.10 do not work., see:

$ sudo vi /etc/apt/preferences.d/puppet-agent

Package: puppet-agent
Pin: version 6.10*
Pin-Priority: 550

$ sudo apt update
$ sudo apt purge puppet-agent
$ sudo apt install puppet-agent

 

 

$ sudo puppet agent -t --http_debug
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:48 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: 403 "Forbidden"
Info: Retrieving pluginfacts
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:48 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': 403 "Forbidden"
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:48 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: 403 "Forbidden"
Info: Retrieving plugin
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:48 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': 403 "Forbidden"
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:48 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: 403 "Forbidden"
Info: Loading facts
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:50 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: Could not retrieve catalog from remote server: 403 "Forbidden"
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
opening connection to corporateproxy:8123...
opened
<- "CONNECT puppet:8140 HTTP/1.1\r\nHost: puppet:8140\r\n\r\n"
-> "HTTP/1.1 403 Forbidden\r\n"
-> "Server: squid/4.4\r\n"
-> "Mime-Version: 1.0\r\n"
-> "Date: Mon, 07 Oct 2019 17:31:50 GMT\r\n"
-> "Content-Type: text/html;charset=utf-8\r\n"
-> "Content-Length: 3389\r\n"
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n"
-> "Vary: Accept-Language\r\n"
-> "Content-Language: en\r\n"
-> "X-Cache: MISS from corporateproxy\r\n"
-> "X-Cache-Lookup: NONE from corporateproxy:8123\r\n"
-> "Via: 1.1 corporateproxy (squid/4.4)\r\n"
-> "Connection: keep-alive\r\n"
-> "\r\n"
Conn close because of connect error 403 "Forbidden"
Error: Could not send report: 403 "Forbidden"

 

Josh Cooper (JIRA)

unread,
Oct 7, 2019, 1:57:03 PM10/7/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9990

Ob Rzwo yes please open a new ticket and link it to this one. Please include any http related environment variables, like NO_PROXY, HTTP_PROXY, etc, that are visible to the puppet process.

Ob Rzwo (JIRA)

unread,
Oct 8, 2019, 9:02:03 AM10/8/19
to puppe...@googlegroups.com
Ob Rzwo commented on Bug PUP-9990

Ha, the no_proxy variable in /etc/environment is the solution. It works with version 6.8, 6.9 and 6.10. Sorry I made the horses a bit shy, but you have to add the puppet master to the no_proxy variable now!!!

sudo vi /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
 
http_proxy="http://corporateproxy:8123"
https_proxy="http://corporateproxy:8123"
ftp_proxy="http://corporateproxy:8123"
# Attention: Problem: Only 1024 characters possible:
no_proxy="localhost,127.0.0.1,localaddress,.local,puppet"
HTTP_PROXY="http://corporateproxy:8123"
HTTPS_PROXY="http://corporateproxy:8123"
FTP_PROXY="http://corporateproxy:8123"
# Attention: Problem: Only 1024 characters possible:
NO_PROXY="localhost,127.0.0.1,localaddress,.local,puppet"

Solved.

Josh Cooper (JIRA)

unread,
Oct 24, 2019, 6:44:03 PM10/24/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9990

Ben Roberts The reason puppet uses a proxy when http_proxy is set in the environment, and no_proxy is in puppet.conf, but not the environment, is because we create the Net::HTTP object in a way that causes it to resolve proxy settings from the environment, and ruby doesn't "see" our no_proxy exception list in puppet.conf.

So in https://github.com/ruby/ruby/blob/7c94ba3401772ca28edfdcb2ef95aec05242394e/lib/uri/generic.rb#L1529-L1546] ruby ends up using the http_proxy from the environment.

Austin Boyd (Jira)

unread,
Mar 11, 2020, 4:47:04 AM3/11/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
 
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 38358
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Austin Boyd (Jira)

unread,
Mar 11, 2020, 4:47:05 AM3/11/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Labels: jira_escalated proxy resolved-issue-added
Reply all
Reply to author
Forward
0 new messages