Hi
Unfortunately, I have below error when I want to connect to google sheet api:
ERROR: error:0909006C:PEM routines:get_name:no start line
Error: error:0909006C:PEM routines:get_name:no start line
at Sign.sign (internal/crypto/sig.js:80:26)
at Object.sign (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\jwa\index.js:152:45)
at Object.jwsSign [as sign] (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\jws\lib\sign-stream.js:32:24)
at GoogleToken.requestToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:188:31)
at GoogleToken.getTokenAsync (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:127:21)
at GoogleToken.getToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:69:21)
at JWT.refreshTokenNoCache (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:129:36)
at JWT.refreshToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\oauth2client.js:140:25)
at JWT.authorizeAsync (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:112:35)
at JWT.authorize (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:108:25)
Sorry are on the train right now and do not have internet on my notebook. Hope I am anyway able to debug that from my phone.
It could have to do with the private key. In the JSON file which does get downloaded from Google. It contains the newline characters \n instead of actual new lines. When copying it you have to make sure to replace them with actual new lines. So best to hover over the input and click on the edit-icon-window which appears on the right. In the then appearing multil-ine input you can then simply replace and save the changed key. Hope that works!
Actually still looks like everything is just one line instead of multiple ones.You really have to replace all “\n” with an actual new line. So that you have mutlple lines which all have exactly the same length.
So have to look like that:
As long as there is anywhere still a \n in there it will not work.
Error: error:09091064:PEM routines:PEM_read_bio_ex:bad base64 decode
at Sign.sign (internal/crypto/sig.js:80:26)
at Object.sign (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\jwa\index.js:152:45)
at Object.jwsSign [as sign] (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\jws\lib\sign-stream.js:32:24)
at GoogleToken.requestToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:188:31)
at GoogleToken.getTokenAsync (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:127:21)
at GoogleToken.getToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\gtoken\build\src\index.js:69:21)
at JWT.refreshTokenNoCache (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:129:36)
at JWT.refreshToken (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\oauth2client.js:140:25)
at JWT.authorizeAsync (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:112:35)
at JWT.authorize (C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\node_modules\google-auth-library\build\src\auth\jwtclient.js:108:25)
In that case it means you still have a \ backslash in the “Private Key”. You really have to make sure that there are no \n left ANYWHERE. I can reproduce the above error very easily by just adding a backslash anywhere in the “Private Key” as it is not part of base64 and so causes this error.
It is probably best if you simply delete what you currently have as key and then copy it again from the file. Then really go through and make sure you do not forget to replace any. Just to be sure copy it in some kind of text editor and search for \n that you can really not overlook any.
All lines have exactly the same length except the first and the two last ones. So maybe your current error is in any of those lines.
Sorry right now in transit and do not have a computer. Look on Google for creating a Google Service Account. And when you did that, you can choose to download the credentials as JSON which then contains the key.
Thanks for the useful link. I got a service account with the owner role and a private key. But I tried everything under the moon to get the message away. Private key does not contain \ or \n anymore. I tried it with and without the -----BEGIN PRIVATE KEY-----. I shared the doc with the service accounts e-mail address. What am I missing here?
Had the same issue right now, so I thought I’d drop more infos here on the old thread. Turns out, my problem was, that you cannot paste a string with newlines into the one-line Private Key input field. You have to open the multi-line text input area with the button on the right side of the single-line input field.