add_source fails: add-apt-repository not found

Bug #1576666 reported by Merlijn Sebrechts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
High
Unassigned

Bug Description

From the topbeat charm:

Traceback (most recent call last):
  File "hooks/install", line 19, in <module>
    main()
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charms/reactive/__init__.py", line 73, in main
    bus.dispatch()
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 421, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 404, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 280, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-topbeat-0/charm/reactive/beats_base.py", line 12, in install_beats_repo
    configure_sources(update=True)
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charmhelpers/fetch/__init__.py", line 363, in configure_sources
    add_source(source, key)
  File "/var/lib/juju/agents/unit-topbeat-0/.venv/lib/python3.4/site-packages/charmhelpers/fetch/__init__.py", line 289, in add_source
    subprocess.check_call(['add-apt-repository', '--yes', source])
  File "/usr/lib/python3.4/subprocess.py", line 556, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.4/subprocess.py", line 537, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'add-apt-repository'

add-apt-repository is not present on all Ubuntu instances. Some don't have it by default.

Revision history for this message
Stuart Bishop (stub) wrote :

bootstrap needs to ensure the relevant package is installed. I think it is software-properties-common, but I'm not sure if it is the same across all releases.

Changed in charm-helpers:
status: New → Triaged
importance: Undecided → High
Changed in charm-helpers:
status: Triaged → Fix Released
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.