Import failed because apt_install() was assumed to have worked
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
Fix Released
|
Critical
|
David Ames | ||
cinder (Juju Charms Collection) |
Fix Released
|
Critical
|
David Ames |
Bug Description
This code:
def ns_query(address):
try:
import dns.resolver
except ImportError:
import dns.resolver
Failed like this:
2016-07-09 06:25:01 INFO juju-log Installing python-dnspython with options: ['--option=
2016-07-09 06:25:01 INFO install E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
2016-07-09 06:25:01 INFO install E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
2016-07-09 06:25:01 INFO install Traceback (most recent call last):
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install assess_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install assess_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install state, message = _determine_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install configs, required_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install required_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install complete_ctxts = configs.
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install for i in six.itervalues(
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install self.context()
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install _ctxt = context()
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install addr = get_host_
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install ip_addr = ns_query(hostname)
2016-07-09 06:25:01 INFO install File "/var/lib/
2016-07-09 06:25:01 INFO install import dns.resolver
2016-07-09 06:25:01 INFO install ImportError: No module named dns.resolver
2016-07-09 06:25:01 ERROR juju.worker.
This code structure is used all over the place in charmhelpers/
We should either pass fatal=True to *all* apt_install() invocations, or just maybe bite the bullet and flip the default from fatal=False to fatal=True in charmhelpers/
One silly case this change would make worse is if the specified package does not exist. It would keep uselessly retrying until the retry_count limit is hit. But then again we could improve the code to check what actually failed, and exit the retry loop if the error is "unknown package".
tags: | removed: kanban-cross-team |
Changed in charm-helpers: | |
status: | New → Triaged |
importance: | Undecided → Critical |
assignee: | nobody → David Ames (thedac) |
status: | Triaged → New |
importance: | Critical → Undecided |
assignee: | David Ames (thedac) → nobody |
Changed in cinder (Juju Charms Collection): | |
status: | New → Triaged |
importance: | Undecided → High |
importance: | High → Critical |
assignee: | nobody → David Ames (thedac) |
milestone: | none → 16.07 |
Changed in charm-helpers: | |
status: | New → Fix Committed |
assignee: | nobody → David Ames (thedac) |
importance: | Undecided → Critical |
Changed in cinder (Juju Charms Collection): | |
status: | In Progress → Fix Committed |
Changed in cinder (Juju Charms Collection): | |
status: | Fix Committed → Fix Released |
Changed in charm-helpers: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/343780
Review: https:/