azai91 / alfred-drive-workflow

Alfred workflow to search google drive
MIT License
224 stars 23 forks source link

Auth fails with a 404 error #49

Closed roccojiang closed 6 years ago

roccojiang commented 6 years ago

A while ago the workflow started running very slowly for me so I decided to log out and log back in again in an attempt to solve the problem. However, once I tried to log back in, the browser fails with a 404 code. This issue seems similar to error #48 but there isn't a process running on port 1337 (at least I don't think so).

I'm running macOS 10.12.6 and Alfred v3.5.1 (883) on Opera. The logs are:

[2017-12-09 21:09:28.699] [61031] [ERROR] Already waiting for authentication: Address already in use - bind(2)
[2017-12-09 21:09:28.699] [61031]  [INFO] Requesting user authentication via browser
[2017-12-09 21:09:28.782] [61031] [FATAL] Uncaught exception: No access token
[2017-12-09 21:09:28.782] [61031] [FATAL] ./google-drive.rb:243:in `abort'
[2017-12-09 21:09:28.782] [61031] [FATAL] ./google-drive.rb:243:in `token'
[2017-12-09 21:09:28.782] [61031] [FATAL] ./google-drive.rb:320:in `get_items'
[2017-12-09 21:09:28.782] [61031] [FATAL] ./google-drive.rb:335:in `items'
[2017-12-09 21:09:28.782] [61031] [FATAL] ./google-drive.rb:499:in `<main>'
[2017-12-09 21:09:28.782] [61031] [DEBUG] Execution took 0.169 seconds

After this happened, I tried this on another laptop finding that I had been automatically logged out. However, the issue did not happen there and I was able to log back in successfully.

sorbits commented 6 years ago

This issue seems similar to error #48 but there isn't a process running on port 1337 (at least I don't think so).

Try open http://localhost:1337 in a browser (without doing anything with this workflow).

If you get a response, something is running on that port, which sounds like the most likely explanation, especially as the Alfred Google Drive code should not give you a “404” but rather say “Something went wrong” (browser response) and it would show Received HTTP request in the log, if it had been able to run the http server.

roccojiang commented 6 years ago

http://localhost:1337 returns 404 page not found.

sorbits commented 6 years ago

Then something is definitely running on that port. Try run something like this to find out what:

lsof -i -n -P | grep '1337.*TCP'