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

[WIN 10] permission issue in 5.6.2 #1525

Closed
jeremad opened this issue Jun 6, 2019 · 2 comments
Closed

[WIN 10] permission issue in 5.6.2 #1525

jeremad opened this issue Jun 6, 2019 · 2 comments
Assignees

Comments

@jeremad
Copy link

jeremad commented Jun 6, 2019

Platform

  • Windows 10 pro
  • 5.6.2

Bug description
calling psutil.process_iter fails. It only fails when run by my CI process (gitlab-runner), and with 5.6.1, I have no error. It seems that it fails to handle permission error correctly, if I understand the code well

Traceback (most recent call last):
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 716, in wrapper
    return fun(self, *args, **kwargs)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 774, in exe
    exe = cext.proc_exe(self.pid)
PermissionError: [WinError 31] A device attached to the system is not functioning: '(originated from QueryFullProcessImageNameW)'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 773, in exe
    exe = self._proc.exe()
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 718, in wrapper
    raise convert_oserror(err, pid=self.pid, name=self._name)
psutil.AccessDenied: psutil.AccessDenied (pid=120, name='Registry')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 790, in cmdline
    ret = cext.proc_cmdline(self.pid, use_peb=True)
PermissionError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\jenkins\appdata\local\tanker\dmenv\venv\dev\3.6.7\sdk-js\src\ci\ci\js.py", line 71, in find_procs_by_name
    for p in psutil.process_iter(attrs=["name", "exe", "cmdline"]):
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 1566, in process_iter
    yield add(pid)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 1543, in add
    proc.info = proc.as_dict(attrs=attrs, ad_value=ad_value)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 638, in as_dict
    ret = meth()
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 775, in exe
    return guess_it(fallback=err)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 757, in guess_it
    cmdline = self.cmdline()
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\__init__.py", line 790, in cmdline
    return self._proc.cmdline()
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 718, in wrapper
    raise convert_oserror(err, pid=self.pid, name=self._name)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 708, in convert_oserror
    raise exc
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 716, in wrapper
    return fun(self, *args, **kwargs)
  File "C:\Users\jenkins\AppData\Local\Tanker\dmenv\venv\dev\3.6.7\sdk-js\lib\site-packages\psutil\_pswindows.py", line 793, in cmdline
    ret = cext.proc_cmdline(self.pid, use_peb=False)
OSError: [WinError 1168] Element not found: '(originated from NtQueryInformationProcess(ProcessBasicInformation))'
for p in psutil.process_iter(attrs=["name", "exe", "cmdline"]):
    print p
@giampaolo
Copy link
Owner

Duplicate of #1501. I just released psutil 5.6.3 which fixes this.

@jeremad
Copy link
Author

jeremad commented Jun 11, 2019

I confirm the issue is fixed on 5.6.3, thank you very much

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

2 participants