Install hook may fail if package index is out of date

Bug #1408689 reported by Adam Israel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
haproxy (Juju Charms Collection)
New
Undecided
Unassigned

Bug Description

series: trusty
provider: local (vagrant)

I've run into a problem in certain situations where the install hook will consistently fail:

2015-01-08 15:46:47 INFO install Suggested packages:
2015-01-08 15:46:47 INFO install vim-haproxy python-jinja2-doc
2015-01-08 15:46:47 INFO install The following NEW packages will be installed:
2015-01-08 15:46:47 INFO install haproxy python-jinja2 python-markupsafe
2015-01-08 15:46:47 INFO install 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
2015-01-08 15:46:47 INFO install Need to get 628 kB of archives.
2015-01-08 15:46:47 INFO install After this operation, 1912 kB of additional disk space will be used.
2015-01-08 15:46:47 INFO install WARNING: The following packages cannot be authenticated!
2015-01-08 15:46:47 INFO install haproxy python-markupsafe python-jinja2
2015-01-08 15:46:47 INFO install E: There are problems and -y was used without --force-yes
2015-01-08 15:46:47 INFO install Traceback (most recent call last):
2015-01-08 15:46:47 INFO install File "hooks/hooks.py", line 1019, in <module>
2015-01-08 15:46:47 INFO install main(hook_name)
2015-01-08 15:46:47 INFO install File "hooks/hooks.py", line 979, in main
2015-01-08 15:46:47 INFO install install_hook()
2015-01-08 15:46:47 INFO install File "hooks/hooks.py", line 756, in install_hook
2015-01-08 15:46:47 INFO install apt_install(['haproxy', 'python-jinja2'], fatal=True)
2015-01-08 15:46:47 INFO install File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/charmhelpers/fetch/__init__.py", line 54, in apt_install
2015-01-08 15:46:47 INFO install subprocess.check_call(cmd)
2015-01-08 15:46:47 INFO install File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
2015-01-08 15:46:47 INFO install raise CalledProcessError(retcode, cmd)
2015-01-08 15:46:47 INFO install subprocess.CalledProcessError: Command '['apt-get', '-y', 'install', 'haproxy', 'python-jinja2']' returned non-zero exit status 100
2015-01-08 15:46:47 ERROR juju.worker.uniter uniter.go:486 hook failed: exit status 1

I've found two things that resolve the issue:

1) add '--force-yes' to the `apt-get install` command
2) call apt-get update prior to `apt-get install`

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.