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

BUG: pre-commit/repoxoi92sgz/node_env-default/bin/node: libc.so.6: version `GLIBC_2.28' not found #143

Closed
vitkl opened this issue Jan 16, 2023 · 18 comments · Fixed by #144
Closed

Comments

@vitkl
Copy link

vitkl commented Jan 16, 2023

I fail to initialise a repo from this template because pre-commit fails on git commit ....

[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('~/.cache/pre-commit/repoxoi92sgz/node_env-default/bin/node', '~/.cache/pre-commit/repoxoi92sgz/node_env-default/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
stdout: (none)
stderr:
    ~/.cache/pre-commit/repoxoi92sgz/node_env-default/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ~/.cache/pre-commit/repoxoi92sgz/node_env-default/bin/node)

Check the log at ~/.cache/pre-commit/pre-commit.log

The solution presented here jupyterlab/jupyterlab#12675 is adding

default_language_version:
  node: system

to the top of .pre-commit-config.yaml.

However, that solution also fails with:

[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
stdout:
    Executable `npm` not found
stderr: (none)

I tried to solve this by installing conda install -c conda-forge nodejs - however, this also fails:

prettier.................................................................Failed
- hook id: prettier
- exit code: 1

prettier requires at least version 14 of Node, please upgrade

Is prettier really necessary?

@vitkl vitkl changed the title pre-commit/repoxoi92sgz/node_env-default/bin/node: libc.so.6: version `GLIBC_2.28' not found BUG: pre-commit/repoxoi92sgz/node_env-default/bin/node: libc.so.6: version `GLIBC_2.28' not found Jan 16, 2023
@vitkl
Copy link
Author

vitkl commented Jan 16, 2023

I deleted prettier from my project https://github.com/vitkl/cell2module, however, I appear to have the same issue with https://github.com/scverse/scvi-tools - where that won't be a solution.

@grst
Copy link
Collaborator

grst commented Jan 16, 2023

Hi @vitkl, thanks for reporting.

Yes, I think we really would like to have prettier -- it takes care of formatting all non-Python files.
We could consider setting the default_language_version. This requires nodejs to be installed on your system which seems to be the reason why it fails for you.

@vitkl
Copy link
Author

vitkl commented Jan 16, 2023

Do you mean installed via conda install -c conda-forge nodejs or sudo apt install nodejs?

The latter would complicate use - we either need to ask our central IT to keep installing the latest versions or use a singularity image all the time (which requires several steps and devices to build).

@grst
Copy link
Collaborator

grst commented Jan 16, 2023

Both conda and system package manager should work. Personally, I work with the conda version.

@vitkl
Copy link
Author

vitkl commented Jan 17, 2023

How can my last error be explained?

prettier.................................................................Failed
- hook id: prettier
- exit code: 1

prettier requires at least version 14 of Node, please upgrade

Would be good to see more complete installation instructions in the readme.

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

Well, in theory no installation instructions should be necessary as pre-commit takes care of that. It just installs a node version that is incompatible with your system.

I don't know why you would end up with <v14 when installing it using conda. You can try explicitly requesting a more recent version by using conda install -c conda-forge "nodejs>=14"

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

FWIW, I just found out that it's possible to override the node version using pre-commit:
https://pre-commit.com/#overriding-language-version

Could you please try setting the node version for prettier to an older version of node to find out if it works on your system?

e.g.

    - repo: https://github.com/pre-commit/mirrors-prettier
      rev: v2.5.1
      hooks:
          - id: prettier
            language_version: 16.19.0

@vitkl
Copy link
Author

vitkl commented Jan 17, 2023

This works, thank you!

    - repo: https://github.com/pre-commit/mirrors-prettier
      rev: v2.5.1
      hooks:
          - id: prettier
            language_version: 16.19.0

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

Perfect! May I ask you to try which is the most recent version of node that still works on your system?
Then I would pin the pre-commit hook to that.

@vitkl
Copy link
Author

vitkl commented Jan 17, 2023

Do you mean to keep increasing language_version: 16.19.0 until things break?

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

exactly!

Probably it's enough to just specify major numbers, i.e. 17, 18 and it will always use the release within that node version

@vitkl
Copy link
Author

vitkl commented Jan 17, 2023

17.9.1 still works but 18.0.0 fails:

An unexpected error has occurred: CalledProcessError: command: ('~/.cache/pre-commit/repornsqwln5/node_env-18.0.0/bin/node', '~/.cache/pre-commit/repornsqwln5/node_env-18.0.0/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
stdout: (none)
stderr:
    ~/.cache/pre-commit/repornsqwln5/node_env-18.0.0/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ~/.cache/pre-commit/repornsqwln5/node_env-18.0.0/bin/node)

Check the log at ~/.cache/pre-commit/pre-commit.log

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

👍 Thanks!

@grst
Copy link
Collaborator

grst commented Jan 17, 2023

Just one more question: what operating system are you on?

@vitkl
Copy link
Author

vitkl commented Jan 18, 2023

The system is Ubuntu 18.04 (bionic) (4.15.0-200-generic x86_64).

Actually, I have a problem after using version 17.9.1 to check the code locally - the code style check by prettier fails in a GitHub workflow
https://results.pre-commit.ci/run/github/589381908/1673972697.f9TynPJVRRyjRpt0PpRymw .

Any suggestions about what happened?

@grst
Copy link
Collaborator

grst commented Jan 18, 2023

Ok, then it is as discussed in #144: Ubuntu 18.04 hits end of support this April and is indeed incompatible with the latest node version.

Any suggestions about what happened?

No idea, sorry.

@vitkl
Copy link
Author

vitkl commented Jan 26, 2023

Maybe this error

prettier.................................................................Failed
- hook id: prettier
- files were modified by this hook

.codecov.yamldocs/contributing.mddocs/MakefileCHANGELOG.md.flake8README.mdsrc/cell2module/models/__init__.py.github/workflows/sync.yaml.bumpversion.cfg.github/ISSUE_TEMPLATE/bug_report.yml.editorconfigpyproject.tomlsrc/cell2module/models/_cell2module_module.py.github/ISSUE_TEMPLATE/feature_request.ymldocs/conf.pydocs/_templates/.gitkeepdocs/_static/.gitkeep.gitignoredocs/make.bat.github/workflows/test.yaml.pre-commit-config.yamlsrc/cell2module/__init__.pydocs/extensions/typed_returns.py.github/ISSUE_TEMPLATE/config.ymldocs/notebooks/example.ipynbdocs/index.md.cruft.json.cruft.json
docs/changelog.mdtests/test_cell2module.pysrc/cell2module/models/_base_module.pydocs/references.bib.github/workflows/build.yamlLICENSEdocs/template_usage.mddocs/api.mddocs/_templates/autosummary/class.rst.readthedocs.yamldocs/references.mdsrc/cell2module/models/_cell2module_model.py

is a result of these files being committed before prettier was run for the first time. It is possible to apply prettier to all files? E.g. like black .

@vitkl
Copy link
Author

vitkl commented Jan 26, 2023

I found a hack to fix this - just commit changes via a PR such that the workflow is run to automatically modify the files.

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

Successfully merging a pull request may close this issue.

2 participants