Flannel install hook fails during integration testing

Bug #1938944 reported by jarred wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
New
Undecided
Unassigned

Bug Description

Running the tox integration tests for the charm result in failure because of an issue with the flannel charm. Editing the bundle to use the stable flannel charm instead of the edge channel resolves the issue.

INFO pytest_operator.plugin:plugin.py:255 Model status:

Unit Machine Status Message
easyrsa/0* 1 active Certificate Authority ready.
etcd/0* 0 blocked Missing relation to certificate authority.
kubernetes-master/0* 0 maintenance Installing kube-controller-manager snap
kubernetes-worker/0* 1 blocked Missing relation to certificate authority.
prometheus/0* 0 waiting agent initializing
flannel/0* 1 error hook failed: "install"
containerd/0* 1 waiting agent initializing

Machine Series Status
0 focal running
1 focal running

INFO pytest_operator.plugin:plugin.py:275 Juju error logs:

machine-0: 17:28:21 ERROR juju.worker.dependency "broker-tracker" manifold worker returned unexpected error: no container types determined
machine-1: 17:28:52 ERROR juju.worker.dependency "broker-tracker" manifold worker returned unexpected error: no container types determined
unit-flannel-0: 17:32:19 ERROR unit.flannel/0.juju-log Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-flannel-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 71, in main
    bus.discover()
  File "/var/lib/juju/agents/unit-flannel-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 426, in discover
    _register_handlers_from_file(search_path, filepath)
  File "/var/lib/juju/agents/unit-flannel-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 466, in _register_handlers_from_file
    _load_module(root, filepath)
  File "/var/lib/juju/agents/unit-flannel-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 444, in _load_module
    return importlib.import_module(package + module)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/lib/juju/agents/unit-flannel-0/charm/hooks/relations/kubernetes-cni/provides.py", line 5, in <module>
    from charms.layer.kubernetes_common import kubeclientconfig_path
ModuleNotFoundError: No module named 'charms.layer.kubernetes_common'

unit-flannel-0: 17:32:19 ERROR juju.worker.uniter.operation hook "install" (via explicit, bespoke hook script) failed: exit status 1

INFO pytest_operator.plugin:plugin.py:286 Destroying machine 0
INFO pytest_operator.plugin:plugin.py:286 Destroying machine 1
INFO pytest_operator.plugin:plugin.py:289 Destroying model test-kubernetes-master-integration-fc38

================================================ FAILURES ================================================
_________________________________________ test_build_and_deploy __________________________________________
Traceback (most recent call last):
  File "/home/ubuntu/charm-kubernetes-master/tests/integration/test_kubernetes_master_integration.py", line 42, in test_build_and_deploy
    await ops_test.model.wait_for_idle(wait_for_active=True, timeout=60 * 60)
  File "/home/ubuntu/charm-kubernetes-master/.tox/integration/lib/python3.8/site-packages/juju/model.py", line 2329, in wait_for_idle
    _raise_for_status(errors, "error")
  File "/home/ubuntu/charm-kubernetes-master/.tox/integration/lib/python3.8/site-packages/juju/model.py", line 2281, in _raise_for_status
    raise error_type("{}{} in {}: {}".format(
juju.errors.JujuUnitError: Unit in error: flannel/0
======================================== short test summary info =========================================
FAILED tests/integration/test_kubernetes_master_integration.py::test_build_and_deploy - juju.errors.Juj...
=============================== 1 failed, 2 xfailed in 1104.15s (0:18:24) ================================
ERROR: InvocationError for command /home/ubuntu/charm-kubernetes-master/.tox/integration/bin/pytest --tb native --show-capture=no --log-cli-level=INFO -s tests/integration (exited with code 1)

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.