Google BigQuery OAuth credentials do not refresh

Describe the problem/error/question

I am trying to send data to BigQuery via the BigQuery node with a BigQuery OAuth credential. The OAuth screen is internal, and can only be access by users in the organisation. It is not set to production, as this is not possible for internal screens.

The credentials never refresh, because the refresh token is seemingly invalid. Any help is appreciated!

What is the error message (if any)?

The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

Share the output returned by the last node

NodeApiError: The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. at ExecuteContext.googleBigQueryApiRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Google/BigQuery/v2/transport/index.ts:65:9) at processTicksAndRejections (node:internal/process/task_queues:105:5) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Google/BigQuery/v2/actions/database/insert.operation.ts:183:3) at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Google/BigQuery/v2/actions/router.ts:20:17) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Google/BigQuery/v2/GoogleBigQueryV2.node.ts:27:10) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1185:9) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1534:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2098:11

Information on your n8n setup

  • n8n version: 1.98.1 (Cloud)

Ehy @leonaltstadt,

Try to convert your OAuth consent screen to “External” and set to “Production”: This ensures refresh tokens don’t auto-expire after a week.
As a last resort, use a Service Account for Google Cloud APIs—this avoids OAuth refresh issues for BigQuery

1 Like

Hi @Gallo_AIA , thanks a lot this solved the issue!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.