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

login command says "address already in use" but does not provide useful information #501

Open
chmreid opened this issue Dec 23, 2019 · 1 comment

Comments

@chmreid
Copy link
Contributor

chmreid commented Dec 23, 2019

When running the hca dss login command, I saw the following error message raised:

$ hca dss login
Traceback (most recent call last):
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/bin/hca", line 10, in <module>
    sys.exit(main())
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/hca/cli.py", line 134, in main
    result = parsed_args.entry_point(parsed_args)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/hca/util/__init__.py", line 587, in arg_forwarder
    return command(**command_args)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/hca/util/__init__.py", line 391, in login
    credentials = flow.run_local_server(success_message=msg, audience=self._audience)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 443, in run_local_server
    host, port, wsgi_app, handler_class=_WSGIRequestHandler)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/wsgiref/simple_server.py", line 153, in make_server
    server = server_class((host, port), handler_class)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/socketserver.py", line 453, in __init__
    self.server_bind()
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/socketserver.py", line 467, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use

At the time I had a Python simple http server running on port 8000, a Jupyter notebook running on port 8888, and a third python process on 8080. (it turns out 8080 was the problem port that the HCA CLI wanted to use.)

First, the hca login should not require the specific port 8080 to be open/reserved, since there are tens of thousands of ports available for use on a given machine. (In dss.utils there is a get_random_unused_tcp_port() method that would do this.)

Second, if the port that hca login chose is already in use, the command should at least print information about what port number is in use, so that the user can determine what process is running on that port and kill it. As is, there is no information provided to the user in the error message about which port/address is in use.

@amarjandu
Copy link
Contributor

IIRC the port that we select (8080) needs to be predetermined because its configured as a callback within Auth0. @Bento007 would be able to provide more information about this.

I think that informing the client about the port in use and how to kill the process might be easier to do.

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

2 participants