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

Nice info message if not on correct network? #153

Open
rsignell-usgs opened this issue Mar 26, 2022 · 2 comments
Open

Nice info message if not on correct network? #153

rsignell-usgs opened this issue Mar 26, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@rsignell-usgs
Copy link
Contributor

I forgot to get on the VPN, and of course errored out with "No address associated with hostname". Would it be a common enough user issue to issue an Info comment back of something like "Not found on current network. Do you need to be on your VPN?" or something?

************************************************************************************** Authenticating **************************************************************************************
Authenticating user (rsignell) from client (IGSAGIEGLTRSI10) to remote host (denali.cr.usgs.gov)
Traceback (most recent call last):
  File "/home/rsignell/mambaforge/envs/jupyter/bin/jupyter-forward", line 33, in <module>
    sys.exit(load_entry_point('jupyter-forward', 'console_scripts', 'jupyter-forward')())
  File "/home/rsignell/github/jupyter-forward/jupyter_forward/cli.py", line 103, in main
    typer.run(app())
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/rsignell/github/jupyter-forward/jupyter_forward/cli.py", line 88, in start
    runner = RemoteRunner(
  File "<string>", line 12, in __init__
  File "/home/rsignell/github/jupyter-forward/jupyter_forward/core.py", line 60, in __post_init__
    self._authenticate()
  File "/home/rsignell/github/jupyter-forward/jupyter_forward/core.py", line 76, in _authenticate
    self.session.open()
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/fabric/connection.py", line 636, in open
    self.client.connect(**kwargs)
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/paramiko/client.py", line 340, in connect
    to_try = list(self._families_and_addresses(hostname, port))
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/site-packages/paramiko/client.py", line 203, in _families_and_addresses
    addrinfos = socket.getaddrinfo(
  File "/home/rsignell/mambaforge/envs/jupyter/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname
@kmpaul
Copy link

kmpaul commented Mar 26, 2022

That sounds reasonable. It's an error coming from Python's builtin socket module indicating a DNS resolution error, I think. That could happen due to a typo in the domain name, too.

Should we catch the error in Jupyter-forward and reraise an error with a better message? Or should we propose an improved error message upstream? If so, where? Paramiko?

@kmpaul
Copy link

kmpaul commented Mar 28, 2022

CC @mnlevy1981 @andersy005

@andersy005 andersy005 added the enhancement New feature or request label Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants