Hey, since today I can’t pull spreadsheets via the GoogleSheetsExtension anymore and keep getting the error:
Pull DevelopmentDialogTable from Google sheets: Failed
Error:“invalid_grant”, Description:“Token has been expired or revoked.”, Uri:“”
Preparing columns: 0s
Generating request: 0s
Sending request: 0,14s
Total time: 0,14s
And this error:
TokenResponseException: Error:“invalid_grant”, Description:“Token has been expired or revoked.”, Uri:“”
Google.Apis.Auth.OAuth2.Responses.TokenResponse+d__36.MoveNext () (at :0)
I already removed access in my google account for the service, replaced the SheetsServiceProvider clientID and secret in case it has changed (though it didn’t changed as far as I’ve seen) and reauthenticated:
Authorized: 23.09.2021 14:22:07
UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
But as soon as i press pull on a table the token immediately seems to be expired.
Any idea what could cause the problem? Can I delete the cached token somewhere in case some leftover data invalidates new authentications?
I deleted the whole OAuth 2 Client ID in the google console and created a new one:
Now I get Invalid URI-Redirection when trying to authenticate with the new client-id and secret, which I did not had with the previous key, Also tried adding the mentioned URI in the box, but that doesn’t stop the error from appearing this is so weird, that it was working for days now without that.
No, I had to add http://127.0.0.1/authorize/ manually this time as URI in the Google-Console to even being able to authenticate via a google user, but the error on pull/create spreadsheet remain with the new token too
EDIT:
The error was different this time:
Create Spreadsheet: Failed
Error:“deleted_client”, Description:“The OAuth client was deleted.”, Uri:“”
Preparing Request: 0s
Sending create request: 0,12s
Total time: 0,12s
although I deleted the local token in Library it seems to have used the old token?!
I suppose the change in console hasn’t been applied already, I will check again tomorrow maybe it works then ^^
Thanks for the input anyway
Do you have multiple spreadsheet providers? Does it authorize successfully but fail when pulling or pushing? Can you try a different spreadsheet? Does the create new sheet button work?
The time-stamp is always off by ~2 hours though (maybe a timezone thing)
I can’t create/pull/push anything anymore it worked early that day though.
I also created a new localization table in case there’s something “broken” with the current one, same behaviour.
Says as #1 something about wrong server-time with invalid grants
I just tested again, invoked authorization on 18:26 (GMT+2) local time.
Minus 2 hours for time-zone offset leaves still ~ 12 Minutes difference, can this be the cause?
Edit Note: The throttled / to much requests stuff I had already checked in Console I’m at less than 1k requests of 10k daily.
Okay, deleting the token, the press push pull, resulted in the same Error as mentioned above with deleted_client.
I afterwards thought okay let’s close Unity, delete the token if it gets recreated, start again and then press push/pull without authorizing.
Sooo I tried to close Unity, but There was a Progressbar-PopUp with Application.mono.cleanup (or sth like that don’t remember the wording sorry)
that was running for like 3 Minutes, before I opened up the task-manager CPU usage was on High, the RAM was getting bigger and bigger. So I suppose some sort of endless loop and or memory leak occured. I then just killed the editor process.
Then I checked whether there was a token, but it remained deleted, so nothing cached was written back.
After opening Unity again I immediately pressen push/pull wich resulted in a “failed” response and a InvalidOperation-Exception instead of invalid_grant error:
Then I tried authenticating again and it worked again with semi correct time offset of only 2 seconds instead of ~12 minutes, after that I pulled/pushed again and it worked flawlessly
So it might have been the time-offset issue or something else totally corrupted the state of the GoogleExtension, I will keep an eye open for the cause if it happens again.
I’m glad you solved it. That sounds really strange. If you do manage to reproduce it then do please file a bug report. I’ll keep an eye out for similar issues.