Bug 1479740 - import psutil fails frequently
import psutil fails frequently
Status: ON_QA
Product: Fedora EPEL
Classification: Fedora
Component: python-psutil (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Infrastructure SIG
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-08-09 06:05 EDT by Xavier Bachelot
Modified: 2018-01-25 20:02 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Xavier Bachelot 2017-08-09 06:05:17 EDT
Description of problem:
We are using the python-psutil package on EL6 and are frequently encountering the following error :

Traceback (most recent call last):
File "/tmp/ansible_6ujUs4/ansible_module_wait_for.py", line 34, in
import psutil
File "/usr/lib64/python2.6/site-packages/psutil/__init__.py", line 64, in
import psutil._pslinux as _psplatform
File "/usr/lib64/python2.6/site-packages/psutil/_pslinux.py", line 86, in
_TERMINAL_MAP = _psposix._get_terminal_map()
File "/usr/lib64/python2.6/site-packages/psutil/_psposix.py", line 116, in _get_terminal_map
ret[os.stat(name).st_rdev] = name
OSError: [Errno 2] No such file or directory: '/dev/pts/0'

Version-Release number of selected component (if applicable):

How reproducible:
Not always, but very frequently.

I've taken a look at upstream bug tracker and it seems to be :
which is fixed in this commit :
so I believe this is fixed in psutil 0.7.0

In order to try and fix the bug on our side, I rebuilt an rpm based on the epel7 branch, which currently ships python-psutil 2.2.1.
This cured the bug for us.

So, could you please update the el6 branch to match what's in the epel7 branch ?

Comment 1 Xavier Bachelot 2017-11-28 06:39:10 EST
gentle ping. We've been using the locally updated python-psutil 2.2.1 package on EL6 with no issue for several months.
Comment 2 Fedora Update System 2017-11-30 16:37:02 EST
python-psutil-2.2.1-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1290b498a8
Comment 3 Fedora Update System 2017-12-02 03:31:43 EST
python-psutil-2.2.1-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1290b498a8
Comment 4 Vincent Brillault 2017-12-08 08:20:36 EST
python-psutil 2.2.1 is a huge (incompatible) jump in version from 0.6.1, in particular with regard to the Process.{,set_}{,io}nice API:
* In 0.6.1, Process.{,io}nice are deprecated properties and Process.{get,set}_{,io}nice should be used to get and change the {,io}nice
* In 2.2.1, Process.{,io}nice are methods and Process.{get,set}_{,io}nice are deprecated and raise a warning

Here are two reproducers:
python -c "import os;import psutil; p = psutil.Process(os.getpid()); p.set_nice(18); p.set_ionice(psutil.IOPRIO_CLASS_BE, 6)"
python -c "import os;import psutil; p = psutil.Process(os.getpid()); p.nice(18); p.ionice(psutil.IOPRIO_CLASS_BE, 6)"

* When using 0.6.1, the 1st works properly and the 2nd results in:
-c:1: DeprecationWarning: this property is deprecated; use Process.get_nice() method instead
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: 'int' object is not callable

* When using 2.2.1, the 2nd works properly and the 1st results in:
-c:1: DeprecationWarning: set_nice() is deprecated; use nice() instead
-c:1: DeprecationWarning: set_ionice() is deprecated; use ionice() instead

Note You need to log in before you can comment on or make changes to this bug.