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

Getting an ERR_EMPTY_RESPONSE error on my browser whenever I try to login #51

Closed
TheSmallBlue opened this issue Aug 5, 2020 · 7 comments

Comments

@TheSmallBlue
Copy link

Here's the only piece of code running:

from pydrive2.auth import GoogleAuth
from pydrive2.drive import GoogleDrive

#GDrive login
g_login = GoogleAuth()
g_login.LocalWebserverAuth()
drive = GoogleDrive(g_login)

When running it, it asks me to choose a google account, after doing so it tells me "this app isnt verified" and I click on "run anyway" since its MY app, then it asks me to grant my app permissions, on which I click "allow", then it brings me to another permission screen in which I click "allow" again. (Screenshot is that screen, with my email and app name censored just in case)
image
After clicking "allow", a blue loading bar appears on the top and it keeps loading until it takes me to the Chrome "ERR_EMPTY_RESPONSE" error screen:
image
I'm pretty sure it's more of a Google cloud issue, but its reporting no errors so i dont really know. Do note that I'm still quite new to Python and stuff so I might just be dumb, but hey, better safe than sorry I guess

@shcheklein
Copy link
Member

I've tried it and was not able to reproduce it. Most likely something is wrong with your Application settings (redirect URI is wrong?) or some environment problem.

Could you check the redirect_uris value in the client_secrets.json?
Could you run it with browsers tools enabled in the preserve logs mode and see the flow - what URL does it try to hit at the very end?

@TheSmallBlue
Copy link
Author

I'm honestly very confused?
I checked the clients_secrets.json files, and to make sure that the redurect_uris value were the correct ones, I re-downloaded the client secret file from the Google Cloud, and sure enough it was all good, but out of curiosity I replaced the old client_secrets.json with the new one, and same issue as before. Didn't fix anything.
Next thing I did was running the process with browser tools, so I went through enabling preserve logs and stuff, then tried to go through the authentication process again and this time it actually worked no problems, tried it once more after that and worked fine again, even though since my last test to this one nothing changed.
This is where I'd say "Problem solved!" But then I remembered a bunch of things I forgot to mention on my original Issue:
I had this problem on the OG PyDrive, and after going to the github and seeing just how dead it was, I replaced it with PyDrive2 in my code to see if the issue was fix, it wasn't, so I made this issue.
When I first encountered this problem was about a month ago, same exact issue, at the time I had other stuff to take care of so I didn't give it much attention, but later in the day I sat down to see if I could actually fix it and again, worked flawlessly with no changes at all.
Looking back this all sounds weeeeird, almost as if it didnt work on specific times of the day, which makes 0 sense.
Hopefully some magic happened and its fixed now, but it might break again tomorrow morning, honestly no clue.
I also would love to post the console logs and the redirect_uris value, but I dont know if they contain sensitive information.

@TheSmallBlue
Copy link
Author

Immediately after finishing writing the thing above, I tried to run the program again and it didn't work, then once more and it didn't work again, then another time and it worked!, then another, and it worked!, then another, and it didn't work, and so on and so forth, randomly working and not, always the same "ERR_EMPTY_RESPONSE" if it didn't work. I have no idea what it is, but on the bright side I now know what URL it tries to hit at the very end! 17:43:43.185 VM485:1 XHR finished loading: POST "https://accounts.google.com/_/common/diagnostics/?hl=en&_reqid=163770&rt=j". <- it stays on this for a while then moves on to 17:44:49.945 Navigated to chrome-error://chromewebdata/. On the XHR thing there are a lot of weird numbers and "unknownerror"s and "(anonymous)" things that make me thing that this isn't what you ask and that I also don't know if it has sensitive information but I guess one of you will tell me.

@TheSmallBlue
Copy link
Author

So uh, any idea whats causing this? Any way I can fix this? Any more info I could upload to make the problem clearer?

@shcheklein
Copy link
Member

@TheSmallBlue hmm. It's not that easy to figure out what's going on w/o access to the environment. It can be pretty much anything. Do you use proxy servers? Could you try a different internet connection? A different browser, different machine? Just to isolate it somehow first.

@TheSmallBlue
Copy link
Author

No, I don't use proxy servers as far as I know.
Only other internet connection I have on hand is my phone's 4g connection, and it didn't work there either. Same error.
Tried on a different browser, same error.
Tried it on my phone with both wifi and 4g, both times same error

Unrelated to what you've asked, I also tried deleting my cookies and cache, which did nothing, and making an entirely new app in the google cloud, which also did nothing. Same error screen.

@shcheklein
Copy link
Member

Closing as not directly related to PyDrive. Please feel free to reopen if you see this problem again.

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

2 participants