I am trying to deploy my project from github and getting the error :
error An unexpected error occurred: “Commit hash required”
Seems to be a problem with dependencies but need help
my netlify name is : effortless-conkies-c23bc6
the log is pasted below:
7:46:06 PM: Waiting for other deploys from your team to complete. Check the queue:
Netlify App
7:46:32 PM: Build ready to start
7:46:34 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
7:46:34 PM: build-image tag: v4.10.1
7:46:34 PM: buildbot version: 3f3056558a30449e4099db9c1a8b041604d2b6f5
7:46:35 PM: Building without cache
7:46:35 PM: Starting to prepare the repo for build
7:46:35 PM: No cached dependencies found. Cloning fresh repo
7:46:35 PM: git clone
https://github.com/pbirbarah/NFE
7:46:36 PM: Preparing Git Reference refs/heads/main
7:46:37 PM: Parsing package.json dependencies
7:46:38 PM: Starting build script
7:46:38 PM: Installing dependencies
7:46:38 PM: Python version set to 2.7
7:46:38 PM: Downloading and installing node v16.17.0…
7:46:38 PM: Downloading
https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz
…
7:46:39 PM: Computing checksum with sha256sum
7:46:39 PM: Checksums matched!
7:46:41 PM: Now using node v16.17.0 (npm v8.15.0)
7:46:41 PM: Started restoring cached build plugins
7:46:41 PM: Finished restoring cached build plugins
7:46:41 PM: Attempting ruby version 2.7.2, read from environment
7:46:42 PM: Using ruby version 2.7.2
7:46:42 PM: Using PHP version 8.0
7:46:42 PM: Started restoring cached yarn cache
7:46:42 PM: Finished restoring cached yarn cache
7:46:42 PM: No yarn workspaces detected
7:46:42 PM: Started restoring cached node modules
7:46:42 PM: Finished restoring cached node modules
7:46:42 PM: Installing NPM modules using Yarn version 1.22.10
7:46:42 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
7:46:42 PM: npm WARN config location in the cache, and they are managed by
7:46:42 PM: npm WARN config
cacache
.
7:46:43 PM: yarn install v1.22.10
7:46:43 PM: [1/4] Resolving packages…
7:46:43 PM: warning react-scripts > webpack-dev-server > chokidar > [email protected] : fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
7:46:43 PM: [2/4] Fetching packages…
7:46:47 PM: error An unexpected error occurred: “Commit hash required”.
7:46:47 PM: info If you think this is a bug, please open a bug report with the information provided in “/opt/build/repo/yarn-error.log”.
7:46:47 PM: info Visit
yarn install | Yarn
for documentation about this command.
7:47:06 PM: Error during Yarn install
7:47:06 PM: Build was terminated: Build script returned non-zero exit code: 1
7:47:06 PM: Creating deploy upload records
7:47:06 PM: Failing build: Failed to build site
7:47:06 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1 (
Search results for '"non-zero exit code: 1"' - Netlify Support Forums
)
7:47:06 PM: Finished processing build request in 31.881170593s
Hey
@pbirbarah
It appears this is an issue with
yarn
. There are a few possible solutions offered in this issue.
github.com/yarnpkg/yarn
I've got a project, that has been running fine for months, where suddenly adding
…
/installing `eth-lightwallet` fails during `fetching packages` with `An unexpected error occurred: "Commit hash required".`
Suddenly is defined as between March 21st, 9:51AM CET - March 22nd, 5:30PM CET with a commit that did not touch the package.json or lock files (just a css and html fix)
I've tried:
- changing node version 7.7.4 and 7.7.1 (on 7.7.1 it worked before without question)
- removing all caches, npm_modules, lockfiles
- it fails both on a linux (alpine and debian) ci docker image, and on OSX
- *created a new project and added it. this worked, so it's my dependency set that breaks it*
- it appears to be related to bignumber.js in the dependencies, so tried a lot of different formats in https://github.com/roderik/eth-lightwallet.git
- added `if (!commit) console.log(_this2)` to my git-fetcher.js line 113 and installed using `yarn add https://github.com/roderik/eth-lightwallet.git --verbose --network-concurrency 1 --force` Result: https://gist.github.com/roderik/f5ff6abfcdcdb364f2a5327016317de0 and the error log, but this does not show a reason for the commit hash to be empty
- *it installs fine with npm, so it's my dependencies + yarn*
I'm stumped and reverted to `yarn install || npm i` on my ci, but this is not really the way it's supposed to be.
I don’t see anything about
git checkout
in that issue. Mind elaborating on where you found this, and what exactly you have tried?
Have you tried the
last suggestion of deleting the
yarn.lock
file
, running
git stash
or committing changes?
Note, this
isn’t
an Netlify-specific issue here, this is an issue with yarn.