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

/usr/bin/jq: Argument list too long #187

Open
mahdirezaie336 opened this issue Dec 2, 2022 · 8 comments
Open

/usr/bin/jq: Argument list too long #187

mahdirezaie336 opened this issue Dec 2, 2022 · 8 comments

Comments

@mahdirezaie336
Copy link

I ran the runSonarQube.sh file successfully. But at the end of the build process, it waits for a few minutes and then gives me this error:

...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:47 min
[INFO] Finished at: 2022-12-02T19:41:51+03:30
[INFO] ------------------------------------------------------------------------



./scripts/runSonarQube.sh: line 60: /usr/bin/jq: Argument list too long

My OS is ubuntu 2022 and I use SonarQube verison 9.7.1.

I guess it reaches the maximum size of ARG_MAX in linux which is related to size of args buffer. It is mentioned here and here.
I couldn't fix it by myself.

@darkspirit510
Copy link
Contributor

Hi, thank you for your issue!

Are you talking about SonarQube CE or any paid version?

Sascha

@mahdirezaie336
Copy link
Author

Thanks
I use SonarQube CE. Is there any differences?

@mahdirezaie336
Copy link
Author

Any updates?

@darkspirit510
Copy link
Contributor

I use SonarQube CE. Is there any differences?
Don't think so. I just wanted to be sure when trying to reproduce.

Any updates?
No, had a lot to do in the last weeks. Will hopefully check it today, but more likely after christmas.

@darkspirit510
Copy link
Contributor

Could you checkout #189 and see, if it works? I reduced the "chunk" size. At least it works on a clean ubuntu installation. If it does not work, I have to rewrite the script completely.

@zoobinn
Copy link
Contributor

zoobinn commented Mar 27, 2023

@darkspirit510 tested with your changes. Less arguments too long but still the behavior is not stable. And also for Score calculation literally is not correct. Using SonarQube Enterprise 9.9 LTS, Can clearly see the run populates close to ~18K Vulnerability Issues and ~1200 Hotspot. However, the benchmark script is only processing ~200 Vulnerability. Guess the runSonarqube.sh scripts needs a fundamental re-write.

@darkspirit510
Copy link
Contributor

@darkspirit510 did you enter enterprise credentials to the script? (the community edition reports way less results). i don't have access to an enterprise instance. But I guess, jq is not made for generating such a big json file (but I am not sure about this). Feel free to fix it 😉

@zoobinn
Copy link
Contributor

zoobinn commented Mar 27, 2023

yes, most probably JQ can not handle the size of SonarQube JSON, the more rules the bigger the size of JSON array . Please check this PR. To avoid JQ errors reduced page size to 20 while writing results incrementally in to 2 files.
https://github.com/OWASP-Benchmark/BenchmarkJava/pull/196/files

Tracking this with SonarSource as well (Re Broken Benchmark and PR): https://community.sonarsource.com/t/tech-story-takeaways-from-building-a-sast-product-and-why-owasp-benchmark-is-not-enough/15126/4

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