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

Auth fails (if another process is using port 1337) #48

Open
chevdor opened this issue Nov 17, 2017 · 4 comments
Open

Auth fails (if another process is using port 1337) #48

chevdor opened this issue Nov 17, 2017 · 4 comments

Comments

@chevdor
Copy link

chevdor commented Nov 17, 2017

Here is what I did:

  • install the wf
  • do a search
  • the wf request google drive access
  • I confirm
  • After click ALLOW, the browser opens http://127.0.0.1:1337/?code=<redacted> and fails with
  • {"statusCode":404,"error":"Not Found"}
@sorbits
Copy link
Collaborator

sorbits commented Nov 18, 2017

Please include log as described here.

Please also state OS version, version of Alfred, and the browser you are using.

@chevdor
Copy link
Author

chevdor commented Nov 18, 2017

OS: OSX 10.13.1
Alfred 3.5.1 (883)
I use Chrome.

The logs are:

[2017-11-18 15:15:26.113] [32240] [DEBUG] ./google-drive.rb ["--filter", "t"]
[2017-11-18 15:15:26.179] [32240] [ERROR] Already waiting for authentication: Address already in use - bind(2) for "127.0.0.1" port 1337
[2017-11-18 15:15:26.179] [32240]  [INFO] Requesting user authentication via browser
[2017-11-18 15:15:26.296] [32240] [FATAL] Uncaught exception: No access token
[2017-11-18 15:15:26.296] [32240] [FATAL] ./google-drive.rb:243:in `abort'
[2017-11-18 15:15:26.296] [32240] [FATAL] ./google-drive.rb:243:in `token'
[2017-11-18 15:15:26.296] [32240] [FATAL] ./google-drive.rb:320:in `get_items'
[2017-11-18 15:15:26.296] [32240] [FATAL] ./google-drive.rb:335:in `items'
[2017-11-18 15:15:26.296] [32240] [FATAL] ./google-drive.rb:499:in `<main>'
[2017-11-18 15:15:26.296] [32240] [DEBUG] Execution took 0.184 seconds
[2017-11-18 15:15:26.720] [32250] [DEBUG] ./google-drive.rb ["--filter", "te"]
[2017-11-18 15:15:26.788] [32250] [ERROR] Already waiting for authentication: Address already in use - bind(2) for "127.0.0.1" port 1337
[2017-11-18 15:15:26.788] [32250]  [INFO] Requesting user authentication via browser
[2017-11-18 15:15:26.877] [32250] [FATAL] Uncaught exception: No access token
[2017-11-18 15:15:26.877] [32250] [FATAL] ./google-drive.rb:243:in `abort'
[2017-11-18 15:15:26.877] [32250] [FATAL] ./google-drive.rb:243:in `token'
[2017-11-18 15:15:26.877] [32250] [FATAL] ./google-drive.rb:320:in `get_items'
[2017-11-18 15:15:26.878] [32250] [FATAL] ./google-drive.rb:335:in `items'
[2017-11-18 15:15:26.878] [32250] [FATAL] ./google-drive.rb:499:in `<main>'
[2017-11-18 15:15:26.878] [32250] [DEBUG] Execution took 0.158 seconds

I tried on a second machine and ran into the same issue.
The issue comes from a service already running on :1337. It is called corsproxy.
A workaround is to stop corsproxy and then do the auth.

Would it be an option to take a higher port? or check if the port is in used and jump to another?

@sorbits
Copy link
Collaborator

sorbits commented Nov 18, 2017 via email

@sorbits sorbits changed the title Auth fails with a 404 Error Auth fails with a 404 Error (if another process is using port 1337) Nov 19, 2017
@sorbits sorbits changed the title Auth fails with a 404 Error (if another process is using port 1337) Auth fails (if another process is using port 1337) Nov 19, 2017
@thomasrichner-oviva
Copy link

Run into the same problem. What helped: lsof -n -i:1337 lists the offending process, in my case Tunnelblick.
Killing it temporarily was enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants