n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.73k stars 7.27k forks source link

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

Closed gadgrandez closed 1 month ago

gadgrandez commented 2 months ago

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)

Joffcom commented 2 months ago

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.

gadgrandez commented 2 months ago

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.

Joffcom commented 2 months ago

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.

gadgrandez commented 2 months ago

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

Joffcom commented 2 months ago

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 commented 2 months ago

Internal reference for this one is AI-276

gadgrandez commented 2 months ago

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

tiburssio commented 2 months ago

I'm facing same problem here on version 1.53.2

anandarh commented 2 months ago

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

Beedataco commented 2 months ago

We have this error too!

hen0liveira commented 2 months ago

same here.

restyler commented 2 months ago

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

surenka11 commented 1 month ago

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" }}.

restyler commented 1 month ago

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

FredMichel commented 1 month ago

Same here

davivc commented 1 month ago

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.

surenka11 commented 1 month ago

@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

davivc commented 1 month ago

@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.

hanamizuki commented 1 month ago

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)
janober commented 1 month ago

Fix got released with n8n@1.60.0