0
votes

When trying to execute a gradle build in a Jenkins pipeline job with the Artifactory plugin my build will finish successfully but fail due to the below error. There doesn't seem to be a .json file created for the build info in the /tmp directory.

My Artifactory Plugin is version 2.8.2.

My Jenkins version is the latest stable at 2.19.4

I see a similar question was posted here. The answer says the problem was fixed in the plugin version 2.8.2, but I'm still seeing the issue. Does anyone know what my issue could be?

This is my step command to execute the run.

buildInfo = rtGradle.run rootDir: "who/", buildFile: 'build.gradle', tasks: '--no-daemon -x artifactoryPublish runCI'

This is the error output.

:runCI

BUILD SUCCESSFUL

Total time: 54.091 secs
ERROR: Couldn't read generated build info at : /tmp/generated.build.info3392113078851872685.json
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
THE BUILD FINISHED!!!!
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
groovy.lang.MissingPropertyException: No such property: any for class: groovy.lang.Binding
    at groovy.lang.Binding.getVariable(Binding.java:63)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:224)
    at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
    at WorkflowScript.CatchError(WorkflowScript:109)
    at WorkflowScript.run(WorkflowScript:13)
    at ___cps.transform___(Native Method)
    at     com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
1
In version 2.8.2 we added more logs which I can't see in your post, can you verify you using the correct version? Clearing the cache might help as well. You can't find the file because we are doing a cleanup. If you can provide us project sample through Github and we investigate it further. For additional troubleshooting , you can try running one of our pipeline gradle examples .Tamir Hadad
Thank you for the response @TamirHadad.dylancu2
@TamirHadad Definitely using version 2.82. Where is the extra logging supposed to be? Which cache should I clear? Where is that located? I was able to successfully run one of your gradle examples from the sandbox, but I still have trouble with my project. I'll try providing a project sample.dylancu2
@TamirHadad Here is the sample Jenkinsfile on github: github.com/dylan-underwood/jenkins-project/blob/master/…dylancu2
Can you add your build script? The issue might be related to your build dependencies.Tamir Hadad

1 Answers

1
votes

The solution is dylancu2's last comment. I extract it for those who'd otherwise overlook it, just as I almost had: "Updating the Gradle extractor plugin version did fix the error." I upgraded to 4.4.13 and it fixed this error for me.

buildscript {
    dependencies {
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.13"
    }
}