Does not deploy on Xenial due to MarkupSafe dependency relying on Python 3.6

Bug #1937313 reported by Paul Goins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EasyRSA Charm
Fix Released
Undecided
Unassigned

Bug Description

I tried to deploy easyrsa on a Xenial LXD recently for test purposes, and found that it no longer deploys cleanly on Xenial. It does deploy fine on Bionic and Focal.

On Xenial, I can see this in the Juju unit log, assuming the unit log level is set to debug:

2021-07-22 20:47:09 DEBUG install Collecting MarkupSafe
2021-07-22 20:47:10 DEBUG install Complete output from command python setup.py egg_info:
2021-07-22 20:47:10 DEBUG install Traceback (most recent call last):
2021-07-22 20:47:10 DEBUG install File "<string>", line 1, in <module>
2021-07-22 20:47:10 DEBUG install File "/tmp/pip-install-000tad_z/MarkupSafe/setup.py", line 61, in <module>
2021-07-22 20:47:10 DEBUG install run_setup(True)
2021-07-22 20:47:10 DEBUG install File "/tmp/pip-install-000tad_z/MarkupSafe/setup.py", line 44, in run_setup
2021-07-22 20:47:10 DEBUG install ext_modules=ext_modules if with_binary else [],
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/__init__.py", line 145, in setup
2021-07-22 20:47:10 DEBUG install return distutils.core.setup(**attrs)
2021-07-22 20:47:10 DEBUG install File "/usr/lib/python3.5/distutils/core.py", line 121, in setup
2021-07-22 20:47:10 DEBUG install dist.parse_config_files()
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/dist.py", line 701, in parse_config_files
2021-07-22 20:47:10 DEBUG install ignore_option_errors=ignore_option_errors)
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 121, in parse_configuration
2021-07-22 20:47:10 DEBUG install meta.parse()
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 426, in parse
2021-07-22 20:47:10 DEBUG install section_parser_method(section_options)
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 399, in parse_section
2021-07-22 20:47:10 DEBUG install self[name] = value
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 184, in __setitem__
2021-07-22 20:47:10 DEBUG install value = parser(value)
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 514, in _parse_version
2021-07-22 20:47:10 DEBUG install version = self._parse_attr(value, self.package_dir)
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/site-packages/setuptools/config.py", line 349, in _parse_attr
2021-07-22 20:47:10 DEBUG install module = import_module(module_name)
2021-07-22 20:47:10 DEBUG install File "/var/lib/juju/agents/unit-easyrsa-0/.venv/lib/python3.5/importlib/__init__.py", line 126, in import_module
2021-07-22 20:47:10 DEBUG install return _bootstrap._gcd_import(name[level:], package, level)
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap>", line 986, in _gcd_import
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap>", line 969, in _find_and_load
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap_external>", line 661, in exec_module
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap_external>", line 767, in get_code
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap_external>", line 727, in source_to_code
2021-07-22 20:47:10 DEBUG install File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
2021-07-22 20:47:10 DEBUG install File "/tmp/pip-install-000tad_z/MarkupSafe/src/markupsafe/__init__.py", line 112
2021-07-22 20:47:10 DEBUG install return f"{self.__class__.__name__}({super().__repr__()})"
2021-07-22 20:47:10 DEBUG install ^
2021-07-22 20:47:10 DEBUG install SyntaxError: invalid syntax
2021-07-22 20:47:10 DEBUG install
2021-07-22 20:47:10 DEBUG install ----------------------------------------
2021-07-22 20:47:10 WARNING install Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-000tad_z/MarkupSafe/
2021-07-22 20:47:10 WARNING install Traceback (most recent call last):
2021-07-22 20:47:10 WARNING install File "/var/lib/juju/agents/unit-easyrsa-0/charm/hooks/install", line 8, in <module>
2021-07-22 20:47:10 WARNING install basic.bootstrap_charm_deps()
2021-07-22 20:47:10 WARNING install File "lib/charms/layer/basic.py", line 208, in bootstrap_charm_deps
2021-07-22 20:47:10 WARNING install env=_get_subprocess_env())
2021-07-22 20:47:10 WARNING install File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
2021-07-22 20:47:10 WARNING install raise CalledProcessError(retcode, cmd)
2021-07-22 20:47:10 WARNING install subprocess.CalledProcessError: Command '['/var/lib/juju/agents/unit-easyrsa-0/.venv/bin/pip', 'install', '-U', '--force-reinstall', '--no-index', '--no-cache-dir', '-f', 'wheelhouse', 'PyYAML', 'pbr', 'wheel', 'Jinja2', 'charmhelpers', 'six', 'netaddr', 'charms.reactive', 'pyaml', 'Tempita', 'MarkupSafe']' returned non-zero exit status 1
2021-07-22 20:47:10 ERROR juju.worker.uniter.operation runhook.go:139 hook "install" (via explicit, bespoke hook script) failed: exit status 1

The error occurs due to a Python 3.6 f-string, which won't work on Xenial's Python 3.5.

It may be necessary to pin MarkupSafe to an older version to preserve Xenial support for this charm.

Revision history for this message
Paul Goins (vultaire) wrote :

Alternatively, xenial could be removed as a supported release for easyrsa.

Revision history for this message
Paul Goins (vultaire) wrote :

It appears this was taken care of by Adam Dyess in July of this year, changeset 2f4ade054b861c41acc39ae7e24bd581f0c1cb13. Marking as done.

Changed in charm-easyrsa:
status: New → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Paul Goins (vultaire) wrote :

Released; earliest version is github tag 1.24+ck1, branch release_1.24. Also confirmed present in the trunk.

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.