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

Can't connect to Google home addon - Could not get master token. #528

Closed
mitch55500 opened this issue May 13, 2022 · 46 comments
Closed

Can't connect to Google home addon - Could not get master token. #528

mitch55500 opened this issue May 13, 2022 · 46 comments
Labels
bug Something isn't working glocaltokens For fixes related with the glocaltokens dependency

Comments

@mitch55500
Copy link

mitch55500 commented May 13, 2022

Hello,

I have read the other issues with the same error than mine, but I couldn't resolve it.

I use the Google Home addon of Home Assistant, but the connection is refused.
I've tried to take off the protection methods to my google account too.

Here the log :

2022-05-13 10:58:25 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance. 2022-05-13 10:58:25 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None 2022-05-13 10:58:25 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "m*******************", password to "V********", master_token to "" and android_id to 2022-05-13 10:58:25 DEBUG (SyncWorker_15) [glocaltokens.client] There is no stored master_token, logging in using username and password 2022-05-13 10:58:25 DEBUG (SyncWorker_15) [glocaltokens.client] There is no stored android_id, generating a new one 2022-05-13 10:58:25 DEBUG (SyncWorker_15) [glocaltokens.client] Generating android id... 2022-05-13 10:58:25 DEBUG (SyncWorker_15) [glocaltokens.client] Generated android id: 02d89392d5f67400 2022-05-13 10:58:25 ERROR (SyncWorker_15) [glocaltokens.client] [!] Could not get master token. 2022-05-13 10:58:25 DEBUG (SyncWorker_15) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/IDELETEDTHIS', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'} 2022-05-13 10:58:25 ERROR (MainThread) [custom_components.google_home]

*Edit : Of course, no pop-up opens.

@tomaspre
Copy link

tomaspre commented May 14, 2022

+1
I have the exact same problem. Some of my newly added devices would not show up so I removed and re-added the integration and now I can't even log in. Running the latest version from HACS (v1.9.10).

2022-05-14 14:35:43 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
2022-05-14 14:35:43 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "p********************", password to "u***************", master_token to "" and android_id to 
2022-05-14 14:35:43 DEBUG (SyncWorker_1) [glocaltokens.client] There is no stored master_token, logging in using username and password
2022-05-14 14:35:43 DEBUG (SyncWorker_1) [glocaltokens.client] There is no stored android_id, generating a new one
2022-05-14 14:35:43 DEBUG (SyncWorker_1) [glocaltokens.client] Generating android id...
2022-05-14 14:35:43 DEBUG (SyncWorker_1) [glocaltokens.client] Generated android id: 6f4f8588271368c7
2022-05-14 14:35:43 ERROR (SyncWorker_1) [glocaltokens.client] [!] Could not get master token.
2022-05-14 14:35:43 DEBUG (SyncWorker_1) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=CENSORED', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'}
2022-05-14 14:35:43 ERROR (MainThread) [custom_components.google_home] ```

@mitch55500
Copy link
Author

I had the same problem and I did the same thing than you (removed and re-added).
On 2022.5.4 version of HA.

@Wurmie1978
Copy link

Sadly I have the same problem. Reinstalled the whole of my home assistant and as first addon I installed HACS and this one. Still i get this error..

@Eagle99Eye
Copy link

I have the same issue (HA 2022.5.4 - addon 1.9.10). Did clean install of all components - nothing helped

@TheLinthus
Copy link

TheLinthus commented May 16, 2022

Having this problem also. Already tried a lot of thigs found here, nothing seems to work.

  • Home Assistant Core 2022.5.4
  • Home Assistant Supervisor 2022.05.1
  • Home Assistant OS 7.6
  • Kernel version 5.10.103-v8
  • Agent version 1.2.1
  • HACS 1.24.5
  • Google Home Integration 1.9.10

@KapJI
Copy link
Collaborator

KapJI commented May 16, 2022

I guess this is related simon-weber/gpsoauth#37

@Mylezz
Copy link

Mylezz commented May 16, 2022

Same Issue here!
image

@Dendrowen
Copy link

Same issue. Tried reinstalling, but didn't work.
Home Assistant Core 2022.5.4
Home Assistant Supervisor 2022.05.2
Home Assistant OS 8.0
Kernel version 5.15.32-v7
Agent version 1.2.1
HACS 1.24.5
Google home integration 1.9.10

@mkultrahh
Copy link

First time install but im also getting the same issue (Failing to get master token).
Im using 2FA but using an app password and its still not working.

@Deathbot64
Copy link

same error with a fresh HA install. Tried removing 2FA but even then same error

@sk8er000
Copy link

same here my timers and alarms sensors suddenly stopped working. I decided to delete and reinstall the extension and now I'm unable to even login no matter if I use 2FA or not. I tried different google accounts too

@ArnyminerZ
Copy link
Collaborator

This seems quite worrying, pretty sure it has to do with some Google Api change. Further investigation shall be performed.

@ArnyminerZ ArnyminerZ added bug Something isn't working glocaltokens For fixes related with the glocaltokens dependency labels May 19, 2022
@ArnyminerZ
Copy link
Collaborator

This is related to glocaltokens, so the issue is moved there. See leikoilja/glocaltokens#245

@leikoilja
Copy link
Owner

leikoilja commented Jun 1, 2022

Fixed in ha-google-home v1.9.11 🚀
https://github.com/leikoilja/ha-google-home/releases/tag/v1.9.11

Please update to the latest version and verify it works :)

@hugalafutro
Copy link

I just updated to 1.9.11, restarted HA, created new app password for my gmail address, tried to log in with it into integration and still get [!] Could not get master token.. Is there something more I need to do? Thanks!

@mitch55500
Copy link
Author

Fixed in ha-google-home v1.9.11 🚀 https://github.com/leikoilja/ha-google-home/releases/tag/v1.9.11

Please update to the latest version and verify it works :)

2022-06-01 10:57:37 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance. 2022-06-01 10:57:37 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None 2022-06-01 10:57:37 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "m*******************", password to "V********", master_token to "" and android_id to 2022-06-01 10:57:37 DEBUG (SyncWorker_7) [glocaltokens.client] There is no stored master_token, logging in using username and password 2022-06-01 10:57:37 DEBUG (SyncWorker_7) [glocaltokens.client] There is no stored android_id, generating a new one 2022-06-01 10:57:37 DEBUG (SyncWorker_7) [glocaltokens.client] Generating android id... 2022-06-01 10:57:37 DEBUG (SyncWorker_7) [glocaltokens.client] Generated android id: 54f0e5703eaa6273 2022-06-01 10:57:37 ERROR (SyncWorker_7) [glocaltokens.client] [!] Could not get master token. 2022-06-01 10:57:37 DEBUG (SyncWorker_7) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=DELETED', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'} 2022-06-01 10:57:37 ERROR (MainThread) [custom_components.google_home]

I confirm, always same error after update and reboot of my Home Asssitant.

@leikoilja
Copy link
Owner

Reopening this issue, since it seems to be on ha-google-home now.
The authentication issue we first saw was fixed and tested in glocaltoken using python SDK and it's provided example code.

Since we still keep seeing the same issue in Home Assistant, let's try to dig deeper here to understand what's an issue. Supposedly it's to do with dependencies during installation, but we look into it deeper.

@leikoilja leikoilja reopened this Jun 1, 2022
@Neolanco
Copy link

Neolanco commented Jun 1, 2022

I'm gonna provide you with the log I get, just in case it could help.
2022-06-01 12:17:50 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance. 2022-06-01 12:17:50 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None 2022-06-01 12:17:50 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "l*******************************", password to "r**************", master_token to "" and android_id to 2022-06-01 12:17:50 DEBUG (SyncWorker_9) [glocaltokens.client] There is no stored master_token, logging in using username and password 2022-06-01 12:17:50 DEBUG (SyncWorker_9) [glocaltokens.client] There is no stored android_id, generating a new one 2022-06-01 12:17:50 DEBUG (SyncWorker_9) [glocaltokens.client] Generating android id... 2022-06-01 12:17:50 DEBUG (SyncWorker_9) [glocaltokens.client] Generated android id: b8b1eb8c9627abb0 2022-06-01 12:17:51 ERROR (SyncWorker_9) [glocaltokens.client] [!] Could not get master token. 2022-06-01 12:17:51 DEBUG (SyncWorker_9) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=AKgnsbs77w4ATgyA1-jtFcAmf1zH0VLDAKJOsfWkiE31eGdA_1oTMxgZK4uFrNvKo2xVuXqxhqXUc_Rx3qpVhkvpzEWZIVJIWMuZvaidY5BW9MaUsmcV-5Ryy9j2V9EYMl7ahoXKl4IF', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'} 2022-06-01 12:17:51 ERROR (MainThread) [custom_components.google_home]

@leikoilja
Copy link
Owner

@mitch55500, @hugalafutro, @Pronown, @srappan, @dineshkathir, @Neolanco, can one of you please double-check glocaltokens version installed in your HA instance? I am assuming that it might not have been automatically pulled and installed when updating ha-google-home. You would need to ssh to your container/server and do smth like pip freeze to see?

@sudoxnym
Copy link

sudoxnym commented Jun 1, 2022

@mitch55500, @hugalafutro, @Pronown, @srappan, @dineshkathir, @Neolanco, can one of you please double-check glocaltokens version installed in your HA instance? I am assuming that it might not have been automatically pulled and installed when updating ha-google-home. You would need to ssh to your container/server and do smth like pip freeze to see?

I am available now to ssh. Still fairly new to Linux and how the file hierchy works, but if you tell me commands, I can input them.

@hugalafutro
Copy link

I run latest ha in docker, here's the output from inside the container: https://o.o5.ddns.net/z3KcF I will now bring the stack down and rebuild, but it'll take time on pi. Will report if that changes anything.

@leikoilja
Copy link
Owner

uuu, it's highly dependant on what HA installation you have done, @Pronown. If it was using docker container you should be able to just run a command like this:
docker exec -it homeassistant pip freeze | grep glocaltokens
if some other option, check this article.

@hugalafutro, thank you for the update. Seems like my assumption was right, you have glocaltokens==0.6.3, when the latest (with the fix) is glocaltokens==0.6.4. I think we need to specify the glocaltokens version to be min 0.6.4 in this package. @KapJI, what do you think?

@mitch55500
Copy link
Author

On my HA, glocaltokens==0.6.3

@KapJI
Copy link
Collaborator

KapJI commented Jun 1, 2022

@leikoilja you forgot to update it in the manifest: https://github.com/leikoilja/ha-google-home/blob/master/custom_components/google_home/manifest.json#L20

pyproject.toml is only used for CI.

@leikoilja
Copy link
Owner

that's the issue. flip i think it's my fault, I keep forgetting updating the manifest file with a version requirement :D

@srappan
Copy link

srappan commented Jun 1, 2022

custom_components/google_home/manifest.json
Yep missed change

@bjarnekrottje
Copy link

I had glocaltokens versions 0.6.3 too, manually upgraded using pip (pip install --upgrade glocaltokens) and that did the trick

@leikoilja
Copy link
Owner

leikoilja commented Jun 1, 2022

Sorry, guys, my fault (not the first time forgetting to update manifest file 😮‍💨 🤦 😅 )
Fixed here: #541
will merge and deploy a new release

@sudoxnym
Copy link

sudoxnym commented Jun 1, 2022 via email

@Neolanco
Copy link

Neolanco commented Jun 1, 2022

uuu, it's highly dependant on what HA installation you have done, @Pronown. If it was using docker container you should be able to just run a command like this: docker exec -it homeassistant pip freeze | grep glocaltokens if some other option, check this article.

@hugalafutro, thank you for the update. Seems like my assumption was right, you have glocaltokens==0.6.3, when the latest (with the fix) is glocaltokens==0.6.4. I think we need to specify the glocaltokens version to be min 0.6.4 in this package. @KapJI, what do you think?

Um... I'm running ha os on a rasperry pi, not sure how I get pip commands to work ^^'

@hugalafutro
Copy link

@Neolanco just wait a bit till new version is pushed out, update via hacs and it will do the work automatically

@leikoilja
Copy link
Owner

Okay, new patch release is out, it should fix it.
v1.9.12
Please update and verify all good 🚀 🔥

@hugalafutro
Copy link

Success!
Created configuration for [REDACTED]@gmail.com.

all good here, thanks for quick fix!

@Neolanco
Copy link

Neolanco commented Jun 1, 2022

Seems to work for me! ^^

@sudoxnym
Copy link

sudoxnym commented Jun 1, 2022

Bad news yall...

2022-06-01 05:12:12 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance. 2022-06-01 05:12:12 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None 2022-06-01 05:12:12 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "p***********************", password to "q***************", master_token to "" and android_id to 2022-06-01 05:12:12 DEBUG (SyncWorker_3) [glocaltokens.client] There is no stored master_token, logging in using username and password 2022-06-01 05:12:12 DEBUG (SyncWorker_3) [glocaltokens.client] There is no stored android_id, generating a new one 2022-06-01 05:12:12 DEBUG (SyncWorker_3) [glocaltokens.client] Generating android id... 2022-06-01 05:12:12 DEBUG (SyncWorker_3) [glocaltokens.client] Generated android id: 12296470e9c062d1 2022-06-01 05:12:12 ERROR (SyncWorker_3) [glocaltokens.client] [!] Could not get master token. 2022-06-01 05:12:12 DEBUG (SyncWorker_3) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=AKgnsbufDPlhGKzrpGUsOq312aGKJL8-AhfSJwVKGzM7zohH2X9ATmAFAxEXb2nFOf__ckRGexJcO96Mwr-Qe-CQbcCzvSuveq3f8YxuSuM7NMau4swrjpEskhp1cmNtHk90TUwtkjIl', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'} 2022-06-01 05:12:12 ERROR (MainThread) [custom_components.google_home]

@mitch55500
Copy link
Author

@leikoilja, the same error for me too. It doesn't work.

@hugalafutro
Copy link

strange, it works here, I created a timer to test and could see it in ha

@leikoilja
Copy link
Owner

hmm, @mitch55500 & @Pronown, can you guys please dig deeper into your container/ha environment to see which version glocaltokens is for you now (see some instruction here)?

@sudoxnym
Copy link

sudoxnym commented Jun 1, 2022

@leikoilja, the same error for me too. It doesn't work.

Bro! Reinstall from HACS and restart just fixed mine!

@sudoxnym
Copy link

sudoxnym commented Jun 1, 2022

@leikoilja do you want me to check that still, now that it worked?

@leikoilja
Copy link
Owner

No, no worries, thank you, @Pronown. Happy to hear it has eventually worked for you :)

@dineshkathir
Copy link

It worked 🙂

@mitch55500
Copy link
Author

mitch55500 commented Jun 1, 2022

Arrfff, Always the same error. Yet, I have uninstall Google Home, And reboot HA and then reinstall GH.

2022-06-01 14:13:34 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance.
2022-06-01 14:13:34 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
2022-06-01 14:13:34 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "m*******************", password to "V********", master_token to "" and android_id to 
2022-06-01 14:13:34 DEBUG (SyncWorker_2) [glocaltokens.client] There is no stored master_token, logging in using username and password
2022-06-01 14:13:34 DEBUG (SyncWorker_2) [glocaltokens.client] There is no stored android_id, generating a new one
2022-06-01 14:13:34 DEBUG (SyncWorker_2) [glocaltokens.client] Generating android id...
2022-06-01 14:13:34 DEBUG (SyncWorker_2) [glocaltokens.client] Generated android id: a6842563dc53d585
2022-06-01 14:13:35 ERROR (SyncWorker_2) [glocaltokens.client] [!] Could not get master token.
2022-06-01 14:13:35 DEBUG (SyncWorker_2) [glocaltokens.client] Request response: {'Error': 'NeedsBrowser', 'Url': 'DELETED', 'ErrorDetail': 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.'}
2022-06-01 14:13:35 ERROR (MainThread) [custom_components.google_home] 

image

*EDIT : It works!!

I have forgotten I have reactived the double factor identification, sorry.

Thanks @leikoilja

@aaronpowell
Copy link

I've just come across this add-on and am trying to set it up but am hitting this error.

Been through the trouble shooting guides as listed, installed from HACS/uninstalled/reinstalled. I've also tried enabling and disabling 2FA (using App Password when having 2FA setup), still no luck.

Logs:

2022-06-13 19:30:16 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance.
2022-06-13 19:30:16 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
2022-06-13 19:30:16 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "m*****************************", password to "G*****************", master_token to "" and android_id to 
2022-06-13 19:30:16 DEBUG (SyncWorker_4) [glocaltokens.client] There is no stored master_token, logging in using username and password
2022-06-13 19:30:16 DEBUG (SyncWorker_4) [glocaltokens.client] There is no stored android_id, generating a new one
2022-06-13 19:30:16 DEBUG (SyncWorker_4) [glocaltokens.client] Generating android id...
2022-06-13 19:30:16 DEBUG (SyncWorker_4) [glocaltokens.client] Generated android id: b59e5184b7b029fd
2022-06-13 19:30:17 ERROR (SyncWorker_4) [glocaltokens.client] [!] Could not get master token.
2022-06-13 19:30:17 DEBUG (SyncWorker_4) [glocaltokens.client] Request response: {'Error': 'UNKNOWN_ERR'}
2022-06-13 19:30:17 ERROR (MainThread) [custom_components.google_home] 

manifest:

{
  "after_dependencies": [
    "cloud",
    "http",
    "zeroconf"
  ],
  "codeowners": [
    "@leikoilja",
    "@DurgNomis-drol",
    "@ArnyminerZ",
    "@KapJI"
  ],
  "config_flow": true,
  "dependencies": [],
  "documentation": "https://github.com/leikoilja/ha-google-home",
  "domain": "google_home",
  "issue_tracker": "https://github.com/leikoilja/ha-google-home/issues",
  "name": "Google Home",
  "requirements": [
    "glocaltokens==0.6.4",
    "google-api-python-client==2.38.0"
  ],
  "version": "1.9.12",
  "zeroconf": [
    "_googlecast._tcp.local."
  ],
  "iot_class": "cloud_polling"
}

HA info:

Home Assistant Core 2022.6.5
Home Assistant Supervisor 2022.05.3
Home Assistant OS 8.1

Thoughts on the next debugging step?

@leikoilja
Copy link
Owner

@aaronpowell sorry to hear you are having issues. I suggest you try a simple python package https://github.com/leikoilja/glocaltokens that we use in this integration first in isolation. Try obtaining your master tokens. From the logs that you have posted, you are getting UNKNOWN_ERR, which is smth new...
If the problem persists open a new issue ticket in glocaltokens repo :)

@aaronpowell
Copy link

@aaronpowell sorry to hear you are having issues. I suggest you try a simple python package https://github.com/leikoilja/glocaltokens that we use in this integration first in isolation. Try obtaining your master tokens. From the logs that you have posted, you are getting UNKNOWN_ERR, which is smth new... If the problem persists open a new issue ticket in glocaltokens repo :)

Cool, will give that a go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working glocaltokens For fixes related with the glocaltokens dependency
Projects
None yet
Development

No branches or pull requests