iotop raises "UnboundLocalError: local variable 'pgpgin' referenced before assignment" in a ProxMox KVM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iotop (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Hello.
iotop just does not work in my ProxMox KVM boxes:
$ iotop
Traceback (most recent call last):
File "/usr/sbin/iotop", line 10, in <module>
from iotop.ui import main
File "/usr/lib/
from iotop.data import find_uids, TaskStatsNetlink, ProcessList, Stats
File "/usr/lib/
vmstat_f = VmStat()
File "/usr/lib/
self.vmstat = self.read()
File "/usr/lib/
return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment
PVE Version:
$ pveversion
proxmox-ve: 6.4-1 (running kernel: 5.4.143-1-pve)
Ubuntu version:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
Kernel version:
$ uname -a
Linux prd1frm201 5.4.0-1065-kvm #68-Ubuntu SMP Wed May 18 23:28:33 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
iotop version:
$ sudo iotop -h
Traceback (most recent call last):
File "/usr/sbin/iotop", line 10, in <module>
from iotop.ui import main
File "/usr/lib/
from iotop.data import find_uids, TaskStatsNetlink, ProcessList, Stats
File "/usr/lib/
vmstat_f = VmStat()
File "/usr/lib/
self.vmstat = self.read()
File "/usr/lib/
return pgpgin, pgpgout
UnboundLocalError: local variable 'pgpgin' referenced before assignment
$ sudo apt show iotop |& grep -i version
Version: 0.6-24-g733f3f8-1
Thank you for taking the time to report this bug and helping to make Ubuntu better.
It looks like "pgpgin" and "pgpgout" are missing from /proc/vmstat in your environment, and that's what's causing the crash. Looking at the current upstream master branch at https:/ /repo.or. cz/iotop. git/blob/ HEAD:/iotop/ vmstat. py this is a problem there too.
I'm not sure if iotop is expected to work correctly in an environment where these fields are missing, but this is really a question for iotop upstream.
To make progress, I suggest you contact upstream with this report, pointing them at this analysis. Details here: http:// guichaz. free.fr/ iotop/