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

Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: Document nesting depth (1001) exceeds the maximum allowed #406

Closed
Fabi9199 opened this issue Aug 22, 2024 · 10 comments · Fixed by #420

Comments

@Fabi9199
Copy link

Hey

I am facing an issue during linting of several groovy files I am using in a Jenkins Pipeline.
The log containing the exception can be seen here:
Exception.log

I am using the groovy linter now in several projects but only face this problem in one of them, it is a Jenkins Library.
What could be the problem causing this?

Thanks and best regards,
Fabian

@nvuillam
Copy link
Owner

@Fabi9199 please can you try with npm-groovy-lint@beta ?
I updated to latest CodeNarc version, that contains Jenkinsfile ruleset, maybe it will work better

@Fabi9199
Copy link
Author

@Fabi9199 please can you try with npm-groovy-lint@beta ? I updated to latest CodeNarc version, that contains Jenkinsfile ruleset, maybe it will work better

@nvuillam Thanks for the quick answer!
Unfortunately, the issue perstists with using npm-groovy-lint@beta
Output npm-groovy-lint --version:

GroovyLint: Successfully processed CodeNarc: 
CodeNarc version 3.5.0
npm-groovy-lint version 14.6.1-beta202408252305.0

Embeds:
CodeNarc version 3.5.0
- Groovy version 3.0.9 (superlite)

I played around a little bit and realised this issue do not come up if I run npm-groovy-lint with option --no-parse.
npm-groovy-lint --no-parse

Could you explain the impact of it?
If I disable it permanently, do I have any disadvantages in the linting? :-)
Thanks!

@nvuillam
Copy link
Owner

@Fabi9199 the Groovy files parsing uses Groovy 3.9.0 parser to confirm that the code is correct

What version of groovy are you using ?

Would it be possible to share an example of your Jenkinsfile so I can reproduce ?

@Fabi9199
Copy link
Author

@nvuillam I currently do not know which Groovy Version our Jenkins is using. I will try to find out and come back to you.

I created a repository containing one of the files, which are failing with the mentioned exception:
https://github.com/Fabi9199/groovy-lint-test

Just run npm-groovy-lint :)

@nvuillam
Copy link
Owner

I succeeded to reproduce the issue, thanks !

@stevenh I don't find how to activate reports to see when it crashes during the parsing ... help ? ^^

@Fabi9199 meanwhile, good idea to disable with --no-parse :)

@Fabi9199
Copy link
Author

Great! You`re welcome, I really appreciate your support here, thanks! :)

Do you have any hint, how I can enable the --no-parse option in the VSCode extension for npm-groovy-lint?

@nvuillam
Copy link
Owner

@Fabi9199 you can't for now but I'm currently making updates to VsCode Groovy Lint so I'll add this option !

stevenh added a commit that referenced this issue Aug 27, 2024
Convert parse errors into strings manually to avoid JSON serialisation
failure due to circular references.

Fixes #406
stevenh added a commit that referenced this issue Aug 28, 2024
Convert parse errors into strings manually to avoid JSON serialisation
failure due to circular references.

Fixes #406
nvuillam pushed a commit that referenced this issue Aug 29, 2024
Convert parse errors into strings manually to avoid JSON serialisation
failure due to circular references.

Fixes #406
@nvuillam
Copy link
Owner

@Fabi9199 I released 15.0.1 with @stevenh 's fix, please can you confirm it's ok now ? :)

Note: it's not propagated yet to VsCode Groovy Lint, only via the command line

@Fabi9199
Copy link
Author

@Fabi9199 I released 15.0.1 with @stevenh 's fix, please can you confirm it's ok now ? :)

Note: it's not propagated yet to VsCode Groovy Lint, only via the command line

@nvuillam I tried it just now and its working perfectly fine! Many thanks to both of you :)
Finally my action is working!

@nvuillam
Copy link
Owner

@Fabi9199 glad your use case is ok now :)

Thanks for reporting the issue :)

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