[2.4.0] juju-no-proxy variable is not applied due to legacy no-proxy value being auto-set by juju

Bug #1782236 reported by Dmitrii Shcherbakov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Joseph Phillips

Bug Description

It appears to be that "auto noproxy" behavior triggers an incorrect behavior with new juju-no-proxy value albeit the legacy one is set to an empty string.

On 2.4.0 all juju-{http,https,no}-proxy configs landed into apt-{http,https,no}-proxy judging by the apiserver log.

juju model-config -m controller logging-config='<root>=ERROR;unit=TRACE;juju.worker.proxyupdater=TRACE'

juju model-config -m controller juju-http-proxy=http://10.10.101.2:8000 juju-https-proxy=http://10.10.101.2:8000 juju-no-proxy='localhost,127.0.0.1,10.10.10.0/24,10.10.101.0/24' http-proxy='' https-proxy="" no-proxy=""

machine-0.log on the controller machine:

2018-07-17 20:27:14 DEBUG juju.worker.proxyupdater proxyupdater.go:185 new legacy proxy settings proxy.Settings{Http:"", Https:"", Ftp:"", NoProxy:"10.10.101.19", AutoNoProxy:""}
2018-07-17 20:27:14 TRACE juju.worker.proxyupdater proxyupdater.go:213 setting snap proxy values: proxy.Settings{Http:"", Https:"", Ftp:"", NoProxy:"", AutoNoProxy:""}, "", ""

# on a controller machine
ip -4 -o -br a s
lo UNKNOWN 127.0.0.1/8
enp1s0 UP 10.10.101.19/24

juju status -m controller
Model Controller Cloud/Region Version SLA Timestamp
controller vmaas vmaas 2.4.1 unsupported 23:44:37+03:00

Machine State DNS Inst id Series AZ Message
0 started 10.10.101.19 xwqr38 xenial default Deployed

snap info juju | grep -P ' candidate'
  candidate: 2.4.1+2.4-7213ffe (4691) 63MB classic

update for 2.4.0 (non-candidate):

cat bootstrap-config.yaml
juju-http-proxy: http://10.10.101.2:8000
juju-https-proxy: http://10.10.101.2:8000
juju-no-proxy: 'localhost,127.0.0.1,10.10.10.0/24,10.10.101.0/24'
logging-config: '<root>=ERROR;unit=TRACE;juju.worker.proxyupdater=TRACE'

juju bootstrap --config bootstrap-config.yaml --bootstrap-constraints mem=2048 vmaas

root@maas-vhost1:/var/log/juju# grep -i proxyupdate machine-0.log
2018-07-17 21:12:29 DEBUG juju.apiserver request_notifier.go:178 <- [1] machine-0 {"request-id":30,"type":"ProxyUpdater","version":2,"request":"ProxyConfig","params":"'params redacted'"}
2018-07-17 21:12:30 DEBUG juju.apiserver request_notifier.go:195 -> [1] machine-0 250.290772ms {"request-id":30,"response":"'body redacted'"} ProxyUpdater[""].ProxyConfig
2018-07-17 21:12:30 DEBUG juju.worker.logger logger.go:70 reconfiguring logging from "<root>=DEBUG" to "<root>=ERROR;unit=TRACE;juju.worker.proxyupdater=TRACE"
2018-07-17 21:12:34 DEBUG juju.worker.proxyupdater proxyupdater.go:165 new legacy proxy settings proxy.Settings{Http:"", Https:"", Ftp:"", NoProxy:"10.10.101.42,127.0.0.1,::1,localhost", AutoNoProxy:""}
2018-07-17 21:12:34 DEBUG juju.worker.proxyupdater proxyupdater.go:186 new apt proxy settings proxy.Settings{Http:"http://10.10.101.2:8000", Https:"http://10.10.101.2:8000", Ftp:"", NoProxy:"10.10.10.0/24,10.10.101.0/24,127.0.0.1,localhost", AutoNoProxy:""}
2018-07-17 21:12:34 DEBUG juju.worker.proxyupdater proxyupdater.go:165 new legacy proxy settings proxy.Settings{Http:"", Https:"", Ftp:"", NoProxy:"10.10.101.42,127.0.0.1,::1,localhost", AutoNoProxy:""}
2018-07-17 21:12:34 DEBUG juju.worker.proxyupdater proxyupdater.go:186 new apt proxy settings proxy.Settings{Http:"http://10.10.101.2:8000", Https:"http://10.10.101.2:8000", Ftp:"", NoProxy:"10.10.10.0/24,10.10.101.0/24,127.0.0.1,localhost", AutoNoProxy:""}

It appears to be that juju-http-proxy, juju-https-proxy and juju-no-proxy land into apt-http-proxy, apt-https-proxy and apt-no-proxy for some reason while they are not even set on the controller model:

juju model-config | grep proxy
apt-ftp-proxy default ""
apt-http-proxy default ""
apt-https-proxy default ""
apt-no-proxy default ""
ftp-proxy default ""
http-proxy default ""
https-proxy default ""
juju-ftp-proxy default ""
juju-http-proxy model http://10.10.101.2:8000
juju-https-proxy model http://10.10.101.2:8000
juju-no-proxy model localhost,127.0.0.1,10.10.10.0/24,10.10.101.0/24
logging-config model <root>=ERROR;unit=TRACE;juju.worker.proxyupdater=TRACE
no-proxy default 127.0.0.1,localhost,::1
proxy-ssh default false

Tags: cpe-onsite
description: updated
summary: - juju-no-proxy variable is not applied due to legacy no-proxy value being
- auto-set by juju
+ [2.4.0] juju-no-proxy variable is not applied due to legacy no-proxy
+ value being auto-set by juju
description: updated
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

The actual problem in the juju code is apparent from changes in this PR: https://github.com/juju/juju/pull/8949

apt settings are populated because getWithFallback is used for them if they are not set which fetches values from JujuHTTPProxyKey and HTTPProxyKey, see:
https://github.com/juju/juju/blob/juju-2.4.0/environs/config/config.go#L958-L960

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Subscribed ~field-high. The suggested fix is here: https://github.com/juju/juju/pull/8949

To be fair I missed this during testing of unreleased builds of 2.4.

Changed in juju:
importance: Undecided → High
milestone: none → 2.4.2
Changed in juju:
status: New → Triaged
assignee: nobody → Joseph Phillips (manadart)
Changed in juju:
status: Triaged → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.