Host key verification failed occurred while deploying Cloud Functions

Viewed 1171

Problem

When I try to deploy cloud functions, sometimes Host key verification failed. is occurred.
It seems to be occurred in GCP, because I can be done npm install on my local.

Circumstance

When I replace my ssh key then it seems to be ok for a while, but it will reproduce.

I use gitlab to manage source code and some common repository is in gitlab.
The project which is tried to deploy function has dependency for this common repository.

Environment

node v10.17.0
npm v6.11.3
firebase v7.12.1

Error log

⚠  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}

Code

Here is a snippet of my 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
}

Additional Information

I have found some articles and tried to set "ignore" option to "package-lock.json" and also tried to use node v8, but it is not working.

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

Does anybody have solution??

0 Answers
Related