jenkinsci/fortify-on-demand-uploader-plugin

Saving incomplete build configuration settings causes Jenkins to throw exception.

Closed this issue · 2 comments

There is a bug where partial information has not been populated when saving settings. While it's not expected for the plugin to work without all of the data in place, the plugin should not crash the Jenkins save in case the user is not done configuring their build. Appears to be an issue with the call to populate the Assessment Type that can be used on the release.

A workaround is to select another application then switch it back to the intended one for the initial setup, this should make the plugin call back and fetch the info again to be populated.

Caused by: java.lang.IllegalArgumentException: Failed to instantiate class org.jenkinsci.plugins.fodupload.FodUploaderPlugin from {"assessmentTypeId":"","applicationId":"70144","releaseId":"100334","technologyStack":"ABAP","languageLevel":null,"entitlementId":"","runOpenSourceAnalysis":false,"isExpressScan":false,"isExpressAudit":false,"doPrettyLogOutput":false,"pollingInterval":"0","includeAllFiles":false,"excludeThirdParty":false,"isRemediationScan":false,"stapler-class":"org.jenkinsci.plugins.fodupload.FodUploaderPlugin","$class":"org.jenkinsci.plugins.fodupload.FodUploaderPlugin"}
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:676)
	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:474)
	at hudson.model.Descriptor.newInstance(Descriptor.java:590)
	... 76 more
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.lang.Integer.parseInt(Unknown Source)
	at java.lang.Integer.parseInt(Unknown Source)
	at org.jenkinsci.plugins.fodupload.models.JobConfigModel.<init>(JobConfigModel.java:114)
	at org.jenkinsci.plugins.fodupload.FodUploaderPlugin.<init>(FodUploaderPlugin.java:69)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:525)
	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:777)
	at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83)
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:674)
	... 79 more

PR #16 fixes the issue where blank data crashes Jenkins Build Config page when loading back after an incomplete save.

This issue is fixed in 2.0.6 but has not appeared on the jenkins plugin pages for whatever reason. Here is the link to the jenkins repo to get it manually if necessary.

https://repo.jenkins-ci.org/webapp/#/artifacts/browse/tree/General/releases/org/jenkins-ci/plugins/fortify-on-demand-uploader/2.0.6