gpt4 book ai didi

node.js - 错误 :0909006C:PEM routines:get_name:no start line - for google cloud platform in heroku

转载 作者:行者123 更新时间:2023-12-05 05:51:42 37 4
gpt4 key购买 nike

当我尝试使用@google-cloud/storage 时它返回此错误

Error: error:0909006C:PEM routines:get_name:no start line 
2021-12-13T10:36:19.800822+00:00 app[web.1]: at Sign.sign (internal/crypto/sig.js:110:29)
2021-12-13T10:36:19.800823+00:00 app[web.1]: at Object.sign (/app/node_modules/gtoken/node_modules/jwa/index.js:152:45)
2021-12-13T10:36:19.800823+00:00 app[web.1]: at Object.jwsSign [as sign] (/app/node_modules/gtoken/node_modules/jws/lib/sign-stream.js:32:24)
2021-12-13T10:36:19.800824+00:00 app[web.1]: at GoogleToken.requestToken (/app/node_modules/gtoken/build/src/index.js:225:31)
2021-12-13T10:36:19.800824+00:00 app[web.1]: at GoogleToken.getTokenAsyncInner (/app/node_modules/gtoken/build/src/index.js:163:21)
2021-12-13T10:36:19.800824+00:00 app[web.1]: at GoogleToken.getTokenAsync (/app/node_modules/gtoken/build/src/index.js:142:55)
2021-12-13T10:36:19.800825+00:00 app[web.1]: at GoogleToken.getToken (/app/node_modules/gtoken/build/src/index.js:94:21)
2021-12-13T10:36:19.800825+00:00 app[web.1]: at JWT.refreshTokenNoCache (/app/node_modules/google-auth-library/build/src/auth/jwtclient.js:171:36)
2021-12-13T10:36:19.800826+00:00 app[web.1]: at JWT.refreshToken (/app/node_modules/google-auth-library/build/src/auth/oauth2client.js:152:24)
2021-12-13T10:36:19.800826+00:00 app[web.1]: at JWT.getRequestMetadataAsync (/app/node_modules/google-auth-library/build/src/auth/oauth2client.js:284:28)
2021-12-13T10:36:19.800827+00:00 app[web.1]: at JWT.getRequestMetadataAsync (/app/node_modules/google-auth-library/build/src/auth/jwtclient.js:94:26)
2021-12-13T10:36:19.800827+00:00 app[web.1]: at JWT.getRequestHeaders (/app/node_modules/google-auth-library/build/src/auth/oauth2client.js:247:37)
2021-12-13T10:36:19.800827+00:00 app[web.1]: at GoogleAuth.authorizeRequest (/app/node_modules/google-auth-library/build/src/auth/googleauth.js:600:38)
2021-12-13T10:36:19.800828+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-12-13T10:36:19.800828+00:00 app[web.1]: at async Promise.all (index 1)
{ 2021-12-13T10:36:19.800829+00:00 app[web.1]: library: 'PEM routines',
2021-12-13T10:36:19.800829+00:00 app[web.1]: function: 'get_name',
2021-12-13T10:36:19.800829+00:00 app[web.1]: reason: 'no start line',
2021-12-13T10:36:19.800829+00:00 app[web.1]: code: 'ERR_OSSL_PEM_NO_START_LINE'
2021-12-13T10:36:19.800830+00:00 app[web.1]: }
2021-12-13T10:36:19.800879+00:00 app[web.1]: Error error:0909006C:PEM routines:get_name:no start line

看来错误是基于来自谷歌云服务帐户的私钥

-----BEGIN PRIVATE KEY-----
ENTIREKEY
-----END PRIVATE KEY-----

最佳答案

我通过删除键中的 \n 行并手动添加新行解决了这个问题,例如:

私钥:\n---开始私钥----\nShfkkJHNJK\nJeidj\n---结束私钥----\n

收件人:


---BEGIN PRIVATE KEY----
ShfkkJHNJK
Jeidj
---END PRIVATE KEY----

注意:不要忘记最后的 \n

关于node.js - 错误 :0909006C:PEM routines:get_name:no start line - for google cloud platform in heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70333915/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com