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

manager: improve error messages for exec failures #2395

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

wchargin
Copy link
Contributor

Summary:
This gives users a more explicit error message for common configuration
errors, like virtualenvs with --system-site-packages that mix and
match packages and binaries across environments.

Test Plan:
Automated tests cover changes to manager.py. For notebook changes,
build the Pip package, and install it and IPython to a new virtualenv.
From an IPython shell, run through all the cases:

In [1]: %load_ext tensorboard
In [2]: import os
In [3]: os.environ["PATH"] = ""
In [4]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Could not find `tensorboard`. Please ensure that your PATH
contains an executable `tensorboard` program, or explicitly specify
the path to a TensorBoard binary by setting the `TENSORBOARD_BINARY`
environment variable.
In [5]: os.environ["TENSORBOARD_BINARY"] = "/not/likely"
In [6]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Could not find '/not/likely' (set by the `TENSORBOARD_BINARY`
environment variable). Please ensure that your PATH contains an
executable `tensorboard` program, or explicitly specify the path to a
TensorBoard binary by setting the `TENSORBOARD_BINARY` environment
variable.
In [7]: os.environ["TENSORBOARD_BINARY"] = "."  # EACCES
In [8]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Failed to start '.' (set by the `TENSORBOARD_BINARY`
environment variable): [Errno 13] Permission denied: '.'

wchargin-branch: manager-execfailed

Summary:
This gives users a more explicit error message for common configuration
errors, like virtualenvs with `--system-site-packages` that mix and
match packages and binaries across environments.

Test Plan:
Automated tests cover changes to `manager.py`. For notebook changes,
build the Pip package, and install it and `IPython` to a new virtualenv.
From an IPython shell, run through all the cases:

```
In [1]: %load_ext tensorboard
In [2]: import os
In [3]: os.environ["PATH"] = ""
In [4]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Could not find `tensorboard`. Please ensure that your PATH
contains an executable `tensorboard` program, or explicitly specify
the path to a TensorBoard binary by setting the `TENSORBOARD_BINARY`
environment variable.
In [5]: os.environ["TENSORBOARD_BINARY"] = "/not/likely"
In [6]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Could not find '/not/likely' (set by the `TENSORBOARD_BINARY`
environment variable). Please ensure that your PATH contains an
executable `tensorboard` program, or explicitly specify the path to a
TensorBoard binary by setting the `TENSORBOARD_BINARY` environment
variable.
In [7]: os.environ["TENSORBOARD_BINARY"] = "."  # EACCES
In [8]: %tensorboard --logdir logs
Launching TensorBoard...
ERROR: Failed to start '.' (set by the `TENSORBOARD_BINARY`
environment variable): [Errno 13] Permission denied: '.'
```

wchargin-branch: manager-execfailed
@wchargin wchargin requested a review from nfelt June 27, 2019 22:52
Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

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

Nice!

@wchargin wchargin merged commit 1065ddc into master Jun 28, 2019
@wchargin wchargin deleted the wchargin-manager-execfailed branch June 28, 2019 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants