UnboundLocalError Python error when running `ubuntu-drivers autoinstall`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-drivers-common (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
As part of the Certification regression testing process, we automatically provision devices in our Certification lab with different versions of Ubuntu to make sure no regressions are introduced during the SRU process.
Recently, we got an issue when trying to provision Ubuntu 22.04 on a device with a Nvidia GPU. The Nvidia drivers should be installed with the ubuntu-drivers autoinstall command, however when run, the following exception is thrown:
ubuntu@
== /sys/devices/
modalias : pci:v000010DEd0
vendor : NVIDIA Corporation
driver : nvidia-
driver : nvidia-
driver : nvidia-
driver : nvidia-driver-535 - distro non-free
driver : nvidia-
driver : nvidia-
driver : nvidia-driver-470 - distro non-free
driver : nvidia-
driver : nvidia-
driver : nvidia-driver-545 - distro non-free
driver : nvidia-driver-525 - distro non-free
driver : xserver-
== /sys/devices/
modalias : pci:v00008086d0
vendor : Intel Corporation
driver : oem-stella-
+ _run sudo ubuntu-drivers autoinstall
+ ssh -t -o StrictHostKeyCh
Traceback (most recent call last):
File "/usr/bin/
greet()
File "/usr/lib/
return self.main(*args, **kwargs)
File "/usr/lib/
rv = self.invoke(ctx)
File "/usr/lib/
return _process_
File "/usr/lib/
return ctx.invoke(
File "/usr/lib/
return __callback(*args, **kwargs)
File "/usr/lib/
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/
return __callback(*args, **kwargs)
File "/usr/bin/
command_
File "/usr/bin/
UbuntuDrive
File "/usr/lib/
with_nvidia_kms = version >= 470
UnboundLocalError: local variable 'version' referenced before assignment
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 5.15.0-100-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CloudArchitecture: x86_64
CloudID: maas
CloudName: maas
CloudPlatform: maas
CloudSubPlatform: seed-dir (http://
Date: Thu Feb 15 21:53:15 2024
InstallationDate: Installed on 2022-05-10 (646 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: ubuntu-
UpgradeStatus: No upgrade log present (probably fresh install)
This looks very similar to lp:1995158, but I wanted to complete the `ubuntu-bug` process in order to capture the logs for that machine.