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

RuntimeWarning: ignoring OSError... #1203

Closed
netlexer opened this issue Dec 15, 2017 · 20 comments
Closed

RuntimeWarning: ignoring OSError... #1203

netlexer opened this issue Dec 15, 2017 · 20 comments

Comments

@netlexer
Copy link

After the last glances package update on an up to date Arch linux system, glances now outputs the following lines to standard error:

/usr/lib/python3.6/site-packages/psutil/_pslinux.py:1153: RuntimeWarning: ignoring OSError(61, 'No data available')
warnings.warn("ignoring %r" % err, RuntimeWarning)

These lines are repeated during the program run, messing up the display. Redirecting the output

% glances 2> /dev/null

solves the immediate display problem, though this is obviously not ideal.

% glances -V
Glances v2.11.1 with psutil v5.4.1

As stated, this has only started happening after glances was upgraded (2.11.1-1 -> 2.11.1-2) a few days ago. No change to the installed version of python-psutil occurred during this time.

@nicolargo
Copy link
Owner

@giampaolo any idea where this PsUtil warning message came from ?

@netlexer
Copy link
Author

netlexer commented Dec 16, 2017

Some more information. Looking at the file referenced in the error above

   1144     for base in basenames:
   1145         try:
   1146             current = float(cat(base + '_input')) / 1000.0
   1147         except (IOError, OSError) as err:
   1148             # A lot of things can go wrong here, so let's just skip the
   1149             # whole entry.
   1150             # https://github.com/giampaolo/psutil/issues/1009
   1151             # https://github.com/giampaolo/psutil/issues/1101
   1152             # https://github.com/giampaolo/psutil/issues/1129
   1153             warnings.warn("ignoring %r" % err, RuntimeWarning)
   1154             continue
   1155

the first psutil issue quoted (1009) has a comment about disabled wireless devices. The laptop I'm running glances on is usually connected via an ethernet cable, not wifi. When I enable the wireless device the error messages disappear.

My original comments about this error appearing due to an upgrade were a misunderstanding on my part. These errors occur when the wifi is disabled, which is still an issue I think.

Hardware: HP 250 G5 Notebook Intel Core i5-6200U, Intel Wireless 3165 driver: iwlwifi.

@giampaolo
Copy link

@giampaolo any idea where this PsUtil warning message came from ?

Looks like it comes from sensors_temperatures.

@nicolargo
Copy link
Owner

@netlexer can you try to run Glances with the --disable-sensors option and tell us if the error message is stil displayed ?

@netlexer
Copy link
Author

With the --disable-sensors option the error message is still displayed, but only once, before the main glances screen is displayed; i.e. it doesn't repeat like before.

@ghost
Copy link

ghost commented Jan 2, 2018

I was getting the same and can confirm that --disable-sensors stops the error traceback.. but now the sensor displays aren't working (of course)

@Lu-Yi-Hsun
Copy link

i have same problem on arch manjaro python3.6
RequestsDependencyWarning: urllib3 (1.18.1) or chardet (3.0.4) doesn't match a supported version!

requests 2.18.4 has requirement urllib3<1.23,>=1.21.1, but you have urllib3 1.18.1.

@dwyart
Copy link

dwyart commented Feb 14, 2018

Same problem on Debian unstable, and confirmed it looks related to wifi sensor: when wifi is not disabled everything is fine.
Any hint about a next step to make progress?

Thanks

@richardallred
Copy link

+1 here on Fedora 27 Linux 4.15.3. When I disable wifi, I get this error, if I re-enable it, the error is resolved. Hope that helps.

@adocampo
Copy link

Same here, on a laptop with Arch and kernel 4.15.3 same error (and same workaround) happens. On a desktop computer with the same distro and kernel don't. So it seems something related to laptops. Enabling and disabling wifi on laptop doesn't help here.

@TJuberg
Copy link

TJuberg commented May 2, 2018

I'm seeing the same issue after upgrading to Fedora 28 with glances-2.11.1-2.fc28.noarch and python-psutil-5.4.3-4.fc28.src.rpm

WiFi is disabled in BIOS in my case

@cubanpit
Copy link

Same here on Glances v2.11.1 with psutil v5.4.5

Error messages look like this
/usr/lib/python3.6/site-packages/psutil/_pslinux.py:1160: RuntimeWarning: ignoring OSError(6, 'No such device or address') for file '/sys/class/hwmon/hwmon2/temp6_input' RuntimeWarning)

For every tempN that causes an error, the corresponding line in the output of sensors appears like this
temp6: N/A

@thorian93
Copy link

Just to push this, I have the same issue after a fresh install of Fedora 28 (all updates to day installed) with glances-2.11.1-2.fc28.noarch and python3-psutil-5.4.3-4.fc28.x86_64.
The --disable-sensors switch shows the same result as netlexer states. Contrary to TJuberg although, I have no hardware disabled at all.
Can I add anything more that may help?

@andrewbernard
Copy link

This is also happening on Ubuntu 18.04 LTS.

# glances -V
Glances v2.11.1 with psutil v5.4.2

@CvBeijsterveldt
Copy link

CvBeijsterveldt commented Jul 2, 2018

I'd like to add that I'm having the same issue on Arch Linux (4.17.3-1-ARCH) with Glances v2.11.1 with psutil v5.4.6. The complete error / warning message is /usr/lib/python3.6/site-packages/psutil/_pslinux.py:1160: RuntimeWarning: ignoring OSError(22, 'Invalid argument') for file '/sys/class/hwmon/hwmon3/temp1_input' RuntimeWarning)

The issue appears to be caused by a temperature sensor on my discrete AMD GPU, which doesn't provide a temperature if it is switched off (which it is most of the time, since I'm primarily using my integrated Intel GPU). This causes the temp1_input of that device to be unreadable, even cat /sys/class/hwmon/hwmon3/temp1_input lists it as an invalid argument. When using sensors it is displayed as N/A, using sensors -u gives the error ERROR: Can't get value of subfeature temp1_input: Can't read.

In that aspect, it is pretty much the same issue as the one with the disabled Wifi mentioned before, running glances with sensors disabled resolves the errors continuously being printed on the screen. Might there be a way to display N/A or something similar to cases such as these, or at least suppress the RuntimeWarnings?

@adocampo since you're also having this issue on a laptop and not on a desktop (which doesn't use hybrid graphics), might the issue in your case also be caused by a reading from the discrete GPU sensor?

@nicolargo
Copy link
Owner

@CvBeijsterveldt Hello, i just push a patch on the DEVELOP branch. Can you test it on your system ?

@CvBeijsterveldt
Copy link

Just checked out the develop branch and installed Glances v3.0.rc5 with psutil v5.4.6. Seems to be working perfectly: I get no more RuntimeWarnings and the sensors that are reporting temperature all seem to work.

@cubanpit
Copy link

cubanpit commented Aug 1, 2018

I can confirm that Glances v3.0.rc5 with psutil v5.4.6 behaves as expected.

@ghost
Copy link

ghost commented Aug 20, 2018

I have a similar problem on Mint 19 Cinnamon, and 'Glances v2.11.1 with psutil v5.4.2', when there is no network. For I see this before the program starts and subsequently the program's display is messed up:

/usr/lib/python3/dist-packages/psutil/_pslinux.py:1150: RuntimeWarning: ignoring OSError(61, 'No data available') warnings.warn("ignoring %r" % err, RuntimeWarning)

@nicolargo nicolargo changed the title Arch linux package (2.11.1-2) psutil (v5.4.1): RuntimeWarning: ignoring OSError RuntimeWarning: ignoring OSError... Jan 29, 2019
@FarisHijazi
Copy link

FarisHijazi commented Jun 28, 2021

Also happens on Ubuntu 18.04 Glances v2.11.1 with psutil v5.4.2
I have WiFi disabled. glances --disable-sensors fixes the issue

I would advise recommending to the user to use glances 2> /dev/null as a quick fix when any stderr is printed.

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