ppc64el: Subiquity Debug Shell PATH Breaks netplan

Bug #1975629 reported by Brett Holman
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Committed
Ubuntu on IBM Power Systems Bug Triage
Fix Committed
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>
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
  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
  File "/usr/share/netplan/netplan/configmanager.py", line 175, in parse
  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__
>>> 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
root@ubuntu-server:/# echo $PYTHONPATH

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)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers