assistant-relay
assistant-relay copied to clipboard
Getting metadata from plugin failed with error: invalid_grant
Describe the bug Assistan relay seems to lose auth after a while. Whenever testing anything in sandbox I get this error: Getting metadata from plugin failed with error: invalid_grant
To Reproduce Steps to reproduce the behavior: Try any command in sandbox
Expected behavior Command or broadcast to occur without issue.
Desktop (please complete the following information):
- Platform Pi 4 running home assistant
- Browser vivaldi
- Version latest
I just got exactly the same issue. its been working for about a week. I had to create another user using the same OAuth client ID. why is that?
Also seeing this issue
Same issue, and also solved by creating a new user using the same credentials.
Creating a new user only fixes it temporarily. After a few days it will go back to doing the same thing
Yep that’s what I ran into
On Dec 29, 2020, at 08:10, HeedfulCrayon [email protected] wrote:
Creating a new user only fixes it temporarily. After a few days it will go back to doing the same thing
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Also getting this, going to try running a command to ask the time every six hours to see if that stops any timeout.
Happening to me again, 7 days after. Who is causing this to expire? GAR or Google?
Same for me. @matt---4 Any luck with your testing to repeat a command every X hours?
So far the issue hasn't happened since I started asking the time every six hours. I'll post back on here in a week or so with another update or if the issue happens again.
@matt---4 ok good to know! I'll be testing this myself as well.
I'm having the same issue and have automations which run daily at minimum firing commands. All working fine until 4 days ago with nothing having changed but now with the invalid_grant error. Same happens if I fire from sandbox mode.
EDIT - FYI I also added a new user using the same auth creds and it works again with this new user. I will monitor to whether this user gets impacted over time
me 3
I'm a bit concerned the dev doesn't seem to react on this issue... Is there anyone still maintaining this code ?
I'm a bit concerned the dev doesn't seem to react on this issue... Is there anyone still maintaining this code ?
Calm down, last commit was 14 days ago. Just set up an automation to run every 6 hours like stated above and you won't lose auth. Mines been working fine for over a week
Not sure the regular automation trick works. I set up a new user to prevent the problem on the current user, set up an automation to run every 5 hours. It was fine for the first day and now is failing with the invalid_grant error again
My raspberry pi crashed and I got invalid grant when it started up again. So I don't know how long the automation thing would have worked for.
Both my users lost the grant at the same time, one was used much more frequently than the other so I doubt it is interaction dependent. It was also 7 days after I set the system up.
Is there maybe something with the testing function that are used for the grants?
Just saying, mine is still going just fine
@HeedfulCrayon that's good. What environment are you using this in? For me I am using the Home Assistant add-on and triggering automations through node-red. Curiously at the moment I get the error only in node-red, but can still successfully use the sandbox mode to trigger directly on the latest user account. My original user account fails in both Node-red and sandbox.
I might try installing a separate instance on a VM and see how that goes.
@Snacker001 I am using it in the Home Assistant add-on and I am using the native yaml automations:
id: 'google_assistant_relay_heartbeat'
alias: Google Assistant Relay Heartbeat
description: 'Keeps the token for Google Assistant Relay Alive'
trigger:
platform: time
at:
- "09:30:00"
- "12:00:00"
- "18:00:00"
- "00:00:00"
- "06:00:00"
action:
- service: rest_command.assistant_relay
data:
command: What time is it?
Don't think this is a GAR problem. I am not seeing any problem running in Docker on Ubuntu. It can be days between broadcasts and I'm not having any problems.
I see the same behavior
I'm having the same issue. Have not been tracking but would guess I loose grant after about 4 days. Will set up automation to track this more closely.
Mine finally died. Looks like running an automation periodically doesn't seem to fix the issue
I ran into the same problem twice now, it does not appear to be related to lack of activity. I'm posting in case my experiences help narrow down the problem.
The first failure, my Pi lost power hard and didn't boot back up properly. After solving the boot problem, I still received the invalid_grant errors. I didn't do any other testing, I reloaded the OS on the Pi and started over.
The second time, last night, I was actively sending commands when the credentials began failing. I sent 475 commands in 1 day successfully and began receiving the invalid_grant error on the 476th command.
The Google Assistant API reported "1 of 1 quota is reaching limit", the quota is 500 requests per day so I was near it.
I confirmed Google reported the Assistant API quota reset overnight, but I was still getting the same invalid_grant response this morning. I created a new Assistant-Relay user with no other issues to temporarily mitigate the problem.
What environment are you running GAR in? I am running in a plain Linux Alpine based Docker container and I am not having this problem. I would look more at what your OS might be contributing to this. If it was a GAR problem, we would all be seeing it.
I've been having the same issues. I thought it was occurring every 7 days for me (Sunday to Sunday) but I lost it again today after really 2 day, after I had also set up another webCoRE piston to ping every 5 hours. I'm on a Ubuntu vm on vmware running on a Windows 10 host. And I don't think I would have hit the 500 requests per day limit. This is getting really annoying.
Has this problem a few times when deploying AR via the Hassio add-on. Since moving it to run on a VM running ubuntu18.04 it has not reoccurred.
For what it's worth I have a benign automation running every 5 hours, but I am not sure that really helps - it certainly didn't when running the hassio add-on. I am also nowhere near the 500 per day request rate.
I do not think the problem is only caused by exceeding the quota.
Just speculation, but it seems once the invalid_grant error appear for whatever different reason it does not recover until a new user is created. Even if the root cause of the invalid_grant error gets solved (i.e. timeout no longer occurs, quota has expired, etc) that user won't stop reporting a failure. Problems like timeouts or disconnects that occur for reasons completely unrelated to GAR, and would normally be solved by sending another request, ultimately stop the service until manual intervention.
If that's the case, I agree a more powerful server would have less of a chance of initial failure avoiding this issue altogether.
I too am encountering this issue. GAR v3.2.0 running on Win10.