No such file or directory: 'htpasswd': 'htpasswd' since apache2-utils is not installed

Bug #1829529 reported by Nobuto Murata
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Docker Registry Charm
Fix Released
High
Nobuto Murata

Bug Description

I'm following the following doc:
https://www.ubuntu.com/kubernetes/docs/docker-registry

How to reproduce:

juju deploy ~containers/docker-registry
juju config docker-registry \
  auth-basic-user='admin' \
  auth-basic-password='password'

Then unit error "FileNotFoundError: [Errno 2] No such file or directory: 'htpasswd': 'htpasswd'" happens.

apache2-utils including htpasswd is supposed to be installed with apt layer:
https://github.com/CanonicalLtd/docker-registry-charm/blob/master/layer.yaml
But it's not installed when reactive/docker_registry.py is executed.

unit-docker-registry-0: 22:00:26 ERROR unit.docker-registry/0.juju-log Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-docker-registry-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 73, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-docker-registry-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-docker-registry-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-docker-registry-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-docker-registry-0/charm/reactive/docker_registry.py", line 25, in start
    layer.docker_registry.configure_registry()
  File "lib/charms/layer/docker_registry.py", line 32, in configure_registry
    auth_basic = _get_auth_basic()
  File "lib/charms/layer/docker_registry.py", line 201, in _get_auth_basic
    if _write_htpasswd(htpasswd_file, user, password):
  File "lib/charms/layer/docker_registry.py", line 273, in _write_htpasswd
    subprocess.check_call(cmd)
  File "/usr/lib/python3.6/subprocess.py", line 286, in check_call
    retcode = call(*popenargs, **kwargs)
  File "lib/charms/layer/status.py", line 186, in _patched_call
    return _orig_call(cmd, *args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'htpasswd': 'htpasswd'

Revision history for this message
Nobuto Murata (nobuto) wrote :
Changed in layer-docker-registry:
assignee: nobody → Nobuto Murata (nobuto)
Changed in layer-docker-registry:
status: New → In Progress
importance: Undecided → High
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

Fix is available in rev 143 and higher:

cs:~containers/docker-registry-143

Changed in layer-docker-registry:
status: In Progress → Fix Committed
Changed in layer-docker-registry:
milestone: none → 1.15
Changed in layer-docker-registry:
status: Fix Committed → 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.