Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: need more than 1 value to unpack #1331

Closed
chetankabra opened this issue Oct 10, 2018 · 10 comments
Closed

ValueError: need more than 1 value to unpack #1331

chetankabra opened this issue Oct 10, 2018 · 10 comments

Comments

@chetankabra
Copy link

Description
I am running glances as a service using systemd on "Red Hat Enterprise Linux Server 7.5 (Maipo)" OS .
using Below command
.env/bin/python .env/bin/glances --quiet --export influxdb -C glances.conf

For an enhancement or new feature: Describe your needs.

Versions
Glances & psutil (glances -V): Glances v3.0.2 with psutil v5.4.7
Operating System (lsb_release -a): Red Hat Enterprise Linux Server 7.5 (Maipo)

Logs
Below is the service status.

proc.info = proc.as_dict(attrs=attrs, ad_value=ad_value)
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/init.py", line 526, in as_dict
ret = meth()
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/init.py", line 750, in io_counters
return self._proc.io_counters()
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/_pslinux.py", line 1459, in wrapper
return fun(self, *args, **kwargs)
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/_pslinux.py", line 1604, in io_counters
name, value = line.split(b': ')
ValueError: need more than 1 value to unpack

@nicolargo
Copy link
Owner

nicolargo commented Oct 13, 2018

@chetankabra thanks for the report.

The problem is in the PsUtil lib.

@giampaolo : It look like the giampaolo/psutil#1004 is back...

Note: related to #1183 (i close the other issue to only have one issue for this PsUtil problem).

@nicolargo nicolargo added the bug label Oct 13, 2018
@nicolargo nicolargo added this to the Next releases milestone Oct 13, 2018
@giampaolo
Copy link

Can you put a print(line) statement before the culprit line in psutil/_pslinux.py?

@giampaolo
Copy link

Alternatively also cat /proc/self/io is fine.

@chetankabra
Copy link
Author

rchar: 2012
wchar: 0
syscr: 7
syscw: 0
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0

@giampaolo
Copy link

giampaolo commented Oct 17, 2018

That looks fine so probably the problem occurs for a specific PID only. Can you identify the culprit PID and do cat /proc/{PID}/io?

@chetankabra
Copy link
Author

Hi @giampaolo ,

I have edited psutil/_pslinux.py to see the results: PFA
proc.info = proc.as_dict(attrs=attrs, ad_value=ad_value)
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/init.py", line 526, in as_dict
ret = meth()
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/init.py", line 750, in io_counters
return self._proc.io_counters()
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/_pslinux.py", line 1459, in wrapper
return fun(self, *args, **kwargs)
File "/var/data/monitoring-ui/.env/lib/python2.7/site-packages/psutil/_pslinux.py", line 1605, in io_counters
raise ValueError(line)
ValueError: 0

Thanks,
Chetan K

@giampaolo
Copy link

Please add this:

with open_binary(fname) as fd:
     print(repr(fd.read())

(I want to see the content of the file)

@chetankabra
Copy link
Author

Hi Giampaolo,

Contents of the files:

ValueError: ['rchar: 120', 'wchar: 1153', 'syscr: 9', 'syscw: 17', 'read_bytes: 0', 'write_bytes: 0', 'cancelled_write_bytes: 0', ' 0']

@giampaolo
Copy link

OK, I should have fixed this in giampaolo/psutil@7300bd4. If you want to confirm you can install latest psutil version from GIT/master but I think it's good.

@nicolargo
Copy link
Owner

Thanks to both of you !

@nicolargo nicolargo removed this from the Next releases milestone May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants