tmobile/jazz-installer

Master : Unable to login to Jazz

Closed this issue · 6 comments

r-pai commented

Issue 1:
Unable to login to Jazz after Successful Jazz Installation.

Steps:
Using master branch installed Jazz.

Log Analysis:
From the logs Installation, no failure reported.
All the 56 AWS resources are added.
Jenkins: 'build-deploy-platform-service' all the 13 jobs failed.

Reason:
In jenkins 'build-deploy-platform-service' all the 13 jobs failed.
Logs showed aws command not found

_[build-deploy-platform-service] Running shell script

  • aws configure set profile.cloud-api.region us-east-1
    /var/lib/jenkins/workspace/build-deploy-platform-service@tmp/durable-e304fd96/script.sh: line 2: aws: command not found_

Manual Fix: When Manually Installed 'aws cli' in jenkins box and did a rebuild . All the platform services build was successful and was able to login to Jazz.

Issue 2:
API is not getting created.

  Step:
       Create an API from Jazz and in UI it shows no link and API creation fail message.

 Reason:
         Build API failed with log

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.kohsuke.groovy.sandbox.impl.Checker checkedCast java.lang.Class java.lang.Object boolean boolean boolean
at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectStaticMethod(StaticWhitelist.java:192)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:142)
at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:186)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:190)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:97)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
at WorkflowScript.validateDeploymentConfigurations(WorkflowScript:625)
at WorkflowScript.run(WorkflowScript:202)
at cps.transform(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
at

Issue 3:

Dead code : In modifyCodebase.h

�[0m�[0mnull_resource.configureExistingJenkinsServer (local-exec): Executing: /bin/sh -c "./scripts/modifyCodebase.sh sg- subnet-
arn:aws:iam::475452188481:role/infinity_lambda2_basic_execution_1 us-east-1 xxxxx"
�[0m�[0mnull_resource.configureExistingJenkinsServer (local-exec): sed: can't read /home//cookbooks/jenkins/files/node/jazz-installer-vars.json: No such file or directory
�[0m�[0mnull_resource.configureExistingJenkinsServer (local-exec): sed: can't read /home//cookbooks/jenkins/files/node/jazz-installer-vars.json: No such file or directory
�[0m�[0mnull_resource.configureExistingJenkinsServer (local-exec): sed: can't read /home//cookbooks/jenkins/files/node/jazz-installer-vars.json: No such file or directory

Thanks for reporting this issue @r-pai. We will try to reproduce the issue and take it from there.

  1. This issue was fixed in v1.3 release (use tag v1.3).
  2. What install scenario was used here?
  3. We will log a bug for this.
r-pai commented
  1. Already made the stack up and started using. Next stack we will use v1.3 , but not sure when. But I believe the aws cookbook code still has the issue. I doubt line 13 not sure, not tested.
  2. Its the first scenario which resulted in the bug.
  3. There are 3 different issues reported as one.
  1. We add scripts for approval as part of the install, in this case its possible it didn't get applied (perhaps a bug). Here are a couple of workarounds:
  • Once the job fails, immediately Navigate to jenkins > Manage jenkins > In-process Script Approval. You should see a pending command, which the admin has to approve. Please share the the name of the command that it asking you to approve, so that we can check why it failed.
  • Run with scenario 2 where we spin up a Jenkins container for you and in this case the installer will do the right thing.

Let me know how it goes.

r-pai commented
  1. As you have told there needs to be one more script to be approved. Here is the list of scripts which is currently approved in the jenkins but one of them is not there in jazz script approval, which I think created the second issue. Manually approving it resolved.

method groovy.json.JsonSlurperClassic parseText java.lang.String
method groovy.lang.Binding getVariables
method groovy.lang.Closure getOwner
method jenkins.model.JenkinsLocationConfiguration getUrl
new groovy.json.JsonSlurperClassic
new jenkins.model.JenkinsLocationConfiguration
staticMethod java.lang.System getenv
staticMethod java.lang.System getenv java.lang.String
staticMethod jenkins.model.JenkinsLocationConfiguration get
staticMethod org.kohsuke.groovy.sandbox.impl.Checker checkedCast java.lang.Class java.lang.Object boolean boolean boolean

  • As told this time we cannot change it to second scenario as they already started working.

I am glad the issue got resolved for you. You don't need to try second workaround as the first one has already worked for you. We will get the bug fixed.