部署云功能时主机密钥验证失败

时间:2020-04-09 03:01:19

标签: firebase google-cloud-functions

问题

当我尝试部署云功能时,有时会发生Host key verification failed.
它似乎发生在GCP中,因为我可以在本地执行npm install

情况

当我替换我的ssh密钥时,似乎可以使用一段时间,但它会重现。

我使用gitlab来管理源代码,并且gitlab中有一些常见的存储库。
试图部署功能的项目对此通用存储库具有依赖性。

环境

节点v10.17.0
npm v6.11.3
Firebase v7.12.1

错误日志

⚠  functions[appv1(us-central1)]: Deployment error.
Build failed: {"error":{"buildpackId":"google.nodejs.npm","buildpackVersion":"0.9.0","errorType":2,"canonicalCode":2,"errorId":"b0ba1f57","errorMessage":"npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142\nnpm WARN deprecated sendgrid@1.9.2: Please see v6.X+ at https://www.npmjs.com/org/sendgrid\nnpm WARN deprecated core-js@2.6.11: core-js@\u003c3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.\nnpm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.\nnpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\nnpm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\nnpm ERR! Error while executing:\nnpm ERR! /usr/bin/git ls-remote -h -t ssh://git@gitlab.com/myrepos/my-rpc-client.git\nnpm ERR! \nnpm ERR! Host key verification failed.\nnpm ERR! fatal: Could not read from remote repository.\nnpm ERR! \nnpm ERR! Please make sure you have the correct access rights\nnpm ERR! and the repository exists.\nnpm ERR! \nnpm ERR! exited with error code: 128\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /builder/home/.npm/_logs/2020-04-09T02_36_20_019Z-debug.log"},"stats":null}

代码

这是我的package.json的片段

{
  "name": "functions",
  "scripts": {
    "lint": "eslint \"src/**/*.ts\" --cache",
    "build": "tsc",
    "buildWatch": "tsc --watch",
    "serve": "npm run build && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log",
    "test": "jest --coverage --verbose"
  },
  "dependencies": {
    "@google-cloud/firestore": "^3.7.3",
    "@google-cloud/logging": "^5.5.5",
    "my-rpc-client": "git+ssh://git@gitlab.com/myrepos/my-rpc-client.git#1.0.0",
  },
  "private": true
}

其他信息

我找到了一些文章,并尝试将“ ignore”选项设置为“ package-lock.json”,并且还尝试使用节点v8,但它不起作用。

https://github.com/firebase/firebase-functions/issues/446
https://github.com/firebase/firebase-functions/issues/607

有人有解决办法吗?

0 个答案:

没有答案