RBAC Groups REST API fails with NotExportableException when Accessed from a Connected controller item

1 minute read

Issue

  • I want to get the RBAC configuration of a connected controller using the RBAC REST API, with for example $CJOC_URL/job/$CONTROLLER_NAME/groups/api/json but it fails with:

org.kohsuke.stapler.export.NotExportableException: class com.cloudbees.opscenter.server.rbac.ConnectedMasterProxyGroupContainer doesn't have @ExportedBean
	at org.kohsuke.stapler.export.ModelBuilder.get(ModelBuilder.java:58)
	at org.kohsuke.stapler.export.ModelBuilder.get(ModelBuilder.java:47)
	at org.kohsuke.stapler.ResponseImpl.writeOne(ResponseImpl.java:286)
	at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:278)
	at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:234)
	at hudson.model.Api.doJson(Api.java:223)
	[...]
Caused: javax.servlet.ServletException
  • CTR-535 - RBAC REST API fails when accessed from Connected controller item at CJOC

Resolution

The issue is fixed in version 2.235.0.3 of the Operations Center RBAC plugin included in version 2.235.4.1 of CloudBees CI. The solution is to:

  • Upgrade CloudBees CI to version 2.235.4.1 or later.

Workaround

There is no workaround using the Jenkins REST API. Alternatively, the Jenkins CLI can be used to access the RBAC configuration of a Connected controller item. See Scripting RBAC with CLI commands.