Failed to update Gmail api in n8n

It’s failed to update gmail api. It be always back to default “_n8n_BLANK_VALUE” at Private Key field.
Could you check this please?

Hey @cmdntd987,

Are you using an expression in that field? If you toggle it from the value to an expression then back again it will break the credential.

The value you are seeing is what we return to the front end when you view the credential so that we don’t leak the credential.

The same when I used “Fixed” option. It seems not able to save exact its value.

Hey @cmdntd987,

What makes you think it isn’t saving the value? If you toggle it to an expression you won’t see the value that is in the database the best way to see that would be to use the cli to export the decrypted credential.

What issue are you actually seeing when trying to use the service account?

It’s hard to check. But it failed when I keep “\n” or remove it from key.

If I keep “\n”:

ERROR: 401 - {"error":"unauthorized_client","error_description":"Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."}

If I remove “\n”

ERROR: secretOrPrivateKey must be an asymmetric key when using RS256

Both of them used “Fixed” like you request, and both are failed when click “Retry” button to connect

How funny when I use “Expression” option (remove “\n”), it seems ok with “Retry” button to connect!

Notice that “Retry” just connect at credential box. After then, workflow still failed to connect, and I can not check what really happened. But Gmail API can not work with this.

I notice this, if you could misunderstand that issue just stop at “Retry” button.

Hey @cmdntd987,

Which version of n8n are you running? Keeping the \n should be ok although it is odd that Google is returning that client error and it works when you remove it on expression.

I’m on 0.231.3

Hey @cmdntd987,

Can you try 1.8.2 and see if that has the same issue?

Not yet. I must build to new database, because I’m just still on mySQL.
Besides, I try to upload to web3 for test. So I must be done bulk of job here.

I will pm after upgrade successfully.

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