pgwatch2
pgwatch2 copied to clipboard
Error in function "get_psutil_disk_io_total"
Hi team!.
A new version of the Postgresql 15.7 database has recently been installed
When it has been integrated into the latest version of pgwatch2 1.12, the following error appears in the database log.
2024-06-26 15:39:18.795 UTC [8593] ERROR: ValueError: not sure how to interpret line ' 8 0 sda 62956 9402 4310091 21401 8186 49209 1134839 11306 0 24799 32708 0 0 0 0\n'
2024-06-26 15:39:18.795 UTC [8593] CONTEXT: Traceback (most recent call last):
PL/Python function "get_psutil_disk_io_total", line 3, in <module>
dc = disk_io_counters(perdisk=False)
PL/Python function "get_psutil_disk_io_total", line 2013, in disk_io_counters
PL/Python function "get_psutil_disk_io_total", line 1075, in disk_io_counters
PL/Python function "get_psutil_disk_io_total"
2024-06-26 15:39:18.795 UTC [8593] STATEMENT: SET lock_timeout TO '100ms';SET statement_timeout TO '5s';
SELECT
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
read_count,
write_count,
read_bytes,
write_bytes
from
get_psutil_disk_io_total();
In previous versions we did not see this error.
What can be the cause?
Thanks!
Server context:
cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 (Ootpa)
$ cat /proc/diskstats
8 0 sda 69377 9477 4656811 24108 9390 49579 1165381 13722 0 28466 37831 0 0 0 0
8 1 sda1 1080 0 13660 113 18 8 4274 29 0 192 143 0 0 0 0
8 2 sda2 68250 9477 4640045 23976 9372 49571 1161107 13692 0 28398 37668 0 0 0 0
253 0 dm-0 48150 0 4399149 27288 9511 0 766955 16126 0 23876 43414 0 0 0 0
253 1 dm-1 28901 0 234864 7410 49269 0 394152 44694 0 5069 52104 0 0 0 0
$ yum list installed |grep -i psutil
python3-psutil.x86_64 5.4.3-11.el8 @rhel-8-for-x86_64-appstream-rpms
[postgres@pmmserver log]$ python3 --version
Python 3.6.8
pruebapw2=# \dx
List of installed extensions
Name | Version | Schema | Description
--------------------+---------+------------+------------------------------------------------------------------------
pg_stat_statements | 1.10 | public | track planning and execution statistics of all SQL statements executed
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
plpython3u | 1.0 | pg_catalog | PL/Python3U untrusted procedural language
(3 rows)