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

Errors from local testnet scripts on MacOS #2763

Closed
pkopparla opened this issue Nov 2, 2021 · 11 comments
Closed

Errors from local testnet scripts on MacOS #2763

pkopparla opened this issue Nov 2, 2021 · 11 comments
Assignees

Comments

@pkopparla
Copy link

Description

The script lighthouse/scripts/local_testnet/start_local_testnet.sh does not run and throws errors.

Version

rustc 1.55.0
Lighthouse v2.0.1-fff01b2, I'm using the stable version.

Present Behaviour

The script errors out with ./start_local_testnet.sh: eval: line 73: syntax error near unexpected token '>'

Expected Behaviour

It should start a local testnet.

Steps to resolve

The problem is with line 70 of the script which is currently:

CMD="$EX_NAME $@ &>> $LOG_DIR/$LOG_NAME"

If you change this to:

CMD="$EX_NAME $@ & $LOG_DIR/$LOG_NAME"

then the ./start_local_testnet.sh script will work, however the ./stop_local_testnet.sh will fail to stop the processes. The PIDS are logged incorrectly in the PIDS.pid file within the test directory. Changing the line further to

CMD="$EX_NAME $@ &"

logs the correct PIDS, though there are still a few unknown PIDS being logged. I don't know if this problem occurs on other OS, but at least one other person can reproduce the problem and solution on their Mac computer.

@ackintosh
Copy link
Member

I'm working on this issue. #2919

The redirect &>> is supported since bash v4 but the version bundled in macOS(11.6.1) is v3.

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.

bors bot pushed a commit that referenced this issue Jan 26, 2022
## Issue Addressed

Resolves #2763

## Proposed Changes

- Add a workflow which tests that local testnet starts successfully
  - Added `set` option into the scripts in order to fail fast so that we can notice errors during starting local testnet.
- Fix errors on MacOS
  - The redirect `&>>` is supported since bash v4 but the version bundled in macOS(11.6.1) is v3. a54f119
@ackintosh
Copy link
Member

@pkopparla #2919 has been merged into unstable branch, please give it a try.

@pkopparla
Copy link
Author

@ackintosh Thanks for doing this, I'll check and get back to you.

@winksaville
Copy link
Contributor

@pkopparla, thanks!

@pkopparla
Copy link
Author

Hey, I just tried this out on unstable and it didn't work. This is what happened:

local_testnet % ./start_local_testnet.sh 
killing
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

@michaelsproul
Copy link
Member

@pkopparla Which version of macOS?

@pkopparla
Copy link
Author

@michaelsproul It's MacOS Moneterey, v 12.0.1
I'm a fan of your client diversity work, very cool stuff.

@ackintosh
Copy link
Member

ackintosh commented Jan 29, 2022

I could reproduce the error. 💡

# Put PIDS.pid file which contains only newlines.
$ echo "" > ~/.lighthouse/local-testnet/testnet/PIDS.pid

$ ./start_local_testnet.sh
killing
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

As workaround, deleting the PIDS.pid file or running clean.sh could resolve this.

$ rm ~/.lighthouse/local-testnet/testnet/PIDS.pid
# or
$ ./clean.sh

@ackintosh
Copy link
Member

I will file a PR to handle the issue.

bors bot pushed a commit that referenced this issue Jan 31, 2022
## Issue Addressed

Resolves #2763 (comment)

## Proposed Changes

- Skip if the line is blank. 👌
@ackintosh
Copy link
Member

#2973 has been merged into unstable branch.

@pkopparla
Copy link
Author

@ackintosh I can confirm that the script works now. Thanks for taking time to work on this!

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

No branches or pull requests

5 participants
@winksaville @ackintosh @michaelsproul @pkopparla and others