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

Smoketest fails with KeyError if no geth is installed #1237

Closed
ulope opened this Issue Jan 30, 2018 · 10 comments

Comments

Projects
None yet
7 participants
@ulope
Collaborator

ulope commented Jan 30, 2018

Problem Definition

If no geth binary is installed (or not on the PATH) on the user's system and no RST_GETH_BINARY env variable is defined raiden smoketest will fail with the following exception:

1/5] getting smoketest configuration
[2/5] starting ethereum
Traceback (most recent call last):
  File "build/raiden/raiden-script.py", line 2, in <module>
  File "raiden/__main__.py", line 11, in main
  File "click/core.py", line 722, in __call__
  File "click/core.py", line 697, in main
  File "click/core.py", line 1066, in invoke
  File "click/core.py", line 895, in invoke
  File "click/core.py", line 535, in invoke
  File "click/decorators.py", line 17, in new_func
  File "raiden/ui/cli.py", line 829, in smoketest
  File "raiden/tests/utils/smoketest.py", line 315, in start_ethereum
  File "string.py", line 130, in substitute
  File "string.py", line 123, in convert
  File "os.py", line 669, in __getitem__
KeyError: 'RST_GETH_BINARY'

The reason is that

Template(cmd).substitute(os.environ)
uses os.environ as the substitution dict and DEFAULT_ETH_COMMAND contains $RST_GETH_BINARY which won't be set if distutils.spawn.find_executable() returns None.

Solution

Verify that geth is available and if it isn't, inform the user with an actionable error message.

Tasklist

  • Verify geth is available in smoketest
  • Notify user and abort if it isn't
  • Add a changelog entry.
@Morito-Ikeda

This comment has been minimized.

Morito-Ikeda commented Feb 22, 2018

Can I work on this issue?
I would like to contribute to this community!

@palango

This comment has been minimized.

Collaborator

palango commented Feb 22, 2018

@Morito-Ikeda Sure! Let us know if you run into problems.

@gitcoinbot

This comment has been minimized.

gitcoinbot commented Apr 11, 2018

This issue now has a funding of 0.18 ETH (75.71 USD @ $420.64/ETH) attached to it.

  • If you would like to work on this issue you can claim it here.
  • If you've completed this issue and want to claim the bounty you can do so here
  • Questions? Get help on the Gitcoin Slack
  • $2748.31 more Funded OSS Work Available at: https://gitcoin.co/explorer
@gitcoinbot

This comment has been minimized.

gitcoinbot commented Apr 11, 2018

Work has been started on the 0.18 ETH (109.98 USD @ $610.98/ETH) funding by:

  1. @gcarq

Please work together and coordinate delivery of the issue scope. Gitcoin doesn't know enough about everyones skillsets / free time to say who should work on what, but we trust that the community is smart and well-intentioned enough to work together. As a general rule; if you start work first, youll be at the top of the above list ^^, and should have 'dibs' as long as you follow through.

On the above list? Please leave a comment to let the funder (@vs77bb) and the other parties involved what you're working, with respect to this issue and your plans to resolve it. If you don't leave a comment, the funder may expire your submission at their discretion.

@gitcoinbot

This comment has been minimized.

gitcoinbot commented Apr 12, 2018

Work for 0.18 ETH (77.35 USD @ $429.72/ETH) has been submitted by:

  1. @gcarq

Submitters, please leave a comment to let the funder (@vs77bb) (and the other parties involved) that you've submitted you work. If you don't leave a comment, the funder may expire your submission at their discretion.

@LefterisJP

This comment has been minimized.

Collaborator

LefterisJP commented Apr 12, 2018

The issue is solved by @gcarq.

I am not sure how gitcoin works from this point on.

@LefterisJP LefterisJP closed this Apr 12, 2018

@gcarq

This comment has been minimized.

Contributor

gcarq commented Apr 12, 2018

@vs77bb work has been submitted and issue is solved. I'm also not sure how gitcoin works from this point on.

schmir added a commit to schmir/raiden that referenced this issue Apr 23, 2018

smoketest: allow geth executable to be specified via RST_GETH_BINARY
This fixes a regression introduced in 3658169.
If an invalid RST_GETH_BINARY path is now specified, smoketest also bails out
early now.

While I'm here also use 'shutil.which' instead of
'distutils.spawn.find_executable'. The latter does not really care if the file
it returns is executable.

shutil.which has the added benefit of also handling absolute and relative paths.

see raiden-network#1353 and
raiden-network#1237
@gitcoinbot

This comment has been minimized.

gitcoinbot commented Apr 25, 2018

The funding of 0.18 ETH (109.98 USD @ $610.98/ETH) attached to this issue has been approved & issued to @gcarq.

@vs77bb

This comment has been minimized.

vs77bb commented Apr 25, 2018

@LefterisJP @gcarq Apologies for the delay, the bounty funding has been released!

@LefterisJP If you are the funder, you'll have access to 'Accept Submission' immediately once a submission is made (like @gcarq did)!

schmir added a commit to schmir/raiden that referenced this issue Apr 25, 2018

smoketest: allow geth executable to be specified via RST_GETH_BINARY
This fixes a regression introduced in 3658169.
If an invalid RST_GETH_BINARY path is now specified, smoketest also bails out
early now.

While I'm here also use 'shutil.which' instead of
'distutils.spawn.find_executable'. The latter does not really care if the file
it returns is executable.

shutil.which has the added benefit of also handling absolute and relative paths.

see raiden-network#1353 and
raiden-network#1237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment