Why is Gmail Connection Showing a 401 Unauthenticated Error Despite Reconnecting the Account?

This topic was automatically generated from Slack. You can find the original thread here.

Gmail Connection does not work anymore. I used an action to create a draft in Gmail. Worked fine. But now I get a 401 Unauthenticated. I deleted and reconnect the gmail account without success.

AxiosError - Request failed with status code 401
{“error”:{“code”:401,“message”:“Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.“,”status”:“UNAUTHENTICATED”}}

Hi , I couldn’t seem to reproduce your issue on my side (image below). Would you mind sharing more details on steps to reproduce your issue?

Thank you!

Here is the debug log:

export: debug - {
“status”: 401,
“statusText”: “Unauthorized”,
“headers”: {
“cache-control”: “no-cache, no-store, max-age=0, must-revalidate”,
“date”: “Wed, 08 Jan 2025 10:43:03 GMT”,
“expires”: “Mon, 01 Jan 1990 00:00:00 GMT”,
“pragma”: “no-cache”,
“vary”: “Origin, X-Origin, Referer”,
“content-type”: “application/json; charset=UTF-8",
“server”: “ESF”,
“x-xss-protection”: “0",
“x-frame-options”: “SAMEORIGIN”,
“x-content-type-options”: “nosniff”,
“alt-svc”: “h3=\“:443\“; ma=2592000,h3-29=\“:443\“; ma=2592000”,
“transfer-encoding”: “chunked”
},
“config”: {
“transitional”: {
“silentJSONParsing”: true,
“forcedJSONParsing”: true,
“clarifyTimeoutError”: false
},
“adapter”: [
“xhr”,
“http”,
“fetch”
],
“transformRequest”: [
null
],
“transformResponse”: [
null
],
“timeout”: 0,
“xsrfCookieName”: “XSRF-TOKEN”,
“xsrfHeaderName”: “X-XSRF-TOKEN”,
“maxContentLength”: -1,
“maxBodyLength”: -1,
“env”: {},
“headers”: {
“Accept”: “application/json, text/plain, /“,
“Authorization”: “Bearer undefined”,
“User-Agent”: “axios/1.7.9",
“Accept-Encoding”: “gzip, compress, deflate, br”
},
“url”: “https://www.googleapis.com/oauth2/v1/userinfo”,
“method”: “get”
},
“data”: {
“error”: {
“code”: 401,
“message”: “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.“,
“status”: “UNAUTHENTICATED”
}
}
}

Thanks , could you click into Gmail Account prop (the first prop) to see if your account is connected or disconnected?

It is connected - I tried also to delete the pipedream permission in the google account settings and then reconnect in pipedream, still the same error

Is your Google account belonged to a company domain, or Gmail domain?

A company domain

When you reconnect your Gmail with company domain, did you see the permission requested similarly to the image below?

Yes. these are the settings.

I think I solved it now and maybe found an issue:
• This workflow was duplicated from a working one, were the Emails got sent
• In this duplicated workflow the mail step didn’t work.
• What I did no is just duplicate the step in this workflow and deleted the previous one → no it works without problems.
So maybe there is a lag/bug/issue in duplicating a workflow with a gmail step in it?

However, it now works for me, thank you for your helpt!

Oh good to know that it works now.

This is weird. I’ll try to reproduce this issue.

Hi, I played around with it a little bit. Copying the original workflow brings the error in the copied one.
If you need any access there, I can give it to you

Hi , I couldn’t reproduce your issue, as the action works normally on my copied workflow

Could you go to your Project Settings, then enable Give Pipedream Support Access (highlighted in the image below), then paste the workflow url here?

Sure, set the permission. Here is the original workflow: Sign Up - Pipedream

Could you share the copied workflow having the error also?

here: Sign Up - Pipedream

I replaced some data, so you don’t need the trigger data but have test data set up for running

Thanks . We’ll take a look

Hi ok, thank you - just give me information, when you finished, that I can delete the workflows.

Hi , we’ve checked the workflow and suspect it’s because of the action version being outdated. We’ve updated the some Gmail actions in your workflow to the latest version and observed it works. Could you go ahead and update all other Gmail actions version (the button on the top right of the screen when you select the action) then try again?