Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! cb() never called! #100

Open
moltar opened this issue Jun 19, 2021 · 7 comments
Open

npm ERR! cb() never called! #100

moltar opened this issue Jun 19, 2021 · 7 comments

Comments

@moltar
Copy link

moltar commented Jun 19, 2021

I know this is not directly under this action's control, but I am raising it here, in case there is some effect.

I'm getting the following error intermittently:

Run bahmutov/npm-install@v1
  with:
running npm-install GitHub Action
trying to restore cached NPM modules
npm cache hit undefined
installing NPM dependencies
npm at "/opt/hostedtoolcache/node/14.17.0/x64/bin/npm"
/opt/hostedtoolcache/node/14.17.0/x64/bin/npm ci
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-06-19T10_45_41_566Z-debug.log
Error: The process '/opt/hostedtoolcache/node/14.17.0/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:969:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:952:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/bahmutov/npm-install/v1/dist/index.js:846:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
Error: The process '/opt/hostedtoolcache/node/14.17.0/x64/bin/npm' failed with exit code 1

Any clues?

@YenHub
Copy link
Contributor

YenHub commented Jun 19, 2021

This sounds more like an issue with your dependencies, something doesn't appear to like version 14.17.0

@moltar
Copy link
Author

moltar commented Jun 19, 2021

It happens in CI only though, and randomly without any pattern.

@YenHub
Copy link
Contributor

YenHub commented Jun 20, 2021

Is your package-lock commited to your repository?

Feel free to share a link and I can take a peek ☺️

@moltar
Copy link
Author

moltar commented Jun 21, 2021

Is your package-lock commited to your repository?

Yeah!

Feel free to share a link and I can take a peek ☺️

It's a private repo :(

But I think I've had it happen on the public ones too, when/if it does, I will share the link here.

Any other debug steps I can take?

@Tallyb
Copy link

Tallyb commented Jun 23, 2021

I get this often as well. Pkg-lock is committed, and occasionally I would get it.
Some things to notice, though:

  • Multiple jobs exist in the same workflow, all with the same action, and occasionally one will fail while the other succeed to run npm i.
  • Rerunning the job can often fix the issue
  • It happens after a change in the pkg lock, e.g. upgrading / installing a new package.
    I think it is related to not properly hitting cache, while other jobs are getting the cache properly.
    Hope this helps and can shed some light.

@moltar
Copy link
Author

moltar commented Jun 23, 2021

Yup what @Tallyb said. Same scenario exactly.

@Tallyb
Copy link

Tallyb commented Jul 5, 2021

This seems to happen when there are multiple jobs running in parallel. My analysis is as follow:
Change made to pkg-lock
In all jobs, cache hits undefined (since the pkg-lock changed)
It installs and tries to create the new cache file.
BUT there are multiple jobs that do the same - one succeeds and the others fail, as it already exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants