alfred-drive-workflow icon indicating copy to clipboard operation
alfred-drive-workflow copied to clipboard

Auth fails (if another process is using port 1337)

Open chevdor opened this issue 8 years ago • 4 comments

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"}

chevdor avatar Nov 17 '17 16:11 chevdor

Please include log as described here.

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

sorbits avatar Nov 18 '17 00:11 sorbits

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?

chevdor avatar Nov 18 '17 14:11 chevdor

The port number is part of the OAuth client setup and cannot be dynamically changed, but we can do new client credentials.

Though the current client credentials are setup and controlled by @azai91 so I think it should be his call, if we should jump to another port. Personally I do find 1337 to be a non-ideal port to use for “production” software.

On 18 Nov 2017, at 21:28, Chevdor wrote:

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?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/azai91/alfred-drive-workflow/issues/48#issuecomment-345445637

sorbits avatar Nov 18 '17 14:11 sorbits

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

thomasrichner-oviva avatar Mar 16 '18 09:03 thomasrichner-oviva