Stage "Push Image" skipped due to earlier failure(s)

Viewed 56

I'm building a CD pipeline using Jenkins on EKS and I'm running into problems on the first build. As shown in the output below, the pipelined stages are being skipped "due to earlier failure(s)" which I am unable to identity.

I did check the roles and scripts it is using to build and push the image to ECR, it looks ok to me.

I'm very new to Jenkins so would appreciate any help. I've also pasted the Jenkinsfile below.

 stages {

    stage("Checkout") {
        steps {
            checkout scm
        }
    }

    stage("Authenticate") {
      steps {
        script {
          AWS_CREDS = sh ( script: "${scriptsDir}/assume_role.sh ${envName}", returnStdout: true)
          AWS_ACCESS_KEY_ID = AWS_CREDS.split(',')[0].split('=')[1]
          AWS_SECRET_ACCESS_KEY = AWS_CREDS.split(',')[1].split('=')[1]
          AWS_SESSION_TOKEN = AWS_CREDS.split(',')[2].split('=')[1]
          withEnv([ "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}",
            "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}",
            "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}"]) {
            KUBECONFIG = sh ( script: "${scriptsDir}/kube_config.sh ${envName}", returnStdout: true).trim()
          }
        }
      }
    }

    stage ('Run Terraform') {
      steps {
        lock ("${applicationName}-${envName}-terraform"){
          withEnv([ "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}",
            "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}",
            "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}"]) {
            dir ("${scriptsDir}"){
              sh "./terraform.sh ${applicationName} ${tfVarsEnvName} apply"
            }
          }
        }
      }
    }

    stage('Build Image') {
      steps {
        script {
          sh "${scriptsDir}/ecr_build.sh ${applicationName} ${namespaceSuffix} ${mgmtEnvName}"
        }
      }
    }

    stage('Push Image') {
      steps {
       dir ("${buildDir}"){
          sh "${scriptsDir}/ecr_push_with_assume_role.sh image-version-collector latest ${podRoleToAssume} ${mgmtEnvName}"
       }
      }
    }

    stage("Running Kubernetes Deployment") {
      steps {
        script {
          withEnv([ "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}",
                  "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}",
                  "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}",
                  "KUBECONFIG=${KUBECONFIG}"
                  ]) {
            sh """${k8sDeploymentDir}/deploy.sh ${envName}"""
          }
        }
      }
    }
    
  }

  post {
     failure {
        updateGitlabCommitStatus name: 'build', state: 'failed'
    }
    success {
        updateGitlabCommitStatus name: 'build', state: 'success'
    }
  }
}
15:43:00  Apply complete! Resources: 3 added, 0 changed, 0 destroyed.[0m
15:43:00  [Pipeline] }
15:43:00  [Pipeline] // dir
15:43:01  [Pipeline] }
15:43:01  [Pipeline] // withEnv
15:43:01  [Pipeline] }
15:43:01  Lock released on resource [version-collector-dev-mgmt-terraform]
15:43:01  [Pipeline] // lock
15:43:01  [Pipeline] }
15:43:01  [Pipeline] // stage
15:43:01  [Pipeline] stage
15:43:01  [Pipeline] { (Build Image)
15:43:01  [Pipeline] script
15:43:01  [Pipeline] {
15:43:01  [Pipeline] }
15:43:02  [Pipeline] // script
15:43:02  [Pipeline] }
15:43:02  [Pipeline] // stage
15:43:02  [Pipeline] stage
15:43:02  [Pipeline] { (Push Image)
15:43:02  Stage "Push Image" skipped due to earlier failure(s)
15:43:02  [Pipeline] }
15:43:02  [Pipeline] // stage
15:43:02  [Pipeline] stage
15:43:02  [Pipeline] { (Running Kubernetes Deployment)
15:43:03  Stage "Running Kubernetes Deployment" skipped due to earlier failure(s)
15:43:03  [Pipeline] }
15:43:03  [Pipeline] // stage
15:43:03  [Pipeline] stage
15:43:03  [Pipeline] { (Declarative: Post Actions)
15:43:03  [Pipeline] updateGitlabCommitStatus
15:43:03  [Pipeline] }
15:43:03  [Pipeline] // stage
15:43:04  [Pipeline] }
15:43:04  [Pipeline] // node
15:43:04  [Pipeline] End of Pipeline
15:43:04  hudson.remoting.ProxyException: groovy.lang.MissingPropertyException: No such property: namespaceSuffix for class: WorkflowScript
15:43:04    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
15:43:04    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
15:43:04    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
15:43:04    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:354)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
15:43:04    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
15:43:04    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
15:43:04    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
15:43:04    at WorkflowScript.run(WorkflowScript:114)
15:43:04    at ___cps.transform___(Native Method)
15:43:04    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
15:43:04    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
15:43:04    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
15:43:04    at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
15:43:04    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:43:04    at java.lang.reflect.Method.invoke(Method.java:498)
15:43:04    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
15:43:04    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
15:43:04    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
15:43:04    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
15:43:04    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
15:43:04    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
15:43:04    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
15:43:04    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
15:43:04    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
15:43:04    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
15:43:04    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
15:43:04    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
15:43:04    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
15:43:04    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
15:43:04    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
15:43:04    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
15:43:04    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
15:43:04    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
15:43:04    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
15:43:04    at java.lang.Thread.run(Thread.java:748)
15:43:04  Finished: FAILURE

1 Answers

Well you have the error message there in the stack trace:

groovy.lang.MissingPropertyException: No such property: namespaceSuffix for class: WorkflowScript
Related