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

Authorize: errors with Address already in use #22

Open
franTarkenton opened this issue Feb 8, 2022 · 0 comments
Open

Authorize: errors with Address already in use #22

franTarkenton opened this issue Feb 8, 2022 · 0 comments

Comments

@franTarkenton
Copy link

going through the auth flow and am getting the following error:

Traceback (most recent call last):
  File "/home/kjnether/proj/googlephoto/src/authorize.py", line 30, in <module>
    service = authorize.init(constants.CLIENT_SECRET_FILE)
  File "/home/kjnether/.local/share/virtualenvs/googlephoto-H2bFJvmL/lib/python3.8/site-packages/gphotospy/authorize.py", line 55, in init
    credentials = get_credentials(secrets)
  File "/home/kjnether/.local/share/virtualenvs/googlephoto-H2bFJvmL/lib/python3.8/site-packages/gphotospy/authorize.py", line 34, in get_credentials
    credentials = app_flow.run_local_server()
  File "/home/kjnether/.local/share/virtualenvs/googlephoto-H2bFJvmL/lib/python3.8/site-packages/google_auth_oauthlib/flow.py", line 457, in run_local_server
    local_server = wsgiref.simple_server.make_server(
  File "/usr/lib/python3.8/wsgiref/simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
  File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.8/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/lib/python3.8/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

Not sure what is using the default port on my machine. Either way to get around it wanted to use custom port for the authorization. Resolved the issue by modifying this line to

if 'GPHOTOSPY_AUTH_PORT' in os.environ:
    credentials = app_flow.run_local_server(os.environ['GPHOTOSPY_AUTH_PORT'])
else:
    credentials = app_flow.run_local_server()
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

1 participant