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

Fix psutil.AccessDenied on Windows #147

Merged
merged 1 commit into from
May 15, 2021
Merged

Fix psutil.AccessDenied on Windows #147

merged 1 commit into from
May 15, 2021

Conversation

chenseanxy
Copy link
Contributor

As per #67
It seems on windows, when iterating through processes, AccessDenied would occour on start_full_node.exe when process.name().

@swar
Copy link
Owner

swar commented May 9, 2021

I'm not sure why this hasn't been reported by anyone else honestly. I'm afraid adding this in and having AccessDenied on the manager will cause some unforeseen issues.

When you have this issue, is it only on start_full_node.exe?

@chenseanxy
Copy link
Contributor Author

chenseanxy commented May 13, 2021

Yeah it seems so (the pid that causes such problem is always start_full_node), and it happens even with elevated privilages.
This change should be safe, as the manager start process should be on the same privilage level as the manager process.

I'm on Windows Server 2019, Python 3.8, not using venv, and using out-of-the-box Adminstrator user (this is the default user for Server).

@chenseanxy
Copy link
Contributor Author

chenseanxy commented May 13, 2021

Also, #240 and #158.

BTW solution in #158 did not solve the issue (and I don't really have a python env problem since Python 3.8 is the only python deployed)

@chenseanxy
Copy link
Contributor Author

Also also, just to quote a psutil discussion:

Moreover: when iterating over processes you are deliberately encouraged to expect both AccessDenied and NoSuchProcess in your code and "continue" every time you incur into them because that is just how psutil is supposed be used

From here

@Dark-Sider
Copy link

I'm not sure why this hasn't been reported by anyone else honestly. I'm afraid adding this in and having AccessDenied on the manager will cause some unforeseen issues.

When you have this issue, is it only on start_full_node.exe?

I had the very same issue with a XBOX Live Bar process. On systems with many services this error is expected to occur as not every process can be access by every user!

@swar swar changed the base branch from main to development May 15, 2021 04:59
@swar swar merged commit 45c5f5b into swar:development May 15, 2021
@swar
Copy link
Owner

swar commented May 15, 2021

Good work @chenseanxy on all the research you put into this issue. Thank you.

@ggdada
Copy link

ggdada commented May 16, 2021

image
I tried to edit it, but it didn't work,this is run python manager.py view ,python manager.py start have not this problem.

@swar swar mentioned this pull request May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants