Open randomBrainstormer opened 2 years ago
hi @letsandeepio,
Unfortunately, we can't control the invalid_grant
error, this is returned by google whenever they think there's an issue with the token, and this can be something as little as going offline for 1 second or asking for too many requests. Example of other reasons here.
Currently, I don't have a way to fix this problem permamently, as soon as I can figure something out I would definitely push it to the repo.
Some things to try out in the meantime is the fetchInterval
option, setting it a higher interval (15 mins) can help lower the load.
I've been thinking for a possible solution for this problem and got two ideas to explore:
TV and unlimited input
). This could pontentially save us from getting invalid_grant
so often.TV and Unlimited Input
). This won't solve the invalid_grant
issue directly, but rather force us to change the authorization flow and possibly integrate some kind of "Log in" feature in the module's UI. It would at least make the authorization process more simple. I'll try to run some tests when I have some more free time
hi randomBrainstormer, I love your module, but experience the same problem every 1 or 2 weeks.
The widget shows 'Error in the MMM-GoogleCalendar Module. Check logs for more details.' Then, I go to the module directory
'cd ~/MagicMirror/modules/MMM-GoogleCalendar/MMM-GoogleCalendar.js`
Remove the token.json
'rm token.json'
Regenerate the token and follow instructions by running
'node authorize.js'
To prevent doing this every week, I just implemented your suggested workaround of changing the fetchInterval value, I did it like this:
nano ~/MagicMirror/modules/MMM-GoogleCalendar/MMM-GoogleCalendar.js
changed value from: fetchInterval: 5 60 1000, to fetchInterval: 15 60 1000,
I hope it works.
Keep up the good work!
I figured out recently that by moving the Google app project to Production, this issue of invalid_grant requiring authorizing again every week or so, gets solved. Haven't had to reauthorize in a long time now.
I figured out recently that by moving the Google app project to Production, this issue of invalid_grant requiring authorizing again every week or so, gets solved. Haven't had to reauthorize in a long time now.
I know that was a while ago, but do you remember how you did that exactly? I don't know if it is because the coffee hasn't kicked in yet, but I'm not finding how to do that?
@Milkysunshine You have to go google cloud console where you set up the magic mirror app. Once you get to your app find the OAuth consent screen. There is a publishing status where it will probably say Testing. If you push publish app you will move it to production. I would be very careful and read exactly what you are doing and ensure that you have your permissions set appropriately before you publish the app.
hi @randomBrainstormer, I am frequently running into invalid_grant issue which usually goes away with regenerating token ? Is there a way to fix this problem permanently?
Originally posted by @letsandeepio in https://github.com/randomBrainstormer/MMM-GoogleCalendar/issues/9#issuecomment-1026131221