canonical / canonical/script-exporter-operator

Add 26.04 base

Open
#70 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
2
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Currently there is the Juju bug that prevents from having machine charms on 26.04 because of the failure of installing snaps.
Once this is fixed, we should add 26.04 to the list of platforms.
h/t @lucabello

```
unit-otelcol26-0: 10:21:03 ERROR unit.otelcol26/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-otelcol26-0/charm/lib/charms/operator_libs_linux/v2/snap.py", line 389, in _snap
return subprocess.check_output(args, text=True, stderr=subprocess.PIPE)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/subprocess.py", line 473, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs).stdout
^^^^^^^^^
File "/usr/lib/python3.14/subprocess.py", line 578, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['snap', 'install', 'opentelemetry-collector', '--revision="47"']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/var/lib/juju/agents/unit-otelcol26-0/charm/src/charm.py", line 934, in
ops.main(OpenTelemetryCollectorCharm)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/venv/lib/python3.14/site-packages/ops/__init__.py", line 360, in __call__
return _main.main(charm_class=charm_class, use_juju_for_storage=use_juju_for_storage)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/venv/lib/python3.14/site-packages/ops/_main.py", line 505, in main
manager = _Manager(charm_class, use_juju_for_storage=use_juju_for_storage)
File "/var/lib/juju/agents/unit-otelcol26-0/charm/venv/lib/python3.14/site-packages/ops/_main.py", line 318, in __init__
self.charm = self._charm_class(self.framework)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/src/charm.py", line 177, in __init__
self._install_snaps()
~~~~~~~~~~~~~~~~~~~^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/src/charm.py", line 624, in _install_snaps
install_snap(snap_name)
~~~~~~~~~~~~^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/src/snap_management.py", line 130, in install_snap
snap.ensure(state=snap_lib.SnapState.Present, revision=str(revision), classic=classic)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/lib/charms/operator_libs_linux/v2/snap.py", line 712, in ensure
self._install(channel, cohort, revision)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/lib/charms/operator_libs_linux/v2/snap.py", line 606, in _install
self._snap("install", args)
~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/var/lib/juju/agents/unit-otelcol26-0/charm/lib/charms/operator_libs_linux/v2/snap.py", line 392, in _snap
raise SnapError._from_called_process_error(msg=msg, error=e) from e
charms.operator_libs_linux.v2.snap.SnapError: Snap: 'opentelemetry-collector' -- command ['snap', 'install', 'opentelemetry-collector', '--revision="47"'] failed!
Stderr:
error: cannot perform the following tasks:
- Mount snap "snapd" (26865) (systemctl command [restart snap-snapd-26865.mount] failed with exit status 1: stderr:
Warning: The unit file, source configuration file or drop-ins of snap-snapd-26865.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
Job failed. See "journalctl -xe" for details.)

Latest logs:
Jul 03 08:05:01 juju-30004e-6 systemd[1]: Starting snapd.service - Snap Daemon...
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: overlord.go:309: Acquiring state lock file
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: overlord.go:314: Acquired state lock file
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: patch.go:64: Patching system state level 6 to sublevel 1...
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: patch.go:64: Patching system state level 6 to sublevel 2...
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: patch.go:64: Patching system state level 6 to sublevel 3...
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: daemon.go:276: started snapd/2.75.2+ubuntu26.04.2 (series 16; classic) ubuntu/26.04 (amd64) linux/6.19.0-9-generic.
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: daemon.go:370: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: backends.go:70: AppArmor status: apparmor is enabled and all features are available
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: backend.go:145: reloading profiles for snap-confine
Jul 03 08:05:01 juju-30004e-6 snapd[6669]: standby.go:95: will consider standby after: 5s
Jul 03 08:05:01 juju-30004e-6 systemd[1]: Started snapd.service - Snap Daemon.
Jul 03 08:05:03 juju-30004e-6 snapd[6669]: snapmgr.go:1661: performing periodic snap downloads cache cleanup
Jul 03 08:05:03 juju-30004e-6 snapd[6669]: snapmgr.go:1671: cannot clean store downloads cache: open /var/lib/snapd/cache: no such file or directory
Jul 03 08:05:03 juju-30004e-6 snapd[6669]: certmgr.go:84: No CA certificate database found, generating it now
Jul 03 08:20:55 juju-30004e-6 snapd[6669]: api_snaps.go:536: Installing snap "opentelemetry-collector" revision 47
Jul 03 08:21:01 juju-30004e-6 snapd[6669]: cache.go:243: removed 0 entries/ 0 from downloads cache
Jul 03 08:21:03 juju-30004e-6 snapd[6669]: taskrunner.go:304: Change 4 task (Mount snap "snapd" (26865)) failed: systemctl command [restart snap-snapd-26865.mount] failed with exit status 1: stderr:
Jul 03 08:21:03 juju-30004e-6 snapd[6669]: Warning: The unit file, source configuration file or drop-ins of snap-snapd-26865.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
Jul 03 08:21:03 juju-30004e-6 snapd[6669]: Job failed. See "journalctl -xe" for details.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading src/charm.py, especially the platform-related logic around the charm entry point and installation flow shown in the report. After the Juju snap-installation bug is fixed, add 26.04 to the platform list and verify that the charm recognizes it without triggering the reported installation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.