Issue
-
When I try to use the export CasC feature on some Jobs, the UI does not render any yaml, and the stack trace below is printed in the logs.
-
When navigating under
Manage Jenkins → CloudBees Configuration as Code export and update
, some Jobs are not exported in theitems.yaml
.
WARNING h.ExpressionFactory2$JexlExpression#evaluate: Caught exception evaluating: it.yaml in $JOB_NAME/export/. Reason: java.lang.reflect.InvocationTargetException com.cloudbees.jenkins.plugins.casc.CasCExportException: Impossible to get an accurate constructor for class org.jenkinsci.plugins.ownership.model.folders.FolderOwnershipProperty (here will be indicated which plugin class is causing the problem) at com.cloudbees.jenkins.plugins.casc.items.types.GenericDescribableObject$ItemConstructor.<init>(GenericDescribableObject.java:56) at com.cloudbees.jenkins.plugins.casc.items.types.GenericDescribableObject.<init>(GenericDescribableObject.java:33) at com.cloudbees.jenkins.plugins.casc.items.types.GenericDescribableObject$GenericDescribableItemIntermediateFactory.intermediateFromJenkins(GenericDescribableObject.java:151) [...]
Resolution
These issues are generally related to Tier 3 Community plugins which are not compatible with CasC. Some examples of plugins causing this kind of error are:
As soon as you uninstall the problematic Tier 3 Community plugin from your instance, both CasC export features (Item level and general level) will work as expected.