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

Crash when installing: enoent ENOENT: no such file or directory #2460

Open
jamesbraza opened this issue Oct 17, 2024 · 14 comments · May be fixed by #2628
Open

Crash when installing: enoent ENOENT: no such file or directory #2460

jamesbraza opened this issue Oct 17, 2024 · 14 comments · May be fixed by #2628
Labels
help wanted Extra attention is needed

Comments

@jamesbraza
Copy link
Contributor

With this pre-commit-config.yaml:

---
default_language_version:
  python: python3
repos:
  - repo: https://github.com/renovatebot/pre-commit-hooks
    rev: 38.124.1
    hooks:
      - id: renovate-config-validator

When installing pre-commit with pre-commit==4.0.1, a coworker of mine is getting this error:

[INFO] Installing environment for https://github.com/renovatebot/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/user/.cache/pre-commit/repou0t83qeh/node_env-default/bin/node', '/Users/user/.cache/pre-commit/repou0t83qeh/node_env-default/bin/npm', 'pack')
return code: 254
stdout: (none)
stderr:
    (node:99944) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)
    npm warn tarball tarball data for file:/Users/user/.cache/pre-commit/repou0t83qeh/ (null) seems to be corrupted. Trying again.
    npm warn tarball tarball data for file:/Users/user/.cache/pre-commit/repou0t83qeh/ (null) seems to be corrupted. Trying again.
    npm error code ENOENT
    npm error syscall lstat
    npm error path /Users/user/.cache/pre-commit/repou0t83qeh/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes
    npm error errno -2
    npm error enoent ENOENT: no such file or directory, lstat '/Users/user/.cache/pre-commit/repou0t83qeh/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes'
    npm error enoent This is related to npm not being able to find a file.
    npm error enoent
    npm error A complete log of this run can be found in: /Users/user/.npm/_logs/2024-10-17T01_27_47_135Z-debug-0.log
Check the log at /Users/user/.cache/pre-commit/pre-commit.log

Any ideas what went wrong here? I think Renovate should at least nice-ify the failure message hit

@jamesbraza jamesbraza changed the title Crash when setting up Crash when installing: enoent ENOENT: no such file or directory Oct 17, 2024
@jonyscathe
Copy link

Get the same thing on rev 38.120.1 and 38.124.2 with pre-commit 3.8.0 and 4.0.1.

Running an ubuntu 24.04 LTS image in WSL2.

And this was all working fine a couple of days ago (albeit probably a slightly older rev).

@jonesbusy
Copy link

jonesbusy commented Oct 17, 2024

Same here... No idea what's going on

Happen on WSL2 but also when running precommit on Jenkins CI.

    npm error path /home/****/.cache/pre-commit/repob_i34tjc/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes
    npm error errno -2
    npm error enoent ENOENT: no such file or directory, lstat '/home/****/.cache/pre-commit/repob_i34tjc/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes'
    npm error enoent This is related to npm not being able to find a file.

Tested rev: 38.120.1 and rev: 38.122.0

@krakeusz
Copy link

Same for me.
Linux Ubuntu 20.04, pre-commit 2.21.0 and 3.5.0. renovatebot 38.124.1.
I had to use pre-commit run to trigger this failure.

@jonesbusy
Copy link

Looking at logs

24 verbose os Linux 5.15.133.1-microsoft-standard-WSL2
25 verbose node v23.0.0
26 verbose npm  v10.9.0
27 verbose exit -2

Could it be related to recent Node 23 ? Where is it defined ? renovate ? precommit ?

@jonesbusy
Copy link

Temporary workarround

  - repo: https://github.com/renovatebot/pre-commit-hooks
    rev: 38.120.1
    hooks:
      - id: renovate-config-validator
        language_version: 20.18.0

@jamesbraza
Copy link
Contributor Author

An alternate workaround I rolled yesterday was moving from pre-commit to the GitHub Action https://github.com/suzuki-shunsuke/github-action-renovate-config-validator. My thinking is that one doesn't need to revalidate a Renovate config every commit (as the config is static for 99.9% of commits).

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.1.0

@jonyscathe
Copy link

jonyscathe commented Oct 20, 2024

Ok...
I had node v18.19.1 installed and was getting this error.
I updated node to v23.0.0 and stopped getting this error.

Though now the Installing environment for https://github.com/renovatebot/pre-commit-hooks. step takes a ridiculously long time

@KrzysztofadamBarden-TomTom

im having similiar issue on ubuntu 22.04, notice that it always cuts a letter
*/repo******/MISSING_FIRST_LETTER/*
in the provided log:
npm error enoent ENOENT: no such file or directory, lstat '/Users/user/.cache/pre-commit/repou0t83qeh/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes'

cuts n from ode_env-default

@viceice viceice added the help wanted Extra attention is needed label Oct 23, 2024
@viceice
Copy link
Member

viceice commented Oct 23, 2024

there's nothing we maintainer can do here, we don't use this, so it needs a community fix.

@nfelt14
Copy link

nfelt14 commented Oct 23, 2024

Perhaps it is a pre-commit or nodeenv issue?

@viceice
Copy link
Member

viceice commented Dec 5, 2024

Perhaps it is a pre-commit or nodeenv issue?

yes. Renovate doesn't support node v23 and v21. We only support LTS versions (currently v20 and v22)

@hofbi
Copy link

hofbi commented Dec 5, 2024

Would it make sense to define the node version in https://github.com/renovatebot/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml? Then this repo could control the recommended version that is supported.

@viceice
Copy link
Member

viceice commented Dec 5, 2024

sure, feel free to open a PR. needs also a renovate config update to bump that version to next major lts if available

@hofbi hofbi linked a pull request Dec 5, 2024 that will close this issue
@hofbi
Copy link

hofbi commented Dec 5, 2024

@viceice please reivew #2628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants