Closed schorlton closed 1 year ago
I would try running with LOG_LEVEL: DEBUG
and DISABLE_LINTERS: GROOVY
. If you can prove that a particular linter is hanging, then I would try running it directly to assess whether the issue is related to MegaLinter.
@schorlton I recently released a new npm-groovy-lint version that can accept a list of files Please could you disable groovy like suggested by @Kurt-von-Laven , so we can know if npm-groovy-lint is responsible for the timeout ?
Or any chance we could have access to the gitlab repo ?
(if npm-groovy-lint is guilty, you may also use GROOVY_NPM_GROOVY_LINT_CLI_LINT_MODE: file
, it will be slower but may work before a fix is published )
Thank you both for your feedback. I'm confirming it's npm-groovy-lint, and changing GROOVY_NPM_GROOVY_LINT_CLI_LINT_MODE
did not help. The linting works locally which makes me think maybe it's a resource limitation of the GitLab CI environment? It's weird that it broke going from v5 to v6. I unfortunately cannot provide access to our repo, but please let me know if there's any other debugging I can help with. You may be able to reproduce this issue by simply running a big (several hundred line) file through npm-groovy-lint on GitLab CI - in file
mode, it looks like it was frozen on the first file.
Please can you try defining the following in your MegaLinter config file ?
GROOVY_NPM_GROOVY_LINT_ARGUMENTS: --noserver
Please can you try defining the following in your MegaLinter config file ? GROOVY_NPM_GROOVY_LINT_ARGUMENTS: --noserver
Should I also keep GROOVY_NPM_GROOVY_LINT_CLI_LINT_MODE: file
or remove that before running?
you can try first to remove GROOVY_NPM_GROOVY_LINT_CLI_LINT_MODE: file
and see what happens with only GROOVY_NPM_GROOVY_LINT_ARGUMENTS: --noserver
:)
you can try first to remove
GROOVY_NPM_GROOVY_LINT_CLI_LINT_MODE: file
and see what happens with onlyGROOVY_NPM_GROOVY_LINT_ARGUMENTS: --noserver
:)
That fixed it!! :smile:
Addendum: premature excitement. It got further but freezes on:
npm-groovy-lint results in 128 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity │ Total found │
├─────────┼───────────┼─────────────┤
│ 0 │ 'Error' │ 0 │
│ 1 │ 'Warning' │ 7 │
│ 2 │ 'Info' │ 129 │
└─────────┴───────────┴─────────────┘
Failure: 0 error(s) have been found
7 warning(s) have been found
129 info(s) have been found
Linter version command: ['/node-deps/node_modules/.bin/npm-groovy-lint', '--version']
You may want to try running npm-groovy-lint directly in GitLab CI (without MegaLinter). If you can reproduce the hang that way, this probably belongs in npm-groovy-lint's issue tracker. Maybe they need to expose a config option that limits resource consumption in some way?
@schorlton Oh, so the --version is boring :o Do you have some public repo where I could see the problem ?
@Kurt-von-Laven "they" is kind of .... me 🤣 I'm the creator/maintainer of npm-groovy-lint... and only maintainer 😭
Ha ha ha ha, so sorry.
@Kurt-von-Laven - yes I'm sorry for polluting megalinter repo with likely external issue. Thanks for understanding. @nvuillam - big thanks for your help on debugging. Unfortunately, this is a private repo and I can't share as it's protected IP. My best suggestion is to try running in gitlab CI on ~128 nextflow files with ~129 infos and ~7 warnings...perhaps running on one of the nf-core repos may reproduce?
That may indeed be caused by the big amount of nextflow files.... I'll test with npm-groovy-lint and try to pimp it :)
@nvuillam, wondering if you've been able to reproduce? Would be really nice to switch to Megalinter v6 with all of its improvements, but this is precluding the switch. Thanks!
@schorlton I'm finalizing a pull request on codenarc to arrange that, then it will arrive in npm-groovy-lint, then megalinter :) Slow but progressing :)
Amazing. If I understand, it was a performance issue? Was too many files crashing it on Gitlab due to resource constraints?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
Please stay open :pray:
@schorlton I have to wait for CodeNarc new release... they are not frequent as MegaLinter... ^^
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
@nvuillam , looks like there's a new CodeNarc release...any update on bringing it over into npm-groovy-lint/here?
@nvuillam , looks like there's a new CodeNarc release...any update on bringing it over into npm-groovy-lint/here?
I have a pending branch to upgrade CodeNarc within npm-groovy-lint... but it has issues and I have big difficulties to find time :/
https://github.com/nvuillam/npm-groovy-lint/pull/258/files
if you are interested or know someone you can try to make it work :/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
It may be planned?
Planned yet... but scheduled, it's harder to say, these days are hard to find time, it will probably wait for my next vacations :/
@nvuillam, the GitLab team (credit to them) has troubleshooted a bit why megalinter v6/7 is freezing in GitLab CI and came up with:
npm-groovy-lint seems to hang when executing ['/node-deps/node_modules/.bin/npm-groovy-lint', '--version']. We look at the code base and pull the container to test around a bit. Kenneth suspects the --codenarcargs might be causing the problem and we try removing line #197, #198 , and #204. It seems to improve the command run time a lot so we tested on the GitLab SaaS runner and the job no longer hang.
The code we change to make is work is in config/gitlab_ci/lint.yaml: lint-megalinter: stage: lint image: name: oxsecurity/megalinter:v7.0.2 entrypoint: ["/bin/sh", "-c", "sed -i '/codeNarcVersionLinter/d' /node-deps/node_modules/npm-groovy-lint/lib/groovy-lint.js; sed -i '/codeNarcVersionLines/d' /node-deps/node_modules/npm-groovy-lint/lib/groovy-lint.js; /entrypoint.sh"] rules: ...
Does this give you any hints why it may be freezing or do you have any ideas?
Thanks!
I'll try to have a look and solve the bug on npm-groovy-lint before it becomes an abandonware, many thanks to you and to the gitlab team :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
Not stale.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
I am seeing a similar issue.
Running npm-groovy-lint
and even something as basic as npm-groovy-lint -v
, in a container locally runs fine. But running the same container in Jenkins and the app just sits there until Jenkins times out the image or I kill the Job.
13:08:46 + npm-groovy-lint
Aborted by [fnickels](https://rce-controller01.****/user/fnickels)
13:10:19 Sending interrupt signal to process
13:10:19 Terminated
13:10:19 script returned exit code 143
I have attempted to use the --noserver
, --verbose
, and other flags and get no other indications as to why the app is hanging. I recognize it is probably something about environment, but npm-groovy-lint
does not provide any useful diagnostics I am aware of about where and why it is hanging.
Any suggestions about what to try? Here are the details when I run the same container locally:
# npm-groovy-lint -v
GroovyLint: Successfully processed CodeNarc:
CodeNarc version 3.1.0
npm-groovy-lint version 11.1.1
Embeds:
CodeNarc version 3.1.0
- Groovy version 3.0.9 (superlite)
# node --version
v19.7.0
# npm --version
9.5.0
# java --version
openjdk 11.0.17 2022-10-18 LTS
OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode)
Is there somewhere in the code where the app never returns and endlessly waits for something?
npm-groovy-lint is currently a mess because of newest java/groovy/codenarc versions (we don't know which ones yet) , and contrary to MegaLinter, I'm the only maintainer there, and i don't code in java for years.... so I don't succeed to solve it for now ... Some contributors are trying to help, but meanwhile u might just disable the linter :/
I can appreciate that. I too have not looked at Java in years, but I might take a peek and see what I can find.
@fnickels that would be amazing
Current PR is https://github.com/nvuillam/npm-groovy-lint/pull/286
There is also another attempt by @mheiges -> https://github.com/nvuillam/npm-groovy-lint/pull/292
I made some progress getting things to run by doing the following:
java --class-path '/usr/local/lib/node_modules/npm-groovy-lint/lib/java/CodeNarcServer.jar:/usr/local/lib/node_modules/npm-groovy-lint/lib/java/*' \
com.nvuillam.CodeNarcServer --server &
sleep 5
npm-groovy-lint --noserver ./
jobs
kill %1
sleep 5
jobs
but I can not get npm-groovy-lint -v
to work. I briefly looked at the code and realized how rusty my java & node skills are. I will cross-post in the other repo in case this is helpful to others. I will also take a look at the 2 PRs you have pointed out.
@fnickels I'm rusty in java & groovy too, that's what I can't succeed to fix npm-groovy-lint for now :/ But some others are trying, let's keep hope :)
I just tried v7.4.0 in GitLab CI and it worked for me. Really not sure what changed. Will leave this open until I confirm a couple times and then close.
@schorlton thanks for the feedback :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
Megalinter v6 is freezing in Gitlab CI and I'm not sure how to debug. v5.17.0 works flawlessly.
Description
Running megalinter in Gitlab on a shared runner using your suggested template. I disabled parallel execution to debug.
It successfully pulls the image and runs until hadolint:
At this point, it times out after an hour. The linting works flawlessly in v6 locally and is quick. When I follow along locally, it seems that npm-groovy-lint runs after hadolint, so I wonder if this is what is freezing?
Thanks for any tips!