apt-proxy can be incorrectly set when the fallback from http-proxy is used

Bug #1417617 reported by Michael Foord
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
James Tunnicliffe
1.21
Fix Released
High
James Tunnicliffe
1.22
Fix Released
High
James Tunnicliffe

Bug Description

Proxy configuration for the deployed environment is done with the http-proxy, https-proxy and apt-proxy settings in environments.yaml. If http-proxy is set but apt-proxy isn't then apt-proxy falls back to http-proxy as a default (as they're usually the same).

http-proxy (which ends up as an environment variable) can be in the form <ip-addr>:port, however apt-proxy must be in the form http://<ip-addr>:port/ - so a valid http-proxy setting can end up as an invalid apt-proxy setting. If http-proxy is not in the correct form for apt-proxy we should correctly format it when we use it as a fallback.

The code that does this (Config.AptProxySettings) is line 854 in environs/config/config.go

In addition, once the apt config file has been written re-provisioning a machine (e.g. for manual provider) won't result in a *new* apt config file being written out. So an incorrect setting remains even once corrected. This is probably an issue in the proxyupdateworker that writes out the system files.

Tags: network proxy apt
Changed in juju-core:
assignee: nobody → James Tunnicliffe (dooferlad)
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Have got a fix for the initial problem (http:// missing causes problems) but it makes lots of tests fail that expect the scheme part of URLs to be missing. Just need to update the tests, so more tedious than difficult.

Haven't looked into the proxyupdateworker part. Could you give me some reproducer instructions?

Changed in juju-core:
status: New → In Progress
Revision history for this message
Michael Foord (mfoord) wrote :

To reproduce create a kvm image (or similar) with http-proxy and https-proxy set for the manual provider in environments.yaml. Use the incorrect format (or simply incorrect proxy settings).

Then bootstrap the manual provider. Then destroy-environment and correct the settings in environments.yaml. When you re-provision again the apt config file written by juju should be unchanged (or rather should have changed to reflect the new values - the bug is that it isn't changed).

Curtis Hovey (sinzui)
Changed in juju-core:
importance: Undecided → High
milestone: none → 1.23
Changed in juju-core:
status: In Progress → Fix Committed
tags: added: apt network proxy
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.23 → 1.23-beta1
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.