Google's OAuth 'Testing' mode expires refresh tokens in 7 days. Publish the consent screen before you schedule anything.
TL;DR — If your Google Cloud OAuth consent screen is still in Testing , every refresh token it issues dies after seven days. That is documented behavior, not a bug. My unattended YouTube uploader ran fine for a week and then stopped at 06:45 on a Saturday. The fix is not "re-authenticate"; it is "publish the app", and publishing has prerequisites that took an hour, not a minute. You scheduled it.…
Google's OAuth consent screen testing mode expiring refresh tokens after seven days is documented behavior, not a bug. This was the case for the author's unattended YouTube uploader which stopped working after seven days. To fix this, the app's consent screen must be published, which requires completing three branding fields: application homepage URL, privacy policy URL, and an authorized domain that's verified.
This process can take up to an hour. The fix allowed the author's pipeline to run without interruption after the token refresh. The author suggests that Google should prevent issuing refresh tokens to Testing apps to avoid this issue.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.