Missing python3-yaml dependency in landscape-client package

Bug #2084586 reported by Andrey Janzen
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Committed
High
Mitch Burton
landscape-client (Ubuntu)
Status tracked in Plucky
Noble
In Progress
Undecided
Unassigned
Oracular
Fix Committed
Undecided
Unassigned
Plucky
Fix Released
Undecided
Mitch Burton

Bug Description

[ Impact ]

Versions of landscape-client >= 24.02 use python3-yaml to parse snap assertions. If this dependency is not installed, there is a Python import error and the landscape-client service cannot start. Often this package is installed for other reasons, so this issue is not commonly experienced. However, it should be explicitly fixed.

Bug is fixed by adding python3-yaml to Depends for landscape-client.

[ Test Plan ]

On noble or higher:

 1. remove python3-yaml:
    sudo apt remove python3-yaml
 2. install landscape-client:
    sudo apt install landscape-client
 3. attempt to register landscape-client with a server:
    sudo landscape-config

 4. Observe the following error:

Traceback (most recent call last):
  File "/usr/bin/landscape-config", line 12, in <module>
    from landscape.client.configuration import main
  File "/usr/lib/python3/dist-packages/landscape/client/configuration.py", line 19, in <module>
    from landscape.client.broker.config import BrokerConfiguration
  File "/usr/lib/python3/dist-packages/landscape/client/broker/config.py", line 4, in <module>
    from landscape.client.deployment import Configuration
  File "/usr/lib/python3/dist-packages/landscape/client/deployment.py", line 14, in <module>
    from landscape.client.snap_utils import get_snap_info
  File "/usr/lib/python3/dist-packages/landscape/client/snap_utils.py", line 3, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

[ Where problems could occur ]

 * If python3-yaml is for some reason unavailable to be installed, this change would block landscape-client from being installed.

==== Original bug report ====

The landscape-client package must have a `python3-yaml` dependency because without it the service fails to start:

```
Oct 15 19:17:13 n8n landscape-config[4271]: from landscape.client.broker.config import BrokerConfiguration
Oct 15 19:17:13 n8n landscape-config[4271]: File "/usr/lib/python3/dist-packages/landscape/client/broker/config.py", line 4, in <module>
Oct 15 19:17:13 n8n landscape-config[4271]: from landscape.client.deployment import Configuration
Oct 15 19:17:13 n8n landscape-config[4271]: File "/usr/lib/python3/dist-packages/landscape/client/deployment.py", line 14, in <module>
Oct 15 19:17:13 n8n landscape-config[4271]: from landscape.client.snap_utils import get_snap_info
Oct 15 19:17:13 n8n landscape-config[4271]: File "/usr/lib/python3/dist-packages/landscape/client/snap_utils.py", line 3, in <module>
Oct 15 19:17:13 n8n landscape-config[4271]: import yaml
Oct 15 19:17:13 n8n landscape-config[4271]: ModuleNotFoundError: No module named 'yaml'
```

Related branches

Revision history for this message
Mitch Burton (mitchburton) wrote :

Thanks for the bug report! I've verified that this is the case from version 24.02 forward.

Changed in landscape-client:
status: New → Confirmed
Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Mitch Burton (mitchburton) wrote :

python3-yaml needs to be added to debian/control.

Changed in landscape-client:
assignee: nobody → Mitch Burton (mitchburton)
importance: Undecided → High
status: Confirmed → Triaged
status: Triaged → In Progress
Revision history for this message
Mitch Burton (mitchburton) wrote :
Changed in landscape-client (Ubuntu):
assignee: nobody → Mitch Burton (mitchburton)
status: Confirmed → In Progress
assignee: Mitch Burton (mitchburton) → nobody
Revision history for this message
Mitch Burton (mitchburton) wrote :

Updated description to use SRU bug template in preparation for SRU to noble, oracular.

description: updated
Changed in landscape-client (Ubuntu):
assignee: nobody → Mitch Burton (mitchburton)
Revision history for this message
Andrey Janzen (andreyyantsen) wrote :

Thanks, Mitch!

Just to provide a bit more info: I've encountered the issue just because I'm using Landscape on a few Debian machines in my homelab.

Changed in landscape-client:
status: In Progress → Fix Committed
Revision history for this message
Lukas Märdian (slyon) wrote :
Changed in landscape-client (Ubuntu Plucky):
status: In Progress → Fix Committed
Revision history for this message
Lukas Märdian (slyon) wrote :

python3-yaml is in "main" for Oracular and Noble, so that should be fine.

Lukas Märdian (slyon)
Changed in landscape-client (Ubuntu Oracular):
status: New → In Progress
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

Sponsored for Plucky, Oracular & Noble.

For Noble, please remember that there's an SRU in noble-proposed, which is currently blocked (LP: #2052834)

Changed in landscape-client (Ubuntu Noble):
status: New → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Andrey, or anyone else affected,

Accepted landscape-client into oracular-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/24.08-0ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-oracular to verification-done-oracular. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-oracular. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in landscape-client (Ubuntu Oracular):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-oracular
Revision history for this message
Julian Andres Klode (juliank) wrote (last edit ):

Please have a look at fixing plucky, it's failing to build on a couple of architectures and not migrating.

Oracular looks good.

Noble needs to wait for the release of bug 2052834, or a reupload that re-includes that changelog entry in the changes file.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 24.08-0ubuntu3

---------------
landscape-client (24.08-0ubuntu3) plucky; urgency=medium

  * d/control: add python3-yaml dependency to landscape-client (LP: #2084586)
  * d/p/fix-plucky-tests.patch: fix unit tests on Twisted >= 24.10

 -- Mitch Burton <email address hidden> Fri, 29 Nov 2024 14:18:44 -0800

Changed in landscape-client (Ubuntu Plucky):
status: Fix Committed → Fix Released
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.