I’m trying to connect my Hubspot App using OAuth2 credentials. I managed to connect it successfully and I can make HTTP calls to Hubspot using the HTTP node. Actually I can run the full workflow.
Hubspot access tokens live span is 30 minutes, so after that it need to be refreshed.
During the first 30 minutes after the initial authentication everything works fine, but after that I get a 400 error:
"message":"missing or unknown client id",
I assume that happens because the refresh has not been successful.
How does n8n handle access token refreshes? Is some extra config needed in the OAuth config window?
Information on your n8n setup
n8n version: 0.206.1
Running n8n via [Docker, npm, n8n.cloud, desktop app]: n8n.cloud
We had a similar issue with OAuth2 tokens expiring and not getting refreshed. Basically as soon as they expired we started getting 401 exceptions on our API calls that the token was expired but they didn’t automatically recover. As soon as I ‘reconnected’ the credential the workflows started working again as expected but it expired again at the same time as the OAuth token expiring.
We were on 0.209.4 at the time and have just updated to 0.213.0 to see if it fixes the issue. We didn’t notice the issue on the previous version we were on before 0.209.4 (I forget the exact version).
Do you know by chance when the issue first came up? And which version it was fixed in?
I have the same problem, connecting to Google Bigquery with Oauth2. First manual connect is fine, but a later refresh does not seem to work. If I schedule a workflow to run automatically +5 hours after my manuall reconnect I get the error.
Looking at the failed bigquery node it says:
And stack says:
NodeApiError: UNKNOWN ERROR - check the detailed error for more information
at Object.execute (/app/code/node_modules/n8n-nodes-base/nodes/HttpRequest/V1/HttpRequestV1.node.ts:988:12)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Workflow.runNode (/app/code/node_modules/n8n-workflow/src/Workflow.ts:1270:19)
I’m currently on v.0.214.0 - and still experience this issue.
Tried looking into logs, but nothing to see there.
Hi all, OAuth2 can be a pain I am afraid. I don’t know what exactly might be wrong in your specific case @LE_Christensen, but I have complained to our poor product team many times about the limited error logging around OAuth2 refreshes (just for internal reference, this is issue N8N-5992).
Are you using generic OAuth2 credentials (for example to sue the HTTP Request node) when running into this issue or are you using BigQuery-specific credentials?
Since the BigQuery module can only do “Create” or “Get Many” I have to use a HTTP Request Node for my usecases.
I am using a HTTP Request Node for calling BigQuery API - I can only use a generic OAuth2 crediential type, I don’t get the option to chose BiqQuery specific credentials for the HTTP Request Node.
I updated to [email protected] yesterday - and it still gave me same error. The message “UNKNOWN ERROR - check the detailed error for more information” is making me sad. I have no idea where I can see “detailed error”. I tried looking into server-logs, but there is nothing.
Hi @LE_Christensen, I understand your frustration and actually share it to quite some extent. OAuth2 issues are extremely frustrating for me as well and the output you have shared does not make it easier. That said, the BigQuery node will soon get an upgrade and you might want to follow the process on the respective pull request:
Lastly, you can always use the HTTP Request node without pre-configured authentication to manually make the requests required to fetch & renew a token. This gives you the maximum amount of flexibility and avoids n8n’s built-in OAuth2 logic completely.
I will keep an eye on the bigquery node improvements in github (subscribed to notifications).
The upcoming changes looks good. From what I can read from the committed code, it seems like BigQuery node will be able to use service accounts, including running a custom query - thats really awesome.
I suppose if the feature is not ready in a week or so, I will probably do as you suggest, to create my own fetch & refresh token flow. Until then I manage by manually reconnecting, and manually running the workflow.
I have checked the internal ticket and it looks like it is still being reviewed, I would love to give you a timeline but I just don’t have one at the moment. I will bring it up in our node team review meeting tomorrow morning though.
I did indeed, The node is still being reviewed but the chap that worked on it seemed fairly confident that was all good. The internal assignee for the review was away but has also been very busy with other features so this is one of those things that got moved down the queue a bit but it will be happening.
I’ve tried to make a workflow to manually make the request to fetch and renew a token from google bigquery api (oauth2) - but I’m at a loss on how to do it properly. Do you have an example on how to solve such a manual fetch and renewal of oauth2 token in n8n ?