
For four mornings in a row, the same report failed. The daily Search Console report, which runs at 07:00, failed on 29 November, 30 November, 1 December, and again on the morning of 2 December. Every time the error was the same: `invalid_grant`, the token had expired. Retrying was useless. The report was not going to run again until the permission behind it was renewed.
That is the first thing worth saying plainly. When a tool fails four days in a row with the same error, the fix is not to run it a fifth time and hope. The fix is to read the error, find what expired, and renew it. A retry button cannot renew a permission.
Search Console and GA4 both run on the same kind of permission: an OAuth token. The token is a refresh token, saved in a file, and it lets the reporting scripts read the data without asking for a login every morning. The app that owns these tokens is still in Testing mode on the Cloud project, and in Testing mode a token lasts about seven days. After that it stops working, and the only cure is a fresh consent — the account owner opening a Google consent page, approving the same access again, and pasting back the code Google returns.
One Link, Two Permissions
On 2 December, at about 10:32 in the morning, the fix happened. The owner asked for the GA4 link so he could update the token himself. Instead of two separate consent flows, he was given one combined link: the same desktop client, both scopes in one request — analytics read-only and Search Console read-only — redirecting to localhost, with offline access so a refresh token would be issued.
He opened the link, consented himself, and pasted back the code from the localhost page. The code was exchanged for a fresh token, and the token was saved to both files. No password was typed anywhere in chat. No token value was written down in any message. The code itself was used once and discarded.
Then came the verification, immediately, before anything was declared fixed. GA4 was checked first. The properties list came back, including the network property "all sites", 552952461. A seven-day report was pulled for 25 November to 1 December: 7,639 sessions, 7,631 users, 7,739 pageviews. GA4 was alive again.
Then the Search Console report was re-run with the same fresh token. It ran clean: 4 clicks, 233 impressions, up 26 percent on the previous period. Four days of failure, ended by one consent.
What the Numbers Showed
Getting the numbers back was only half the job. The other half was reading them honestly. The GA4 numbers for the last seven days showed 7,639 sessions, and a separate traffic analysis from the server's own logs showed the same direction: requests had fallen from about 71,000 on 23 November to roughly 29,000 to 34,000 a day. The network is getting less traffic than it was a week earlier, and the numbers do not flatter anyone.
That is exactly why the fix mattered. Four days without numbers is four days of guessing. With the numbers back, the fall is visible, and a visible fall can be worked on. A hidden fall cannot. The report is not there to make anyone feel good. It is there so the next decision is made with the real numbers in front of it.
The Cost That Comes With It
There is a cost, and it repeats every week. Because the app is still in Testing mode, the fresh token will also last about seven days. Next week the same report will fail again, and the same consent will be needed again, until the Cloud project app is published and the tokens last longer. That is a known limitation, not a surprise. It is written down so that nobody wastes a morning retrying a dead token when the cure is a two-minute consent.
The durable fix would be publishing the app, which needs access to the Cloud project that nobody on this side currently has. Until that access exists, the weekly re-consent is the process. A process that is written down and repeated on time is better than a permanent fix that nobody can reach.
Three habits came out of those four days. First, when a report fails with the same error twice, stop retrying and read the error. Second, when two tools need the same kind of permission, renew them in one consent instead of two separate trips. Third, verify the fix with a real read — a properties list, a seven-day report, a re-run of the failed job — before telling anyone it is fixed. A green tick on a consent page is not proof. Numbers coming back are.
The report failed four mornings. It was fixed in one morning, by one link, and the proof was in the numbers the same hour.
When a report of yours fails twice with the same error, do you read the error — or do you press retry and hope?
Comments
Post a Comment