Error: unable to find the ip address of the LXC container: Command '['/usr/bin/env', 'lp-lxc-ip', '-i', 'eth0', '-n', 'lptests']' returned non-zero exit status 1

Bug #1090934 reported by Chris Johnston
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lpsetup
Triaged
High
Unassigned

Bug Description

Whe running lp-setup install-lxc I ran into:

Error: unable to find the ip address of the LXC container: Command '['/usr/bin/env', 'lp-lxc-ip', '-i', 'eth0', '-n', 'lptests']' returned non-zero exit status 1

Text from a conversation in #lxcontainers:

10.33.15 < stgraber> cjohnston: hard to know for sure as you appear to be using the LP ephemeral container scripts which aren't upstream
10.33.30 < stgraber> cjohnston: does the container actually have an IP address? (if you check with lxc-console)
10.34.08 < cjohnston> stgraber: lemme look
10.35.18 < stgraber> you should also see the IP allocation in /var/log/syslog as dnsmasq will print it there
10.36.47 < cjohnston> stgraber: I also see this when its setting up:
10.36.48 < cjohnston> ln: failed to create symbolic link `/etc/apparmor.d/disable/usr.bin.lxc-start': File exists
10.36.48 < cjohnston> apparmor_parser: Unable to remove "/usr/bin/lxc-start". Profile doesn't exist
10.37.30 < stgraber> cjohnston: well, that part is definitely LP-specific. The lxc package in Ubuntu certainly doesn't disable the apparmor profile it itself ships
10.38.38 < cjohnston> stgraber: this is syslog: http://paste.ubuntu.com/1443630/
10.39.29 < cjohnston> stgraber: and 10.0.3.183 is what ifconfig shows inside of lptests
10.47.52 < stgraber> cjohnston: ok, so my guess is that lp-lxc-ip is the problem
10.48.09 < stgraber> cjohnston: what happens if you run "sudo lp-lxc-ip -i eth0 -n lptests" now?
10.49.56 < cjohnston> stgraber: from outside of lptests correct?
10.50.48 < cjohnston> lp-lxc-ip: error: lxc does not seem to be installed
10.59.36 < stgraber> what version of Ubuntu is that?
11.01.08 < cjohnston> I'm on 12.10, the lpsetup I believe is lucid
11.02.10 < stgraber> ok, so I guess it's confused because lxc-ip doesn't exist or because of a similar problem
11.02.30 < stgraber> you'd need to check with someone who has a clue about the LP magic. They'll probably want to rebase their stuff on python3-lxc
11.02.33 < stgraber> as you could just do
11.02.34 < stgraber> import lxc
11.02.42 < stgraber> container = lxc.Container("lptests")
11.02.55 < stgraber> container.get_ips(interface="eth0", timeout=10)[0]
11.03.12 < stgraber> which would give you a way more reliable way (and supported upstream) to grab the IP address

Tags: lts
Revision history for this message
Gary Poster (gary) wrote :

lpsetup has not been changed to work in Quantal. The apparmor change, for instance, was to address a LXC bug in Precise that has been fixed in Quantal. lp-lxc-ip uses ctypes, and if the C API changed beneath us then that will break. It would be great to use stgraber's new API instead, if all devs are willing to run Quantal (makes sense to me on the face of it).

I suspect that's what we have.

Changed in lpsetup:
status: New → Triaged
importance: Undecided → High
tags: added: lts
Revision history for this message
Laura Czajkowski (czajkowski) wrote :

The script has to work in LTSs and we believe this bug means it will not work in non LTS. We use it on LTSs to test Lp

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 1090934] Re: Error: unable to find the ip address of the LXC container: Command '['/usr/bin/env', 'lp-lxc-ip', '-i', 'eth0', '-n', 'lptests']' returned non-zero exit status 1

Its still python though, so you could do conditional code easily enough :)

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.