Deploy failed / Host key verification failed. from gitlab private repository

I have a blog with hugo and repository in gitlab.com. Deploy failed in today. Latest deploy succeed in November.

When checking out from a private repository on Gitlab, the error “Host key verification failed” appears to occur in the middle of the checkout process.

12:52:20 PM: Host key verification failed.
12:52:20 PM: fatal: Could not read from remote repository.
12:52:20 PM: Please make sure you have the correct access rights
12:52:20 PM: and the repository exists.
12:52:20 PM: fatal: could not fetch 89beb7bfef7046a3987603ee9e79da6e02da138f from promisor remote

The relevant error message (could not fetch %s from promisor remote) is outputted in https://github.com/git/git/blob/master/promisor-remote.c . Is this issue raised by gitlab or git client ?

12:52:14 PM: 1. build.command from netlify.toml
12:52:14 PM: ────────────────────────────────────────────────────────────────
12:52:14 PM: ​
12:52:14 PM: $ npm run build && export GIT_CONFIG_NOSYSTEM=true && hugo --gc --minify && npm run algolia
12:52:14 PM: > rohead@1.0.0 build /opt/build/repo
12:52:14 PM: > netlify-lambda build src/functions/
12:52:14 PM: netlify-lambda: Building functions
12:52:19 PM: Hash: 4095b8bb810a5bf7ba72
12:52:19 PM: Version: webpack 4.46.0
12:52:19 PM: Time: 4596ms
12:52:19 PM: Built at: 01/05/2023 3:52:19 AM
12:52:19 PM: Asset Size Chunks Chunk Names
12:52:19 PM: ogpfunction.js 1.05 MiB 0 [emitted] ogpfunction
12:52:19 PM: Entrypoint ogpfunction = ogpfunction.js
12:52:19 PM: [4] /opt/build/repo/node_modules/fast-xml-parser/src/util.js 2.87 KiB {0} [built]
12:52:19 PM: [6] /opt/build/repo/node_modules/tslib/tslib.es6.js 12 KiB {0} [built]
12:52:19 PM: [16] /opt/build/repo/node_modules/cheerio/lib/static.js 6.5 KiB {0} [built]
12:52:19 PM: [23] /opt/build/repo/node_modules/fast-xml-parser/src/xmlstr2xmlnode.js 10.4 KiB {0} [built]
12:52:19 PM: [39] /opt/build/repo/node_modules/cheerio/lib/load.js 2.31 KiB {0} [built]
12:52:19 PM: [62] /opt/build/repo/node_modules/ogp-parser/dist/utils/getContents.js 3.37 KiB {0} [built]
12:52:19 PM: [63] /opt/build/repo/node_modules/axios/index.js 40 bytes {0} [built]
12:52:19 PM: [80] ./ogpfunction.js 1.11 KiB {0} [built]
12:52:19 PM: [81] /opt/build/repo/node_modules/ogp-parser/dist/main.js 3.8 KiB {0} [built]
12:52:19 PM: [82] /opt/build/repo/node_modules/ogp-parser/dist/utils/parseHtml.js 2.3 KiB {0} [built]
12:52:19 PM: [83] /opt/build/repo/node_modules/cheerio/lib/index.js 1.98 KiB {0} [built]
12:52:19 PM: [120] /opt/build/repo/node_modules/ogp-parser/dist/utils/fetchOembed.js 5.5 KiB {0} [built]
12:52:19 PM: [150] /opt/build/repo/node_modules/ogp-parser/dist/utils/charsetConverter.js 1.07 KiB {0} [built]
12:52:19 PM: [206] /opt/build/repo/node_modules/fast-xml-parser/src/parser.js 2.66 KiB {0} [built]
12:52:19 PM: [214] /opt/build/repo/node_modules/he/he.js 98.5 KiB {0} [built]
12:52:19 PM: + 202 hidden modules
12:52:20 PM: Building sites … ERROR 2023/01/05 03:52:20 Failed to read Git log: e6f6b65b349bd3a4b96a3a483f028421aa6e4c27e6f6b65avoid ogphogehogehogehoge@localhost2023-01-05 12:24:00 +0900

(snip)    

12:52:20 PM: content/post/Systemd-automount/index.md
12:52:20 PM: 179ed0e7c47e930915080a06edc8fb119ff8dd7f179ed0eupdate articlehogehogehogehoge@localhost2020-11-08 16:46:49 +0900
12:52:20 PM: content/post/All-review-articles-here/index.md
12:52:20 PM: Host key verification failed.
12:52:20 PM: fatal: Could not read from remote repository.
12:52:20 PM: Please make sure you have the correct access rights
12:52:20 PM: and the repository exists.
12:52:20 PM: fatal: could not fetch 89beb7bfef7046a3987603ee9e79da6e02da138f from promisor remote
12:52:40 PM: WARN 2023/01/05 03:52:20 Page’s .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.
WARN 2023/01/05 03:52:40 Page’s .UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID.
WARN 2023/01/05 03:52:40 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
12:52:40 PM: WARN 2023/01/05 03:52:40 Page’s .Dir is deprecated and will be removed in a future release. Use .File.Dir.
WARN 2023/01/05 03:52:40 .File.Dir on zero object. Wrap it in if or with: {{ with .File }}{{ .Dir }}{{ end }}
12:52:41 PM: Total in 21389 ms
12:52:41 PM: Error: Error building site: logged 1 error(s)
12:52:41 PM: ​
12:52:41 PM: “build.command” failed
12:52:41 PM: ────────────────────────────────────────────────────────────────
12:52:41 PM: ​
12:52:41 PM: Error message
12:52:41 PM: Command failed with exit code 255: npm run build && export GIT_CONFIG_NOSYSTEM=true && hugo --gc --minify && npm run algolia (Search results for '"non-zero exit code: 255"' - Netlify Support Forums)
12:52:41 PM: ​
12:52:41 PM: Error location
12:52:41 PM: In build.command from netlify.toml:
12:52:41 PM: npm run build && export GIT_CONFIG_NOSYSTEM=true && hugo --gc --minify && npm run algolia
12:52:41 PM: ​
12:52:41 PM: Resolved config
12:52:41 PM: build:
12:52:41 PM: command: npm run build && export GIT_CONFIG_NOSYSTEM=true && hugo --gc --minify && npm run algolia
12:52:41 PM: commandOrigin: config
12:52:41 PM: environment:
12:52:41 PM: - HUGO_VERSION
12:52:41 PM: - HUGO_ENV
12:52:41 PM: - HUGO_ENABLEGITINFO
12:52:41 PM: publish: /opt/build/repo/public
12:52:41 PM: publishOrigin: config
12:52:41 PM: functionsDirectory: /opt/build/repo/functions
12:52:41 PM: Caching artifacts
12:52:41 PM: Started saving node modules
12:52:41 PM: Finished saving node modules
12:52:41 PM: Started saving build plugins
12:52:41 PM: Finished saving build plugins
12:52:41 PM: Started saving pip cache
12:52:41 PM: Finished saving pip cache
12:52:41 PM: Started saving emacs cask dependencies
12:52:41 PM: Finished saving emacs cask dependencies
12:52:41 PM: Started saving maven dependencies
12:52:41 PM: Finished saving maven dependencies
12:52:41 PM: Started saving boot dependencies
12:52:41 PM: Finished saving boot dependencies
12:52:41 PM: Started saving rust rustup cache
12:52:41 PM: Finished saving rust rustup cache
12:52:41 PM: Started saving go dependencies
12:52:41 PM: Finished saving go dependencies
12:52:42 PM: Cached ruby version 2.6.2
12:52:42 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:52:42 PM: Failing build: Failed to build site
12:52:43 PM: Finished processing build request in 1m13.081724633s

hi @utimukat55

This feels like an issue with us not being able to reach the specific endpoint. Does it work locally? If so, are you adding any necessary keys to your envronment variables?

Thanks

@gualter ,
thanks for reply. I tested build hugo locally and results were success in 3 patterns.

  • hugo server
  • hugo
  • hugo --gc --minify

So, what I am wondering is that there appears to be an error during the git checkout process. I made my blog with netlify using gitlab login. I have never set any key to read gitlab repository. Please let me know if there are any points of reference that I should refer to.

thanks.

Any success in solving the issue?

I started to have this issue too. None of the previous deploys failed.

hi @DataCorrupted and @rmarto

We’re you able to sort this out? I can see you both have sucessful builds now.

@utimukat55 maybe the solution they potentially offer may help on your end.

Ah yes, opting HUGO_ENABLEGITINFO = "false" helped. ("build.command" failed - Git-related? - #7 by nathanmartin)

I see a lot of similar posts starting Jan 6. My guess is some config broke at Netlify side. But the workaround works for me now.

I reported my netlify build was back to success.

I just changed HUGO_VERSION to HUGO_VERSION = 0.59.1 in netlify.toml. before was HUGO_VERSION = “0.55.6”. But 0.55.6 was success in last November.

This is not the problem I had in mind, but maybe the hugo version will change the result.

thanks for working.