← Back to issue list

Unable to build a charm that deploys on xenial

View original Github issue

Metadata

Project
charmcraft
Number
#589
Type
issue
State
closed
Author
mthaddon
Labels
—
Created
Updated
Closed

Current evaluation

Not a charmcraft bug: the charm failed on xenial because ops 1.2.0 (the pinned latest release) broke on Python 3.5 (canonical/operator#517). Author confirmed building with the latest operator framework from git deploys fine.

Resolution: closed not a bug

Reason: Reporter concluded 'Sorry for the noise' and self-closed after confirming that installing ops from git (git+https://github.com/canonical/operator/#egg=ops plus git as a build-package) let the charm build and deploy on xenial. The failure was an upstream Operator Framework Python 3.5 incompatibility, not a charmcraft defect.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I noticed that the ubuntu charm doesn't have a charmcraft.yaml file yet. So I added one as follows and built locally: ``` type: charm bases: - build-on: - name: "ubuntu" channel: "20.04" run-on: - name: "ubuntu" channel: "16.04" - name: "ubuntu" channel: "18.04" - name: "ubuntu" channel: "20.04" - name: "ubuntu" channel: "21.04" - name: "ubuntu" channel: "22.04" ``` This failed to deploy on xenial: ``` unit-ubuntu-0: 10:52:07 INFO juju.worker.uniter awaiting error resolution for "install" hook unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install Traceback (most recent call last): unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "./src/charm.py", line 7, in <module> unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install from ops.charm import CharmBase unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/__init__.py", line 43, in <module> unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install from . import charm # noqa: F401 (imported but unused) unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/charm.py", line 22, in <module> unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install from ops import model unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/model.py", line 1017, in <module> unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install class Container: unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/model.py", line 1053, in Container unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install combine: bool = False): unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 552, in __getitem__ unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install dict(self.__dict__), parameters, _root=True) unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 512, in __new__ unit-ubuntu-0: 10:52:08 WARNING unit.ubuntu/0.install for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): unit-ubuntu-0: 10:52:18 INFO juju.worker.uniter awaiting error resolution for "install" hook unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install Traceback (most recent call last): unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "./src/charm.py", line 7, in <module> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install from ops.charm import CharmBase unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/__init__.py", line 43, in <module> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install from . import charm # noqa: F401 (imported but unused) unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/charm.py", line 22, in <module> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install from ops import model unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/model.py", line 1017, in <module> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install class Container: unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/var/lib/juju/agents/unit-ubuntu-0/charm/venv/ops/model.py", line 1053, in Container unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install combine: bool = False): unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 552, in __getitem__ unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install dict(self.__dict__), parameters, _root=True) unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 512, in __new__ unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 512, in <genexpr> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 190, in __subclasscheck__ unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install self._eval_type(globalns, localns) unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "/usr/lib/python3.5/typing.py", line 177, in _eval_type unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install eval(self.__forward_code__, globalns, localns), unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install File "<string>", line 1, in <module> unit-ubuntu-0: 10:52:18 WARNING unit.ubuntu/0.install AttributeError: 'property' object has no attribute 'Layer' unit-ubuntu-0: 10:52:18 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1 ``` I tried changing the `build-on` value to 18.04 got the same error when deploying the charm on xenial. I tried changing the `build-on` value to 16.04 but I get the error `Skipping 'bases[0].build-on[0]': channel '16.04' is not yet supported (must be '18.04' or '20.04').` It seems to me like it's not currently possible to build a charm using charmcraft that will work on xenial. Am I missing something?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Not a charmcraft bug: the charm failed on xenial because ops 1.2.0 (the pinned latest release) broke on Python 3.5 (canonical/operator#517). Author confirmed building with the latest operator framework from git deploys fine.
stealth/space-bunny-alpha — closed not a bug User-reported Xenial deploy failure was traced to an old ops release, not charmcraft; author confirmed building against latest ops (git) fixes it, and the reporter closed the issue apologising for the noise.
stealth/space-bunny-alpha — closed not a bug Closed by the author after confirming it was not a charmcraft bug: the Xenial install failure came from the operator framework being incompatible with Python 3.5, fixed in canonical/operator#517; building with the git version of ops worked.
stealth/space-bunny-alpha — closed resolved Closed after the author confirmed that packaging the latest Operator Framework development version in the charm enabled Xenial deployment; canonical/operator#517 was cited as the relevant Python 3.5 fix.
stealth/space-bunny-alpha — closed resolved Confirmed fixed by building with the current Operator Framework source; the reporter successfully deployed the charm on Xenial, and no Charmcraft patch was required.
qwen3.6-35b-a3b-mtp-q6 — — Upgrading to the latest ops library development version resolved a Python 3.5 typing incompatibility, enabling successful Ubuntu Xenial deployment. The author verified the fix and closed the issue.
qwen/qwen3.6-35b-a3b — — Ubuntu 16.04 charm deployment failed due to Python 3.5 typing incompatibilities in ops. Upgrading to the latest ops version resolved the issue, enabling successful deployment. The author verified the fix and closed the report.
qwen3.6-35b-a3b-mtp-q6 — — Resolved by the author. Updating to the latest git version of the ops library and configuring charmcraft.yaml to build with git fixed a Python 3.5 typing compatibility error, enabling successful deployment on Ubuntu Xenial.

Update history

No update history recorded yet.

Related work

  • Related To: operator#517 (confidence 85%)

    Cited by the reporter and maintainers as the upstream fix for the 'property' object has no attribute 'Layer' Python 3.5 typing error; already fixed by April 2021.

Related issues

Issue Project State Summary Similarity
#888 Building with charm version 3.x does not install on bionic (Python >=3.7 is required, 3.6.9 is present) charmcraft closed Closed as not a charmcraft bug: the 22.04-build/18.04-run config was invalid (OS Python 3.6.9 < 3.7), and the bionic build break was an upstream charm-tools 3.x regression fixed in juju/charm-tools#641; broader fix tracked in #878.
75%