Skip to content

Re-authentication needed every week #1137

@michaelbeljaars

Description

@michaelbeljaars

IMPORTANT NOTICE
If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED

Which branch of GassistPi are you using ?

GassistPi Master

Board and OS details:

Open a terminal and run

pi@matrixcreator:~/GassistPi/scripts $ cat /proc/cpuinfo  
processor	: 0
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 44.80
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 1
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 44.80
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 2
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 44.80
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 3
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 44.80
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

Hardware	: BCM2835
Revision	: a02082
Serial		: 000000002603431e
Model		: Raspberry Pi 3 Model B Rev 1.2
pi@matrixcreator:~/GassistPi/scripts $ 
pi@matrixcreator:~/GassistPi/scripts $ cat /etc/os-release  
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@matrixcreator:~/GassistPi/scripts $ 
pi@matrixcreator:~/GassistPi/scripts $ cat /etc/rpi-issue
Raspberry Pi reference 2021-05-07
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, dcfd74d7d1fa293065ac6d565711e9ff891fe2b8, stage4
pi@matrixcreator:~/GassistPi/scripts $ 

Describe the bug:

GassistPi seems to function normally, but every week or so it has a problem with the authentication and I need to re-authenticate the device in order to make it functional again. I have looked for settings within the Google console that may have to do with expiration times of the tokens, but could not find any. Also searching for similar problems here and on the internet in general have yielded nothing.

I suspect it is not an issue with GassistPi itself, but may be a configuration problem. Any help is greatly appreciated.

Did you go through or search the issues section to check if your issue was already discussed (either currently open issues or closed issues)?

Yes

2. Is the issue related to assistant installation ?

No

If answer to question 2 is Yes, then attach the contents of terminal as a file or paste it below.


If answer to question 2 is No, then proceed further.

3. Does the assistant service start normally?

Yes (provided that it is successfully authenticated)

4. Is the assistant service restarting automatically?

No

If answer to question 4 is Yes, then paste the contents of the terminal below.


If answer to question 4 is No, then proceed further.

Manually start the assistant. For guidelines to start the assistant manually refer this

Paste the command below, that crashed the assistant

Currently the assistant is authenticated and running. Will update 
this post within a week, when the authentication error reoccurs.

Paste the contents of the terminal below

pi@matrixcreator:~ $ /home/pi/env/bin/python -u /home/pi/GassistPi/src/main.py --project_id 'matrixassistant-xxxxxx' --device_model_id 'matrixassistant-xxxxx-matrixcreator-abcdef'
/home/pi/env/lib/python3.7/site-packages/google/assistant/library/assistant.py:90: DeprecationWarning: Google Assistant Library for Python is deprecated
  warnings.warn('Google Assistant Library for Python is deprecated', DeprecationWarning)
2021-09-16 17:11:31,994 : ERROR : ('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})
Traceback (most recent call last):
  File "/home/pi/GassistPi/src/main.py", line 1131, in <module>
    Myassistant().main()
  File "/home/pi/GassistPi/src/main.py", line 1094, in main
    with Assistant(credentials, device_model_id) as assistant:
  File "/home/pi/env/lib/python3.7/site-packages/google/assistant/library/assistant.py", line 106, in __init__
    credentials, self._set_credentials)
  File "/home/pi/env/lib/python3.7/site-packages/google/assistant/library/auth_helpers.py", line 40, in __init__
    self._credentials.refresh(http_request)
  File "/home/pi/env/lib/python3.7/site-packages/google/oauth2/credentials.py", line 300, in refresh
    rapt_token=self._rapt_token,
  File "/home/pi/env/lib/python3.7/site-packages/google/oauth2/reauth.py", line 338, in refresh_grant
    _client._handle_error_response(response_data)
  File "/home/pi/env/lib/python3.7/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
    raise exceptions.RefreshError(error_details, response_data)
google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions