local provider must transform localhost in apt proxy address

Bug #1329051 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Triaged
High
Unassigned
juju-core (Ubuntu)
New
Undecided
Unassigned

Bug Description

I am on current Utopic, and installed the utopic-proposed juju packages (as 1.18.1 is known to not work on utopic):

ii juju-core 1.18.4-0ubuntu1 amd64 Juju is devops distilled - client
ii juju-local 1.18.4-0ubuntu1 all dependency package for the Juju local provider
ii juju-mongodb 2.4.10-0ubuntu1 amd64 MongoDB object/document-oriented database for Juju
ii juju-quickstart 1.3.1-0ubuntu1 all Easy configuration of Juju environments
ii python-jujuclient 0.17.5-0ubuntu2 all Python API client for juju

With no pre-existing ~/.juju, and a workaround for bug 1329049, quickstart does this:

$ juju quickstart
juju quickstart v1.3.1
bootstrapping the local environment (type: local)
sudo privileges will be required to bootstrap the environment
retrieving the environment status
retrieving the Juju API address
connecting to wss://10.0.3.1:17070
requesting juju-gui deployment
charm URL: cs:precise/juju-gui-90
juju-gui deployment request accepted
exposing service juju-gui
requesting new unit deployment
juju-gui/0 deployment request accepted
juju-gui/0 deployment is pending
machine 1 provisioning is pending
juju-gui/0 placed on 10.0.3.219
machine 1 is started

and now hangs eternally.

$ juju status
environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.18.4.1
    dns-name: localhost
    instance-id: localhost
    series: utopic
  "1":
    agent-state: started
    agent-version: 1.18.4.1
    dns-name: 10.0.3.219
    instance-id: martin-local-machine-1
    series: precise
    hardware: arch=amd64
services:
  juju-gui:
    charm: cs:precise/juju-gui-90
    exposed: true
    units:
      juju-gui/0:
        agent-state: pending
        agent-version: 1.18.4.1
        machine: "1"
        public-address: 10.0.3.219

unit-juju-gui-0.log shows an endless stream of

2014-06-11 20:03:18 ERROR juju.worker.uniter.charm git.go:211 git command failed: exec: "git": executable file not found in $PATH
path: /var/lib/juju/agents/unit-juju-gui-0/state/deployer/update-20140611-220318576432597
args: []string{"init"}

2014-06-11 20:03:18 WARNING juju.worker.uniter.charm git_deployer.go:200 no current staging repo
2014-06-11 20:03:18 ERROR juju.worker.uniter.filter filter.go:116 tomb: dying
2014-06-11 20:03:18 ERROR juju runner.go:220 worker: exited "uniter": ModeInstalling cs:precise/juju-gui-90: git init failed: exec: "git": executable file not found in $PATH

So apparently the charm is missing to install git?

Also, is it really on purpose that juju-gui-0 runs on precise, not on trusty? Even with a pre-existing .juju/environments.yaml with "default-series: trusty" in the local section it does that.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: juju-core 1.18.4-0ubuntu1 [origin: unknown]
ProcVersionSignature: Ubuntu 3.15.0-5.10-generic 3.15.0-rc8
Uname: Linux 3.15.0-5-generic x86_64
ApportVersion: 2.14.3-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Jun 11 22:01:09 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-02-27 (104 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140224)
SourcePackage: juju-core
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Exactly the same issue with

$ juju init
# edit .juju/environments.yaml to select trusty as default release, and default to "local"
$ juju bootstrap
uploading tools for series [utopic precise trusty]
Logging to /home/martin/.juju/local/cloud-init-output.log on remote host
Starting MongoDB server (juju-db-martin-local)
Bootstrapping Juju machine agent
Starting Juju machine agent (juju-agent-martin-local)
$ juju deploy juju-gui
Added charm "cs:trusty/juju-gui-2" to the environment.

$ juju status
environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.18.4.1
    dns-name: localhost
    instance-id: localhost
    series: utopic
  "1":
    agent-state: started
    agent-version: 1.18.4.1
    dns-name: 10.0.3.104
    instance-id: martin-local-machine-1
    series: trusty
    hardware: arch=amd64
services:
  juju-gui:
    charm: cs:trusty/juju-gui-2
    exposed: false
    units:
      juju-gui/0:
        agent-state: pending
        agent-version: 1.18.4.1
        machine: "1"
        public-address: 10.0.3.104

.juju/local/log/unit-juju-gui-0.log now loops on teh same git error.

Revision history for this message
Martin Pitt (pitti) wrote :

So I poked further, and thought to install git manually:

$ sudo lxc-attach -n martin-local-machine-1
root@martin-local-machine-1:/# apt-get install git
Fehl http://archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1
  Verbindung mit 127.0.0.1:3142 nicht möglich (127.0.0.1) - connect (111: Connection refused)

A-ha! /etc/apt/apt.conf.d/42-juju-proxy-settings indeed used that for a proxy (it seems to sort of autodetect apt-cacher-ng, or just blindly uses the host's apt proxy), but of course that's only valid on my host, not in the container. I fixed that to http://10.0.3.1:3142, and installed git.

Now the charm continues. So perhaps it actually did try to install git, but if so, there's no trace of it in unit-juju-gui-0.log.

But after installing git manually, the charm goes on with installing more packages, and finally succeeds. I get the Juju GUI now (found the password in environments/local.jenv).

summary: - local boostrapping of juju-gui fails on "git not found"
+ local charm deployment fails on "git not found" due to wrong apt proxy
Revision history for this message
Martin Pitt (pitti) wrote : Re: local charm deployment fails on "git not found" due to wrong apt proxy

I just got the very same problem with cs:trusty/postgresql-1, with the same solution. So I figure the problem is the improper usage of the host proxy that has a localhost address. It needs to be translated to talking to the proxy on the host.

Ian Booth (wallyworld)
Changed in juju-core:
importance: Undecided → High
status: New → Triaged
milestone: none → next-stable
Ian Booth (wallyworld)
tags: added: 14.10
Martin Pitt (pitti)
summary: - local charm deployment fails on "git not found" due to wrong apt proxy
+ local provider must transform localhost in apt proxy address
Revision history for this message
Martin Pitt (pitti) wrote :

WORKAROUND: Explicitly set the proxy in .juju/environments.yaml:

   apt-http-proxy: http://10.0.3.1:3142

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.