N8n MS OAUTH2 Token Failing To Be Passed In 10% Of All Executions

Hi,

I’m getting the below error on around 10% of my workflow executions. These only happen on MS Graph or MS Teams requests.

My current n8n setup is:
Self hosted
V2.3.4
Postgres SQL
Docker Compose
Linux (ubuntu 24.04)

it seems as thou either the token isn’t being passed at all in the headers or the token has expired and a new one isn’t auto created. If I try to reprocess the failed execution then it almost always succeeds.

Any help would be greatly appriciated.

image

The error you’re seeing usually means the OAuth2 token isn’t being passed correctly or has expired. Since reprocessing the failed executions works, it suggests a temporary issue with token retrieval.

You might want to make sure the “Authenticate” setting in your MS Graph or MS Teams nodes is set up correctly, and that the “Scopes” are accurate. Also, consider checking your n8n logs for any related errors during the failed executions, which might provide clues about the token refresh process.

Thanks @achamm I’ve changed the logs to debug now so will wait for the next failures and see what they say.

Your welcome!

Thanks @Miliaga - I mis-typed on my original post. I am on V2.3.6 already.

If you have any more questions feel free to ask or you can mark one of our responses, or your own, as the solution to begin closing the post.

Have a good day!

Morning,

I’ve had a myriad of failures yesterday but unfortunately there is nothing in the logs

This is a real pain and seems to not be fixable… Is there a way to handle the error and keep retrying until it works?

Thanks @JohnHalex - I already have this set to retry 5 times at 5 second intervals. Normally I have to wait a couple of minutes before retrying to get the node to succeed.

Hi @JohnHalex

I’ve already restarted n8n, created new credentials and I get the same errors. It’s like n8n just isn’t passing any auth headers in the request “sometimes”