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

"Google login failed! Check your login information.NULL" #103

Closed
rajeshwarimajumdar opened this issue Jul 21, 2016 · 62 comments
Closed

"Google login failed! Check your login information.NULL" #103

rajeshwarimajumdar opened this issue Jul 21, 2016 · 62 comments

Comments

@rajeshwarimajumdar
Copy link

I am trying to use the gconnect function but I'm getting the following error:

"Google login failed! Check your login information.NULL"

I've used this function multiple times in the recent past but it's suddenly stopped working.

I'm using the following to run the function:

user="reuwpi@gmail.com"
pass = "honeyfarms"
gconnect(user,pass)

Any help would be much appreciated.

@eddelbuettel
Copy link
Collaborator

Please search in the closed issue tickets. This has been discussed numerous times, and is likely due to your account settings.

For what it is worth, I use a distinct account for these queries...

@rajeshwarimajumdar
Copy link
Author

I did look at the previous posts.

I tried multiple accounts (personal, friends', and the above throwaway), all of which had 2-step verification turned off. I got the same error each time. For what it's worth, I also tried different computers on different networks.

Is there anything else I can try?

@eddelbuettel
Copy link
Collaborator

Hm, now I am stumped.

@PMassicotte
Copy link
Owner

Same. I have problem to log with my account too. I will investigate it.

@omartvit
Copy link

I have just read this issue!.
Sorry, but I have opened a new issue with the same doubts two hours ago.
I have just tried to log, but I still have the same problem.
Thanks so much to investigate it!,
I look forward to hearing your opinion. Best.

@PMassicotte
Copy link
Owner

Looks like Google changed something with authentication. I have no clue at the moment.

@eddelbuettel
Copy link
Collaborator

😢

I looked briefly this morning but could only notice the '400' return. That's the trouble with unofficial access points. Sometimes they just go. Also no clue from here, and have not heard if other Google Auth sites have similar issues...

@MrLoh
Copy link

MrLoh commented Jul 24, 2016

I'm encountering the same issues. Very sad. Any way we could help?

@omartvit
Copy link

Hi!,

I have been working on this during the weekend, and I have found this:
https://christophriedl.net/2013/08/22/google-trends-with-r/
This authentication works, I have thought that It could give you a clue.

Thanks!

2016-07-22 20:50 GMT+02:00 Philippe Massicotte notifications@github.com:

Looks like Google changed something with authentication. I have no clue at
the moment.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATpAcKBBxn8utOg2GBIG9gVbhRCN4AZQks5qYRDagaJpZM4JSPwW
.

@flovv
Copy link

flovv commented Jul 25, 2016

@omartvit

thanks for sharing. I just tried the code and it does not work for me.
The authentication seems to work fine but if you try to call the google trends api, you do not receive the results.

Best,
florian

@omartvit
Copy link

@flovv

It's right, the code doesn't work. You can't get the data from google, but
the authentication process looks like it works. Maybe, it could be a way to
solve the authentication process in gTrendsR.

Best.

El 25/07/2016 10:05, "flovv" notifications@github.com escribió:

@omartvit https://github.com/omartvit

thanks for sharing. I just tried the code and it does not work for me.
The authentication seems to work fine but if you try to call the google
trends api, you do not receive the results.

Best,
florian


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATpAcGOvtTLUvEuic0Sh4PCx15bKTkCWks5qZG5SgaJpZM4JSPwW
.

@PMassicotte
Copy link
Owner

PMassicotte commented Jul 25, 2016

I found out that the python version is still working.

https://github.com/GeneralMills/pytrends

I have been able to run this code and get results.

It is related to cookies.

https://github.com/GeneralMills/pytrends/blob/master/pytrends/pyGTrends.py#L74-L76

Mostly occurring here:

authenticatePage2 <- getURL("https://www.google.com/accounts/CheckCookie?chtml=LoginDoneHtml", curl = ch)
getCurlInfo(ch)$response.code

This should return 200, not 400.

I am not fluent in python, so feel free to have a look and propose a PR.

@eddelbuettel
Copy link
Collaborator

eddelbuettel commented Jul 25, 2016

Nice bisection to another language/project!

Random other idea: might it be worthwhile to try this with the curl package as opposed to the older RCurl? Some of the users of curl may have an idea too ...

@omartvit
Copy link

So... That means that it is not possible to fix the gTrendsR package? :(

Thanks.

El 25/07/2016 16:03, "Dirk Eddelbuettel" notifications@github.com
escribió:

Nice bisection to another language/project!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATpAcLVg0JwDPji9t9HGY39vRYt2PvXBks5qZMJHgaJpZM4JSPwW
.

@MrLoh
Copy link

MrLoh commented Jul 26, 2016

No, it means that it is fixable. Just needs someone to really look into it. I really don't have time to look into it at the moment. But hopefully someone else will.

@PMassicotte
Copy link
Owner

Everything is fixable. Just need to find the time to do it.

@PMassicotte
Copy link
Owner

@eddelbuettel using curl seems a good idea.

@eddelbuettel
Copy link
Collaborator

Also may be worth reaching out to the folks having worked with Google auth from R. Aren't there some other packages? We could ping Jenny Bryan ...

@MarkEdmondson1234
Copy link

@eddelbuettel I guess I count as one of those as maintainer of googleAuthR but that is all using the OAuth2 official authentication.

I think httr (that uses curl) could handle it by POSTing in the login as it handles cookies etc, but if needs be perhaps a more heavyweight solution is rvest that scrapes behind logins.

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

I had a quick look at rvest. The following seems to work:

library(magrittr)

email = "test@gmail.com"
password = "xxxx"
url = "https://www.google.com/trends/trendsReport?q=test&cat=0&content=1&export=1"

session = rvest::html_session("https://accounts.google.com/accounts/ServiceLogin")

form = session %>% rvest::html_node("form") %>% rvest::html_form() %>%
    rvest::set_values(Email=email)

session %<>% rvest::submit_form(form) 

form = session %>% rvest::html_node("form") %>% rvest::html_form() %>%
    rvest::set_values(Passwd=password)

session %<>% rvest::submit_form(form) 

result = session %>% rvest::jump_to(url)

So the session object would have to be passed to the gtrends function which should then use rvest::jump_to to get the response

Obviously there is more to be done here, but I hope this is a good first step into the right direction.

There are also still some strange errors coming back from the login (client error: (411) Length Required) but I think they are irrelvant.

Don't have time to look into this any further right now.

@PMassicotte
Copy link
Owner

Nice one @MrLoh I think we could use this.

@eddelbuettel
Copy link
Collaborator

But pretty-please in functional programming without the bloody pipe, right ;-)

@PMassicotte
Copy link
Owner

I will spend the afternoon with curl and see if I can make it.

@eddelbuettel
Copy link
Collaborator

eddelbuettel commented Jul 27, 2016

Nothing wrong using rvest but I personally would just write the same code differently as I don't find the piping all that intuitive. But style is personal so ...

But yes you can probably also shadow the behaviour and maybe get by with one (or more) fewer depends. All very good.

With many eyeballs all bugs a shallow .... Really nice when that works so thanks again @MrLoh!

@PMassicotte
Copy link
Owner

Issue seems to be fixed.

@heck1
Copy link

heck1 commented Jul 27, 2016

Works fine now :)

thanks to all the contributors

Also, this post made me signup here

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

Hi thanks for fixing :) I wouldn't use piped code in the package either, but for explorative coding it is ideal. Way less adding and deleting parentheses all over. Thanks a lot for integrating it.

@omartvit
Copy link

Hi!!...

I'm a beginner in all this, therefore I'm not be sure to understand the
solution. So, the solution is the code shared by Tobias or I have to
install the package again?.

Thanks so much for fixing it!!!...

El 27/07/2016 16:26, "Tobias Lohse" notifications@github.com escribió:

Hi thanks for fixing :) I wouldn't use piped code in the package either,
but for explorative coding it is ideal. Way less adding and deleting
parentheses all over. Thanks a lot for integrating it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATpAcBYOiVak75hxZ9vH79LX4Gzqelcoks5qZ2p5gaJpZM4JSPwW
.

@PMassicotte
Copy link
Owner

@omartvit You can wait a bit before we finish last details and then you install the dev version.

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

Another funny site effect is that a cookies file is created in the directory now. But a nice sideeffekt is that the annoying emails from google about suspicious login activity are gone.

@PMassicotte
Copy link
Owner

Good finding @MrLoh. I do not know rvest package that much but I will try to find a solution.

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

I also just learned about rvest today, seems pretty nice though. It mainly provides a pretty wrapper around httr (also from hadley), so maybe looking directly into httr makes most sense.

But most important is that the crawling works again at all, so 🍻

@eddelbuettel
Copy link
Collaborator

Still an unhappy camper here:

R> library(gtrendsR)
Creating a generic function fortoJSONfrom packagejsonlitein packagegoogleVisR> gconnect()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Number of redirects hit maximum amount
R> 

@caiogoncalves
Copy link

i'm still getting the error

Google login failed! Check your login information.NULL

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

@caiogoncalves did you reinstall the package with devtools ?

@MarkEdmondson1234
Copy link

Working for me:

> devtools::install_github("PMassicotte/gtrendsR")
> library(gtrendsR)
Creating a generic function fortoJSONfrom packagejsonlitein packagegoogleVis> gconnect("m@xxxx.com",'xxxx')
> sport_trend <- gtrends(c("nhl", "nba", "nfl"))
> 
> plot(sport_trend)
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gtrendsR_1.3.3.9000

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6          xml2_1.0.0           magrittr_1.5         devtools_1.12.0.9000
 [5] rvest_0.3.2          munsell_0.4.3        colorspace_1.2-6     lattice_0.20-33     
 [9] R6_2.1.2             stringr_1.0.0        httr_1.2.1.9000      plyr_1.8.3          
[13] tools_3.3.0          grid_3.3.0           gtable_0.2.0         selectr_0.2-3       
[17] git2r_0.15.0         withr_1.0.2          digest_0.6.9         ggplot2_2.1.0       
[21] formatR_1.4          rsconnect_0.4.3      curl_0.9.7           memoise_1.0.0       
[25] labeling_0.3         stringi_1.1.1        googleVis_0.6.0      scales_0.4.0        
[29] XML_3.98-1.4         jsonlite_1.0         zoo_1.7-13          
> 

One suggestion when working with httrstuff is to add a flag so you can run the commands with verbose() in the calls - helps a lot with debugging.

@caiogoncalves
Copy link

@MrLoh i have installed the new gtrendsR-master.
how i can know if this package have the devtools

@eddelbuettel
Copy link
Collaborator

Ignore my message above -- I just needed to login from the throwaway Google account used for gtrendsR and ok the computer I was using. All good at my end. 🍰

@MrLoh
Copy link

MrLoh commented Jul 27, 2016

@caiogoncalves the prefered way to install is by running the code from the Readme.

if (!require("devtools")) install.packages("devtools")
devtools::install_github("PMassicotte/gtrendsR")

what do you mean by i have installed the new gtrendsR-master, how did you install it?

@PMassicotte
Copy link
Owner

@eddelbuettel I think everything is under control now. Let's release it?

@omartvit
Copy link

Hi guys!,

I was wondering if it is already available the final version to work with
Google Trends in R.
I'm a beginner and I don't sure how I have to continue.

Thanks so much!!!

El 28/07/2016 09:23, "Philippe Massicotte" notifications@github.com
escribió:

@eddelbuettel https://github.com/eddelbuettel I think everything is
under control now. Let's release it?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATpAcDBd99yyM9fIEKaq9WfGnl-ST3X9ks5qaFjkgaJpZM4JSPwW
.

@MrLoh
Copy link

MrLoh commented Jul 30, 2016

@omartvit run:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("PMassicotte/gtrendsR")

@PMassicotte
Copy link
Owner

I think we can close this issue now. Thanks everyone who helped!

@lyzerana
Copy link

hey guys,
great work!
Question, can you also include the patch for the "queries-on-categories" please?
Thanks!!

@AronHartveld
Copy link

Hi all,

Thanks for the package, really helped a lot with my thesis. However I'm trying to use the package again and I keep getting errors. I read the discussion above carefully, but still get the same error message after running the readMe code. The error is:

Error in curl::curl_fetch_memory(url, handle = handle) :
Number of redirects hit maximum amount

I've tried the following solutions:

  • reinstall the package through devtools
  • create a new account only for gtrends
  • use an other computer

Does anyone know how to fix this?

Thanks!

@PMassicotte
Copy link
Owner

Are you getting this error when you are connecting with gconnect()?

@AronHartveld
Copy link

AronHartveld commented Aug 17, 2016

yes, and I also tried the script MrLoh posted above

@PMassicotte
Copy link
Owner

It is difficult for me to debug because I just tested it and it is working fine. Lets see if others are also experiencing the problem.

@s-Nick-s
Copy link

s-Nick-s commented Nov 2, 2016

Hello all!
Found this discussion after encountering the same error:
Error in curl::curl_fetch_memory(url, handle = handle) :
Number of redirects hit maximum amount

Tried everything written here with no results.
Would appreciate any advice.
Thanks!

@PMassicotte
Copy link
Owner

Just retry few times.

@s-Nick-s
Copy link

s-Nick-s commented Nov 2, 2016

You are right! It works now for some reason! Thank you!

@lewisbrk
Copy link

I have been reading this string and am wondering if this is still a valid solution. We're trying to use GtrendsR, but keep getting this "Google login failed! Check your login information". I'm not a R expert so I'm not sure I understand what I need to do.

I've basically done the following:
devtools::install_github("PMassicotte/gtrendsR")

library(gtrendsR)
gconnect("m@xxxx.com",'xxxx') with my credentials of course

@PMassicotte
Copy link
Owner

Difficult to tell. Can be 2-ways auth. Still working on my side, so hard to debug.

@lewisbrk
Copy link

How do I know if I have it installed correctly? Is that all I have to do is install that gtrendsR and then use the gconnect statement?

@eddelbuettel
Copy link
Collaborator

If you can do library(gtrendsR) then the R side of things (installation, dependencies, ...) should be fine.

But this is networking and works with another side not exactly providing this as an API, so it is hard to tell. It still works for me, as it does for Philippe.

@PMassicotte PMassicotte mentioned this issue Feb 12, 2017
@gpiccoli89
Copy link

Hi all,

I just installed gtrends and when running gconnect("email","password") I also get "Google login failed! Check your login information." Login information I am using are correct and my google account works well with no two steps authentication.

Any suggestion?

Thank you!

@PMassicotte
Copy link
Owner

@gpiccoli89 Check #158 for example. There is a new way to connect.

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