ppc64el: Subiquity Debug Shell PATH Breaks netplan

Bug #1975629 reported by Brett Holman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Undecided
Ubuntu on IBM Power Systems Bug Triage
subiquity
Fix Released
Undecided
Dan Bungert

Bug Description

While attempting to debug errors on cloud-init on ppc64el, I noticed what I believe is a bug.

[ Help ] -> [Enter shell]

Enters a shell that a user will likely want to use for debugging. However, netplan (and I suspect other python-based tools as well) are broken:

root@ubuntu-server:/# netplan try
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 84, in command_try
    if not self.is_revertable():
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 169, in is_revertable
    self.config_manager.parse(extra_config=extra_config)
  File "/usr/share/netplan/netplan/configmanager.py", line 175, in parse
    self._merge_yaml_config(yaml_file)
  File "/usr/share/netplan/netplan/configmanager.py", line 290, in _merge_yaml_config
    yaml_data = yaml.load(f, Loader=yaml.CSafeLoader)
AttributeError: module 'yaml' has no attribute 'CSafeLoader'. Did you mean: 'SafeLoader'?
root@ubuntu-server:/# python3
imPython 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> yaml.__version__
'5.3.1'
>>> quit()
root@ubuntu-server:/# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04 LTS"

I believe this is caused by PATH and PYTHONPATH:

root@ubuntu-server:/# echo $PATH
/snap/subiquity/3361/bin:/snap/subiquity/3361/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
root@ubuntu-server:/# echo $PYTHONPATH
/snap/subiquity/3361/lib/python3.8/site-packages

Overriding the settings allowed me to `netplan apply` and carry on as expected, but I don't think we want users to have to debug unexpected environment variables when they are trying to troubleshoot the system.

Brett Holman (holmanb)
description: updated
Dan Bungert (dbungert)
Changed in subiquity:
assignee: nobody → Dan Bungert (dbungert)
status: New → In Progress
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :
Revision history for this message
Dan Bungert (dbungert) wrote :

Thanks for the bug report, Brett. A fix has been committed.
If you would like to see the change, `sudo snap refresh --edge subiquity` should do it.

Changed in subiquity:
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Fix Committed
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
Frank Heimes (fheimes)
tags: added: installer ppc64el
Revision history for this message
Dan Bungert (dbungert) wrote :

This should be fix released by now, do you still see problems here Frank?

Revision history for this message
Frank Heimes (fheimes) wrote :

Hi Dan, oh - I haven't checked it.
I just went through the open bugs and did some updates, added tags, etc.

But since I now see that mwhudson's pull is merged, I agree that it must be in.

Hence closing this ticket as Fix Released! (Thx for the hint)

Changed in subiquity:
status: Fix Committed → Fix Released
Changed in ubuntu-power-systems:
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.