systemd.journal not imported correctly by lpci runner when running pylint via pre-commit hook

Bug #2054804 reported by Tim Andersson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lpci
New
Undecided
Unassigned

Bug Description

We [5] started having CI failures (I'm not sure exactly when) with this error [1]:

:: charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker:33:0: E0611: No name 'journal' in module 'systemd' (no-name-in-module)
:: charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker:33:0: E0401: Unable to import 'systemd.journal' (import-error)
:: charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker:67:26: E1101: Module 'systemd' has no 'journal' member (no-member)

This was not at all reproducible locally, and I checked the pylint paths and made sure the module was correctly installed on the CI runner - it was. I spent a long time trying to debug this, but I eventually just decided to mask the errors with the pylintrc. It's not a big issue and probably something to do with the pylint version - I've seen similar bug reports [2] which seemed to get solved with newer pylint versions, but obviously in the lpci runner we just install the package version for that release (focal in this case - which we have to use as that's what our prod environment is running) and it's a bit finnicky to do otherwise.

For a reproducer, you can clone [3], and checkout [4]. If you push to launchpad as a fork, you'll see the CI failures in the runner, but running lpci run locally you will see no such failures.

[1] https://launchpadlibrarian.net/715605857/buildlog_ci_autopkgtest-cloud_df949e5544820f195b5094b402dd6d0f97a2ef8a_BUILDING.txt.gz
[2] https://github.com/pylint-dev/pylint/issues/5645
[3] https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+ref/master
[4] df949e5544820f195b5094b402dd6d0f97a2ef8a
[5] Canonical Ubuntu QA/Release Management Team

description: updated
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.