简体   繁体   中英

groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript

I Have created multibranch pipeline(declarative) and placed jenkinsfile in bitbucket repo. hooks configured to trigger build in pipeline. when developer commits code pipeline it's throwing following error.

[Bitbucket] Build result notified groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458) at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:293)

When I checked the build groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript error occurred. when I tried to build the job in replay mode I have notified red space in the beginning of the pipeline script. I have removed the red space and it worked.

jenkinsfile view in "reply" mode

Jenkinsfile in bitbucket

the pipeline structure I used is

 pipeline {
   agent any
     options {....}
   stages {...}
}

please help me how to eradicate the issue...

The groovy.lang.MissingPropertyException error usually means that Jenkins is not able to find a variable or command used.

In this case, the error message says No such property: **any** for class: WorkflowScript .

Therefore, it looks like Jenkins is not able to find any .

I believe in a declarative pipeline, agent any is valid. Are you using any in another place in the script?

You did not provide the full script, so I could not see where the problem is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM