UI IllegalArgumentException regarding credentialsId parameter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UI IllegalArgumentException regarding credentialsId parameter

Benjamin Paz
Hello,

I have an easily repeatable issue that i have found in the Jenkins UI.

I am using Jenkins Jenkins ver. 2.222.1 
credentials-binding plugin 1.23
aws-lambda plugin 0.5.10

Start with a freestyle job, add a secret file into global store, named Jenkins.  The job buttons to "save" or "apply" changes can be used without issue. Adding the buildstep aws lambda deployment and the job can still be saved. However after reloading the job then it can no longer save.. The job will return the a popup with an error from the UI:

This are excerpts of the stacktrace: 
org.kohsuke.stapler.WrongTypeException: Got type array but no lister class found for type class java.lang.String
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:724)

Caused: java.lang.IllegalArgumentException: Failed to convert the credentialsId parameter of the constructor public org.jenkinsci.plugins.credentialsbinding.impl.FileBinding(java.lang.String,java.lang.String)


Caused: java.lang.IllegalArgumentException: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.FileBinding from {"variable":"NameWasHere","includeUser":"false","credentialsId":["folder-filename.txt",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding"}
        
Caused: java.lang.Error: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.FileBinding from {"variable":"NameWasHere","includeUser":"false","credentialsId":["folder-filename.txt",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding"}

Examining the secret displayed name now contains the folder and cannot be updated. The original file name from the global space was "filename.txt" but now the name appears as "folder-filename.txt".   This name always was presented with the folder in the config.xml file but not on the Jenkins UI. Back in the Jenkins UI, the secret file configuration is unable to change the "folder-filename.txt" and cannot display all of the available files in the global store.

Please advise,
Ben

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/72b4a290-7763-49c9-bcf8-f067eaaef10co%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: UI IllegalArgumentException regarding credentialsId parameter

Benjamin Paz
We are able to continue with the job by deleting the secret files and then re-adding to the job.  Until the screen is refreshed the UI configuration for that job continues to function normally.

As I have used Jenkinsfile in the past on several other projects. I believe the Jenkinsfile or other code solution will resolve this issue.

Please provide some feedback on the UI issue, even if it is just to say that the experience is the same.

On Friday, June 19, 2020 at 6:33:37 PM UTC-4, Benjamin Paz wrote:
Hello,

I have an easily repeatable issue that i have found in the Jenkins UI.

I am using Jenkins Jenkins ver. 2.222.1 
credentials-binding plugin 1.23
aws-lambda plugin 0.5.10

Start with a freestyle job, add a secret file into global store, named Jenkins.  The job buttons to "save" or "apply" changes can be used without issue. Adding the buildstep aws lambda deployment and the job can still be saved. However after reloading the job then it can no longer save.. The job will return the a popup with an error from the UI:

This are excerpts of the stacktrace: 
org.kohsuke.stapler.WrongTypeException: Got type array but no lister class found for type class java.lang.String
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:724)

Caused: java.lang.IllegalArgumentException: Failed to convert the credentialsId parameter of the constructor public org.jenkinsci.plugins.credentialsbinding.impl.FileBinding(java.lang.String,java.lang.String)


Caused: java.lang.IllegalArgumentException: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.FileBinding from {"variable":"NameWasHere","includeUser":"false","credentialsId":["folder-filename.txt",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding"}
        
Caused: java.lang.Error: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.FileBinding from {"variable":"NameWasHere","includeUser":"false","credentialsId":["folder-filename.txt",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.FileBinding"}

Examining the secret displayed name now contains the folder and cannot be updated. The original file name from the global space was "filename.txt" but now the name appears as "folder-filename.txt".   This name always was presented with the folder in the config.xml file but not on the Jenkins UI. Back in the Jenkins UI, the secret file configuration is unable to change the "folder-filename.txt" and cannot display all of the available files in the global store.

Please advise,
Ben

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f2c166f8-f67c-4ec2-a3e3-1e4fdc081586o%40googlegroups.com.