My CasC Export feature is not working

1 minute readKnowledge base

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 the items.yaml.

WARNING h.ExpressionFactory2$JexlExpression#evaluate: Caught exception evaluating: it.yaml in /job/test/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 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

The root cause of the issue is the plugin called Job and Node ownership. As soon as you uninstall it from your instance, both CasC export features (Item level and general level) will work as expected.