n8n icon indicating copy to clipboard operation
n8n copied to clipboard

error:1E08010C:DECODER routines::unsupported when using Google Cloud Service Account

Open gadgrandez opened this issue 1 year ago • 19 comments

Bug Description

I am unable to interact with any Google Cloud service that uses a service account. I have tried with BigQuery and Vertex AI so far. The error in the console shows the error: call to gauth.request message: error:1E08010C:DECODER routines::unsupported

To Reproduce

  1. Create a BigQuery Node.
  2. Create or attach a Service Account to the BigQuery Node.
  3. Insert a Project ID and a query in the respective fields.
  4. Run the workflow with a "click" trigger.

Expected behavior

The BigQuery Node should run successfully and return results.

Operating System

Docker

n8n Version

1.53.2

Node.js Version

20

Database

PostgreSQL

Execution mode

main (default)

gadgrandez avatar Aug 10 '24 05:08 gadgrandez

Hey @gadgrandez

That looks like it can't decode the private key which normally means you may not have pasted in the private key value correctly.

From the json file you get from Google can you make sure you copy everything between the " for the private_key value.

Joffcom avatar Aug 10 '24 06:08 Joffcom

Hello @Joffcom. I have found the same instructions in various forums, however I have checked twice and copied it as is. Even when configuring the credential I receive the message "Connection tested successfully" Screenshot_3

The same error occurs on various nodes that use service accounts. I don't know since when it happens, but I haven't had any problems for a few months.

gadgrandez avatar Aug 10 '24 06:08 gadgrandez

Hey @gadgrandez

That is interesting is it just those 2 nodes? I wonder if we don't fully support service accounts with them yet.

I will check on Monday morning.

Joffcom avatar Aug 10 '24 08:08 Joffcom

Ok, I've checked again. The error occurs on AI nodes using the "Google Vertex Chat Model".

Error: error:1E08010C:DECODER routines::unsupported at Sign.sign (node:internal/crypto/sig:128:29) at Object.sign (/usr/local/lib/node_modules/n8n/node_modules/jwa/index.js:152:45) at Object.jwsSign [as sign] (/usr/local/lib/node_modules/n8n/node_modules/jws/lib/sign-stream.js:32:24) at GoogleToken.requestToken (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:232:31) at GoogleToken.getTokenAsyncInner (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:166:21) at GoogleToken.getTokenAsync (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:145:55) at GoogleToken.getToken (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:97:21) at JWT.refreshTokenNoCache (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/jwtclient.js:172:36) at JWT.refreshToken (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/oauth2client.js:153:24) at JWT.getRequestMetadataAsync (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/oauth2client.js:298:28)

Screenshot_4

gadgrandez avatar Aug 12 '24 04:08 gadgrandez

Hey @gadgrandez,

Perfect so just to confirm this is not related to BigQuery and it is more of an issue with the Vertex AI node?

Joffcom avatar Aug 12 '24 07:08 Joffcom

Internal reference for this one is AI-276

Joffcom avatar Aug 13 '24 09:08 Joffcom

Hi @Joffcom. Yes, the issue is with Vertex AI Node.

gadgrandez avatar Aug 13 '24 14:08 gadgrandez

I'm facing same problem here on version 1.53.2

tiburssio avatar Aug 18 '24 03:08 tiburssio

Up, I also had the same problem on Vertex AI Node.

anandarh avatar Aug 19 '24 06:08 anandarh

We have this error too!

Beedataco avatar Aug 21 '24 00:08 Beedataco

same here.

hen0liveira avatar Aug 21 '24 21:08 hen0liveira

This is a problem related to new lines inside the key. I managed to fix the error by switching the key format input type to "expression"

2024-08-25 at 13 27

restyler avatar Aug 25 '24 09:08 restyler

This is a problem related to new lines inside the key. I managed to fix the error by switching the key format input type to "expression"

2024-08-25 at 13 27

Dear @restyler,

Thank you for your suggestion. Unfortunately, it's not working on my side. Could you please share the ending of the key where you put "}}"? In my case, I have it at the end as: -----END PRIVATE KEY-----\n" }}.

surenka11 avatar Aug 30 '24 05:08 surenka11

This is a problem related to new lines inside the key. I managed to fix the error by switching the key format input type to "expression" 2024-08-25 at 13 27

Dear @restyler,

Thank you for your suggestion. Unfortunately, it's not working on my side. Could you please share the ending of the key where you put "}}"? In my case, I have it at the end as: -----END PRIVATE KEY-----\n" }}.

2024-08-30 at 19 52

restyler avatar Aug 30 '24 15:08 restyler

Same here

FredMichel avatar Sep 04 '24 16:09 FredMichel

Had the same problem here using the Vertex node and the solution proposed by @restyler worked for me. It isn't the ideal because the key remains exposed.

davivc avatar Sep 05 '24 17:09 davivc

@davivc Thanks for your comment. I have a question. I managed to connect successfully. But I can not load any project. Did you have the same issue? Thanks a lot. 1 2

surenka11 avatar Sep 09 '24 06:09 surenka11

@surenka11 Yes, it didn't load the projects for me as well. I used the option By ID and wrote manually then it worked. It's painful to do this that way, the credential is not secure but for prototyping now it's fine.

davivc avatar Sep 09 '24 13:09 davivc

I'm having the same issue and @restyler's solution (using expression on private key) doesn't work for me. Do you have other ideas?

Error message

Error: error:1E08010C:DECODER routines::unsupported at Sign.sign (node:internal/crypto/sig:128:29) at Object.sign (/usr/local/lib/node_modules/n8n/node_modules/jwa/index.js:152:45) at Object.jwsSign [as sign] (/usr/local/lib/node_modules/n8n/node_modules/jws/lib/sign-stream.js:32:24) at GoogleToken.requestToken (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:232:31) at GoogleToken.getTokenAsyncInner (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:166:21) at GoogleToken.getTokenAsync (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:145:55) at GoogleToken.getToken (/usr/local/lib/node_modules/n8n/node_modules/gtoken/build/src/index.js:97:21) at JWT.refreshTokenNoCache (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/jwtclient.js:172:36) at JWT.refreshToken (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/oauth2client.js:153:24) at JWT.getRequestMetadataAsync (/usr/local/lib/node_modules/n8n/node_modules/google-auth-library/build/src/auth/oauth2client.js:298:28)

hanamizuki avatar Sep 09 '24 23:09 hanamizuki

Fix got released with [email protected]

janober avatar Sep 18 '24 13:09 janober