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

Excessively nested closures/functions error with trivial Jenkinsfile #196

Closed
dhutty opened this issue Feb 19, 2020 · 5 comments
Closed

Excessively nested closures/functions error with trivial Jenkinsfile #196

dhutty opened this issue Feb 19, 2020 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@dhutty
Copy link

dhutty commented Feb 19, 2020

I'm using this library with a trivial Jenkinsfile:

Jenkinsfile.init(this)
def validate = new TerraformValidateStage()
validate.build()

and I get an error:

[2020-02-19T21:28:29.941Z] Resolved v5.4 as tag v5.4 at revision 00e3eed6cfcf8e4ad40a68a323f116202cda90da
[2020-02-19T21:28:29.970Z] No credentials specified
[2020-02-19T21:28:29.973Z]  > git rev-parse --is-inside-work-tree # timeout=10
[2020-02-19T21:28:30.024Z] Fetching changes from the remote Git repository
[2020-02-19T21:28:30.024Z]  > git config remote.origin.url https://github.com/manheim/terraform-pipeline.git # timeout=10
[2020-02-19T21:28:30.095Z] Fetching with tags
[2020-02-19T21:28:30.095Z] Fetching upstream changes from https://github.com/manheim/terraform-pipeline.git
[2020-02-19T21:28:30.095Z]  > git --version # timeout=10
[2020-02-19T21:28:30.100Z]  > git fetch --tags --progress -- https://github.com/manheim/terraform-pipeline.git +refs/tags/v5.4:refs/tags/v5.4 # timeout=10
[2020-02-19T21:28:30.724Z] Checking out Revision 00e3eed6cfcf8e4ad40a68a323f116202cda90da (v5.4)
[2020-02-19T21:28:30.725Z]  > git config core.sparsecheckout # timeout=10
[2020-02-19T21:28:30.755Z]  > git checkout -f 00e3eed6cfcf8e4ad40a68a323f116202cda90da # timeout=10
[2020-02-19T21:28:31.248Z] Commit message: "Merge pull request #191 from manheim/v5.4-dev"
[2020-02-19T21:28:31.255Z]  > git rev-list --no-walk 00e3eed6cfcf8e4ad40a68a323f116202cda90da # timeout=10
[2020-02-19T21:28:31.363Z] [Bitbucket] Notifying commit build result
[2020-02-19T21:28:35.538Z] [Pipeline] Start of Pipeline
[2020-02-19T21:28:36.201Z] [Pipeline] End of Pipeline
[2020-02-19T21:28:36.337Z] [Bitbucket] Notifying commit build result
[2020-02-19T21:28:36.384Z] [Bitbucket] Build result notified
[2020-02-19T21:28:36.385Z] java.lang.StackOverflowError: Excessively nested closures/functions at Jenkinsfile.init(Jenkinsfile.groovy:80) - look for unbounded recursion - call depth: 1025

which then continues with a stacktrace that I can attach if it helps.

My guess is that I'm just doing something wrong because I haven't used this before, but I'd be grateful for suggestions for where I'm going wrong. (Jenkins LTS: 2.204.2, all plugins updated according to pluginManager)

@dhutty dhutty changed the title unbounded recursion error with trivial Jenkinsfile Excessively nested closures/functions error with trivial Jenkinsfile Feb 19, 2020
@kmanning
Copy link
Collaborator

kmanning commented Mar 6, 2020

Hrm, sounds like a defect. Just to confirm, your Jenkinsfile lives in a separate git repo, correct? (I don't see that in the logs, but I wasn't sure if that was intentionally redacted)

@kmanning kmanning added the bug Something isn't working label Mar 6, 2020
@dhutty
Copy link
Author

dhutty commented Mar 7, 2020

separate repo from your terraform-pipeline code? yes

@kmanning
Copy link
Collaborator

kmanning commented Mar 9, 2020

Confirmed defect - it was introduced in v5.3 (and works in v5.2). Looks like the latest version of the "Pipeline: Groovy" plugin is confusing the init methods and causing the infinite loop -

def static void init(original, Class customizations=null) {
this.original = original
this.docker = original.docker
initializeDefaultPlugins()
if (customizations != null) {
customizations.init()
}
}
// Deprecate this, env should come from original
def static void init(original, env, Class customizations=null) {
init(original, customizations)
}

Tagging fix for v5.5 release

@kmanning kmanning added this to the v5.5 milestone Mar 9, 2020
@kmanning
Copy link
Collaborator

This defect also uncovered CPS errors. Fix coming in Issue #151

@kmanning
Copy link
Collaborator

Merged into v5.5-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants