-
Notifications
You must be signed in to change notification settings - Fork 14
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
Invalid authentication credentials Google Analytics importer plugin #242
Comments
@niklasternstedt Have you followed all the steps mentioned here ? |
Got the same problem. But not always. Sometimes it run fine until the expected rate-limit. But sometimes is crash with this error, same as niklasternstedt. Did a re authorize a few times, no difference. Have to start it manually every time after this. Can't figure out what the problem is since it does work half of the time. Could it be that since Google Analytics 3 is ending soon, many people are using the export function that it is overloading? |
Thanks for looking into this. It seems that when the status is killed with this error, that it won't restart. At least, I waited over a day and no new dates were imported. When I clicked the start button again, sometimes it gives the error directly again, but many times it just resumed without a problem till it errored out again. Sometimes after hours, sometimes after 10 minutes or so. It feels a bit random, therefor hard to point into a direction for me. |
For what it’s worth, I’m also getting similar errors with a more current setup: As with others on this thread, it's happening well before 7 days from authentication. Also similarly, if I re-authenticate it seems to temporarily fix the issue but usually only for another short period of time (usually less than a day). |
This issue has been mentioned on Matomo forums. There might be relevant details there: |
@nicksherman @JackySw Can you confirm following things If you see no scopes and app in testing mode, can you publish the app and reauthorise via Matomo GA Import UI ? and check if this issue still persist ? Also can you check the The import should start automatically as we have a Task which check and restarts all the failed imports |
@AltamashShaikh Thanks for lending a hand! To answer your questions:
I have 3 separate sites set up with GA importing in my Matomo installation, but the
|
@nicksherman No need to change anything |
@nicksherman I see its rate_limited, do you see any value when you run this query ? |
@AltamashShaikh I'm guessing the The value for This is what the Matomo UI looks like (with site names and GA specifics redacted): Is it expected that there is only one |
@nicksherman The UI is displaying correctly you have hit a Daily rate limit and the import will start after Can you check after |
@AltamashShaikh Since I'm in the Eastern US time zone, that Should I force the imports to resume from the Actions buttons in the UI? In the past I've had mixed luck with that. Usually it runs for a bit before hitting another error. |
@nicksherman you have auto archiving cron setup right? Link to FAQ |
@AltamashShaikh I haven't set up an archiving cron via a server script (that wasn't mentioned in the GA Importer setup guide). Following the recommendations in General Settings > Archiving Settings, I do have Matomo set to "Archive reports when viewed from the browser", at most every 900 seconds (the default settings). Is this something I should change? My server does support cron jobs. |
@nicksherman This is the reason, why the import doesn't resume after an error and needs a manual resume. If you have no problem in setting a cron, I would recommend you to do that else you can manually restart the import for now |
@AltamashShaikh Ok, I had some trouble getting the proper cron script working but I've at least managed to set up a web cron for now. For what it's worth, and at the risk of going too far off the topic of this thread, the instructions on the auto-archiving instructions page are a bit misleading. When instructing how to find your token_auth code, they say:
But there are a couple issues with that …
As far as I can tell, there is no way to retrieve an existing 32-character token_auth code. I was able to get around this by creating a new token – the related code is shown in the process, but after that it is buried like the other existing tokens. |
@AltamashShaikh In an interesting turn of events, I am still hitting a In the mean time I'll leave my web cron in place and see if/when that has any luck. |
@nicksherman so what the plugin does is whenever we encounter a 429 exception it checks if the exception message is for daily/hourly and accordingly saves the values in Can you run this command and check the output ? |
@AltamashShaikh When I run the Is it unusual that the restart date is more than 24 hours after the most recent round of successful imports? |
@nicksherman I checked the code Its in UTC timezone, is that correct as per UTC ? |
@AltamashShaikh Ah, yes that makes sense. In the mean time, however, my imports are still stalled as |
@nicksherman It did run for today right automatically till it got a rate_limit ? |
@AltamashShaikh Ah yes, apologies, I mistakenly was looking at an old tab where the Last Day Processed dates hadn't been updated yet. This is a bit of a tangent, but is there some way to pause one import job without cancelling it entirely? That would be handy to allow more requests to be used on higher-priority import jobs first. |
@nicksherman I can think only of this solution for now quickly
|
@AltamashShaikh Ok I may give it a shot depending on how long it takes to process these imports (it's annoying that Google no longer accepts quota increase requests for Google Analytics APIs). Thank you so much for your help with all this stuff. I would have been totally lost otherwise so I really appreciate it a lot! |
@niklasternstedt @JackySw Can we close this issue ? |
Hi, I tested it for a few days now and so far so good! Very happy with it. I saw once an error, but it did resume. Now I've seen the rate_limited status for 3 days in a row (of course only when it hits the limit, so this is good) and it keeps importing. From this side, no problems anymore. Very happy with the outcome. |
@JackySw good to hear this 😄 |
This issue has been mentioned on Matomo forums. There might be relevant details there: |
Expected Behavior
Possible to import data from Google Analytics without any errors.
Current Behavior
When importing data from Google Analytics I get this error message:
{ “error”: { “code”: 401, “message”: "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See [https://developers.google.com/identity/sign-in/web/devconsole-project."](https://developers.google.com/identity/sign-in/web/devconsole-project.%22), “errors”: [ { “message”: “Invalid Credentials”, “domain”: “global”, “reason”: “authError”, “location”: “Authorization”, “locationType”: “header” } ], “status”: “UNAUTHENTICATED” } }
Your Environment
The text was updated successfully, but these errors were encountered: