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 for RPC-attaching to a dockerized ganache in OSX. #995

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

mariuspod
Copy link
Contributor

@mariuspod mariuspod commented Mar 18, 2021

What I did

I've fixed the bug where OSX clients would get a psutil.AccessDenied exception when connecting to a dockerized ganache without sudo.

Fixes #992

How I did it

I've added an extra check for the platform.system() to handle OSX clients a bit differently due to the open issue in psutils: giampaolo/psutil#1219

Instead of querying all available network connections, I'm searching for the com.docker.backend process and attach to that. Added some tests for it as well.

How to verify it

On a mac run:

docker run -p 8545:8545 trufflesuite/ganache-cli

and then in another terminal:

brownie console

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

@iamdefinitelyahuman
Copy link
Member

Sorry, the recent merge of #998 likely caused a bunch of conflcts here 😬

@mariuspod mariuspod force-pushed the master branch 6 times, most recently from 899b0eb to 75c5722 Compare March 19, 2021 20:56
@mariuspod
Copy link
Contributor Author

No worries, I've rebased to master and added some tests to it.

Now I hope that all workflows become green 🤖

@mariuspod
Copy link
Contributor Author

build failed :-(
it seems it has to do something with the changed handling of StopIteration from python-3.8:
https://www.python.org/dev/peps/pep-0479/
need to refactor it a bit...

@mariuspod mariuspod marked this pull request as ready for review March 20, 2021 07:27
@mariuspod mariuspod changed the title WIP: Fix for RPC-attaching to a dockerized ganache in OSX. Fix for RPC-attaching to a dockerized ganache in OSX. Mar 20, 2021
@mariuspod
Copy link
Contributor Author

Made it backwards-compatible so we have code handling python-3.6 and newer versions which don't raise StopIteration in some generators anymore. Luckily, we have github workflows for different python versions so this issue came up 👍

Copy link
Member

@iamdefinitelyahuman iamdefinitelyahuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@iamdefinitelyahuman iamdefinitelyahuman merged commit e210868 into eth-brownie:master Mar 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.

Getting psutil.AccessDenied error on each and every run
2 participants