XT-i/aws-lambda-jenkins-plugin

JS Error is causing the Project Configuration page to malfunction

Opened this issue · 1 comments

Re-raising JIRA issue here since it is not clear from plugin description which issue tracker is the main one.

https://issues.jenkins-ci.org/browse/JENKINS-43627

AWS Lambda Plugin Update mode blank on 17th plus deployments in a single job

I have a Jenkins job, that deploys 16 lambdas. When you add the 17th, you no longer can select Update mode. In the chrome console you see the below error.

Uncaught TypeError: vg.rowVisibilityGroup.makeInnerVisisble is not a function
at updateAwsLambdaOptionalBlock (https://jci1.knowland.com:8080/plugin/aws-lambda/js/awslambda.js:14:27)
at https://jci1.knowland.com:8080/plugin/aws-lambda/js/awslambda.js:49:9
at Array.forEach (native)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:111:30
at Array.forEach (native)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:107:27
at Array.forEach (native)
at Object.applySubtree (https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:93:17)
at Object.apply (https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:76:14)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:71:14

The only work around it to create a second job that only deploys the 17th and above lambdas.

The same JS issue appears to be making it impossible to update the configuration of a project if Credentials Binding is in use.

Environment:
Jenkins 2.46.2
aws-lambda:0.5.10
credentials-binding:1.11
aws-credentials:1.16

Steps:

  1. Create a Freestyle project
  2. Check Use secret text(s) or file(s)
  3. Add Username and password (separated) or AWS access key and secret binding
  4. Add AWS Lambda deployment post-build action with at least one Lambda deployment
  5. Save
  6. Open configuration again
  7. Try to save again

Expected:
Save is successful

Actual:
Save fails with bellow error

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:723)
	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:777)
Caused: java.lang.IllegalArgumentException: Failed to convert the credentialsId parameter of the constructor public com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding(java.lang.String,java.lang.String,java.lang.String)
	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:779)
	at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83)
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)
Caused: java.lang.IllegalArgumentException: Failed to instantiate class com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding from {"accessKeyVariable":"AWS_ACCESS_KEY_ID","secretKeyVariable":"AWS_SECRET_ACCESS_KEY","credentialsId":["aws-credential-1",""],"stapler-class":"com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding","$class":"com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding"}
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:680)
	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:591)
Caused: java.lang.Error: Failed to instantiate class com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding from {"accessKeyVariable":"AWS_ACCESS_KEY_ID","secretKeyVariable":"AWS_SECRET_ACCESS_KEY","credentialsId":["aws-credential-1",""],"stapler-class":"com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding","$class":"com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding"}```