2.462.1 Jenkins meet the error `Required context class hudson.Launcher is missing`

Jenkins setup:

Jenkins: 2.462.1
OS: Linux - 5.15.0-56-generic
Java: 17.0.11 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ace-editor:1.1
alauda-devops-credentials-provider:v3.19.0-beta.2.g936c1c07
alauda-devops-pipeline:v3.19.0-beta.2.g936c1c07
alauda-devops-sync:v3.19.0-beta.2.g936c1c07
alauda-kubernetes-support:v3.19.0-beta.2.g936c1c07
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
asm-api:9.7-33.v4d23ef79fcc8
authentication-tokens:1.119.v50285141b_7e1
badge:1.13
bitbucket:250.v8032f588d8a_c
blueocean:1.27.14
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.14
blueocean-commons:1.27.14
blueocean-config:1.27.14
blueocean-core-js:1.27.14
blueocean-dashboard:1.27.14
blueocean-display-url:2.4.3
blueocean-events:1.27.14
blueocean-git-pipeline:1.27.14
blueocean-github-pipeline:1.27.14
blueocean-i18n:1.27.14
blueocean-jira:1.27.14
blueocean-jwt:1.27.14
blueocean-personalization:1.27.14
blueocean-pipeline-api-impl:1.27.14
blueocean-pipeline-editor:1.27.14
blueocean-pipeline-scm-api:1.27.14
blueocean-rest:1.27.14
blueocean-rest-impl:1.27.14
blueocean-web:1.27.14
bootstrap4-api:4.6.0-6
bootstrap5-api:5.3.3-1
bouncycastle-api:2.30.1.78.1-248.ve27176eb_46cb_
branch-api:2.1178.v969d9eb_c728e
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.2.0
cloudbees-bitbucket-branch-source:888.v8e6d479a_1730
cloudbees-disk-usage-simple:203.v3f46a_7462b_1a_
cloudbees-folder:6.942.vb_43318a_156b_2
command-launcher:115.vd8b_301cc15d0
commons-compress-api:1.26.1-2
commons-lang3-api:3.14.0-76.vda_5591261cfe
commons-text-api:1.12.0-129.v99a_50df237f7
configuration-as-code:1836.vccda_4a_122a_a_e
copyartifact:749.vfb_dca_a_9b_6549
credentials:1371.vfee6b_095f0a_3
credentials-binding:681.vf91669a_32e45
data-tables-api:2.0.8-1
display-url-api:2.204.vf6fddd8a_8b_e9
docker-commons:443.v921729d5611d
docker-workflow:580.vc0c340686b_54
durable-task:568.v8fb_5c57e8417
echarts-api:5.5.0-1
eddsa-api:0.3.0-4.v84c6f0f4969e
favorite:2.221.v19ca_666b_62f5
font-awesome-api:6.5.2-1
git:5.3.0
git-client:5.0.0
git-server:126.v0d945d8d2b_39
github:1.40.0
github-api:1.321-468.v6a_9f5f2d5a_7e
github-branch-source:1793.v1831e9c68d77
gitlab-api:5.6.0-97.v6603a_83f8690
gitlab-branch-source:704.vc7f1202d7e14
google-oauth-plugin:1.330.vf5e86021cb_ec
gson-api:2.11.0-41.v019fcf6125dc
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
htmlpublisher:1.36
http_request:1.19
ignore-committer-strategy:1.0.4
instance-identity:185.v303dc7c645f9
ionicons-api:74.v93d5eb_813d5f
jackson2-api:2.17.0-379.v02de8ec9f64c
jakarta-activation-api:2.1.3-1
jakarta-mail-api:2.1.3-1
javax-activation-api:1.2.0-7
javax-mail-api:1.6.2-10
jaxb:2.3.9-1
jdk-tool:80.v8a_dee33ed6f0
jenkins-design-language:1.27.14
jersey2-api:2.44-151.v6df377fff741
jira:3.13
jjwt-api:0.11.5-112.ve82dfb_224b_a_d
joda-time-api:2.12.7-29.v5a_b_e3a_82269a_
jquery-detached:1.2.1
jquery3-api:3.7.1-2
jsch:0.2.16-86.v42e010d9484b_
json-api:20240303-41.v94e11e6de726
json-path-api:2.9.0-58.v62e3e85b_a_655
junit:1284.vf75d778f98c5
kubernetes:4280.vd919fa_528c7e
kubernetes-client-api:6.10.0-240.v57880ce8b_0b_2
kubernetes-credentials:174.va_36e093562d9
label-linked-jobs:6.0.1
localization-support:1.2
localization-zh-cn:371.v23851f835d6b_
lockable-resources:1255.vf48745da_35d0
mailer:472.vf7c289a_4b_420
mapdb-api:1.0.9-40.v58107308b_7a_7
matrix-auth:3.2.2
matrix-project:832.va_66e270d2946
mercurial:1260.vdfb_723cdcc81
metrics:4.2.21-451.vd51df8df52ec
mina-sshd-api-common:2.13.1-117.v2f1a_b_66ff91d
mina-sshd-api-core:2.13.1-117.v2f1a_b_66ff91d
momentjs:1.1.1
oauth-credentials:0.653.v14cf2088e950
oic-auth:4.303.v84089a_708ea_7
okhttp-api:4.11.0-172.vda_da_1feeb_c6e
pipeline-build-step:540.vb_e8849e1a_b_d8
pipeline-graph-analysis:216.vfd8b_ece330ca_
pipeline-groovy-lib:727.ve832a_9244dfa_
pipeline-input-step:495.ve9c153f6067b_
pipeline-milestone-step:119.vdfdc43fc3b_9a_
pipeline-model-api:2.2205.vc9522a_9d5711
pipeline-model-definition:2.2205.vc9522a_9d5711
pipeline-model-extensions:2.2205.vc9522a_9d5711
pipeline-rest-api:2.34
pipeline-stage-step:312.v8cd10304c27a_
pipeline-stage-tags-metadata:2.2205.vc9522a_9d5711
pipeline-stage-view:2.34
pipeline-utility-steps:2.17.0
plain-credentials:183.va_de8f1dd5a_2b_
plugin-util-api:4.1.0
popper-api:1.16.1-3
popper2-api:2.11.6-5
prism-api:1.29.0-15
prometheus:780.v7c50a_d288424
pubsub-light:1.18
resource-disposer:0.23
scm-api:696.v778d637b_a_762
script-security:1341.va_2819b_414686
snakeyaml-api:2.2-121.v5a_68b_9300b_d4
sonar:2.17.2
sse-gateway:1.27
ssh-credentials:343.v884f71d78167
sshd:3.330.vc866a_8389b_58
structs:338.v848422169819
subversion:1269.v53185011cd9f
token-macro:400.v35420b_922dcb_
trilead-api:2.147.vb_73cc728a_32e
variant:60.v7290fc0eb_b_cd
workflow-aggregator:600.vb_57cdd26fdd7
workflow-api:1332.vc21122317a_8e
workflow-basic-steps:1058.vcb_fc1e3a_21a_9
workflow-cps:3922.va_f73b_7c4246b_
workflow-cps-global-lib:612.v55f2f80781ef
workflow-durable-task-step:1364.v2fd76fb_6fd41
workflow-job:1436.vfa_244484591f
workflow-multibranch:795.ve0cb_1f45ca_9a_
workflow-scm-step:427.v4ca_6512e7df1
workflow-step-api:678.v3ee58b_469476
workflow-support:920.v59f71ce16f04
ws-cleanup:0.46

Hi folks! I have encountered some occasional problems and have no idea about how to fix it!

The error message is below

Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 444c0e1a-a29c-45ec-8e61-9417f1759a73
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.Launcher is missing

The full error message stack is below

[Pipeline] End of Pipeline
Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 444c0e1a-a29c-45ec-8e61-9417f1759a73
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.Launcher is missing
Perhaps you forgot to surround the _AcpAction step with a step that provides this, such as: node
        at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:265)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:300)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:47)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.LoggingInvoker.methodCall(LoggingInvoker.java:105)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$AlaudaDevopsResourceSelector._asMarkup(AlaudaDevopsDSL.groovy:1421)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$AlaudaDevopsResourceSelector.asJson(AlaudaDevopsDSL.groovy:1456)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$AlaudaDevopsResourceSelector._asSingleMap(AlaudaDevopsDSL.groovy:1472)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$AlaudaDevopsResourceSelector.object(AlaudaDevopsDSL.groovy:1508)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$AlaudaDevopsResourceSelector.object(AlaudaDevopsDSL.groovy)
        at WorkflowScript.stepsFunc_alaudaSyncImage(WorkflowScript:32)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withProject(AlaudaDevopsDSL.groovy:456)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$Context.run(AlaudaDevopsDSL.groovy:149)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withProject(AlaudaDevopsDSL.groovy:455)
        at WorkflowScript.stepsFunc_alaudaSyncImage(WorkflowScript:30)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withCluster(AlaudaDevopsDSL.groovy:444)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL$Context.run(AlaudaDevopsDSL.groovy:149)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withCluster(AlaudaDevopsDSL.groovy:443)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.node(AlaudaDevopsDSL.groovy:1850)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withCluster(AlaudaDevopsDSL.groovy:400)
        at com.alauda.jenkins.plugins.AlaudaDevopsDSL.withCluster(AlaudaDevopsDSL.groovy)
        at WorkflowScript.stepsFunc_alaudaSyncImage(WorkflowScript:29)
        at ___cps.transform___(Native Method)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:90)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:116)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
        at jdk.internal.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.Next.step(Next.java:83)
        at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:147)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:17)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:49)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:180)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:423)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:331)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:295)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService.lambda$wrap$4(CpsVmExecutorService.java:136)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
        at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.call(CpsVmExecutorService.java:53)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.call(CpsVmExecutorService.java:50)
        at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
        at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
        at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService.lambda$categoryThreadFactory$0(CpsVmExecutorService.java:50)
        at java.base/java.lang.Thread.run(Thread.java:840)
Finished: FAILURE

I noticed that this problem has been talked about in https://groups.google.com/g/jenkinsci-users/c/tD_6LPQylhM but not resolved

The error message already tells you what the problem is:

Perhaps you forgot to surround the _AcpAction step with a step that provides this, such as: node

Hi Thanks for your quick response!

I checked the script and I am sure that nothing left out ! I trigger build again and build will succeed without any changes.

It would help if you can post your Jenkinsfile

It might seem rather complex with some DSL defined by us. :blush:



void stepsFunc_alaudaSyncImage() {
		script{
  container('tools'){
    def sourceTag = "";
    def targetTag = "";
    def inputTag = "";
    def tlsVerify = false
    def annoAddress = "integrations.katanomi.dev/integration.address";
    def annoResourceScope = "integrations.katanomi.dev/integration.resourceScope";
    def annoApplyNS = "integrations.katanomi.dev/secret.applyNamespaces";
    def globalCredentialNS = "cpaas-system-global-credentials";

    def sourceImage = [:];
    sourceImage['name'] = "192-168-171-122-harbor.alaudatech.net/e2e-automation/qaimage"
    def targetImage = [:];
    targetImage['name'] = "192-168-171-122-harbor.alaudatech.net/e2e-automation/truesecret"



    def imageTagPolicy = false

    if (env.IMAGE_SYNC_POLICY == 'imageTag') {
      imageTagPolicy = true
    } else {
      def alaudaDevopsInstance = alaudaDevops.newInstance()

      alaudaDevopsInstance.withCluster() {
        alaudaDevopsInstance.withProject('kube-public') {
          try{
            def policyConfigmap = alaudaDevopsInstance.selector('configmap', 'devops-imagetag-policy').object()
            imageTagPolicy = true
          } catch(err) {
            if (err.getMessage().contains('NotFound')) {
              echo "use default image sync policy..."
            } else {
              echo "failed confirm image sync policy..."
              throw err
            }
          }
        }
      }
    }

    if (params._alaudaSyncImage_imageTag != ''){
      inputTag = params._alaudaSyncImage_imageTag
    } else if (params.imageTag != null && params.imageTag != ""){
      // means trigger by API call for template pipeline
      inputTag = params.imageTag
    }

  
    sourceTag = '${imageTag}'

  
    targetTag = '${imageTag}'

    
    if (imageTagPolicy) {
      // imageTag policy replace variable imageTag in tag
      println("use imageTag policy for image sync...")
      def sourceReplace = """
          set +x
          echo '${sourceTag}' | sed 's/\${imageTag}/${inputTag}/g'
      """
      def targetReplace = """
          set +x
          echo '${targetTag}' | sed 's/\${imageTag}/${inputTag}/g'
      """
      // use inputTag replace imageTag exists in tag
      sourceTag = sh(script: sourceReplace, returnStdout: true).trim()
      targetTag = sh(script: targetReplace, returnStdout: true).trim()
    } else {
      // force policy which use parameter as highest priority 
      println("use force policy for image sync...")
      def sourceReplace = """
          set +x
          echo '${sourceTag}' | sed 's/\${imageTag}/latest/g'
      """
      def targetReplace = """
          set +x
          echo '${targetTag}' | sed 's/\${imageTag}/latest/g'
      """
      sourceTag = sh(script: sourceReplace, returnStdout: true).trim()
      targetTag = sh(script: targetReplace, returnStdout: true).trim()
      
      // if inputTag is not empty use it directly
      if (inputTag != ''){
          sourceTag = inputTag
          targetTag = inputTag
      } 
    }

    sourceImage['tag'] = sourceTag
    targetImage['tag'] = targetTag

    def Image = "${sourceImage.name}:${sourceImage.tag}";
  def sourceCredentialsId = ""

    // means we need the secret selection to find the secret which match this code repository
    if(sourceCredentialsId == ""){
      alaudaDevops.withCluster(){
        alaudaDevops.withProject(alaudaContext.getNamespace()){

          def result = alaudaDevops.raw( 'get secret -o yaml');
          def secrets = readYaml text: """${result.out}""";

          for(secret in secrets.items){
            if (secret.metadata.annotations != null ){
              def address = secret.metadata.annotations[annoAddress];
              def scopes = secret.metadata.annotations[annoResourceScope];

              if (scopes != null && address != null){
                address = address.replace("http://","").replace("https://","");
                if (address.endsWith("/")){
                  address = address.substring(0, address.length() - 1)
                }
                def scopeList = scopes.split(",");
                scopeList.each{ scope->
                  if ("${sourceImage.name}".startsWith(address + scope)){
                    sourceCredentialsId = alaudaContext.getNamespace() + '-' + secret.metadata.name
                  }
                }
                if (sourceCredentialsId != ""){
                  break
                }
              }
            }
          }

        }
        // secret may be exist in global credential namespace
        if (sourceCredentialsId == ""){
          alaudaDevops.withProject(globalCredentialNS){

            def result = alaudaDevops.raw( 'get secret -o yaml');
            def secrets = readYaml text: """${result.out}""";

            for(secret in secrets.items){
              if (secret.metadata.annotations != null ){
                def address = secret.metadata.annotations[annoAddress];
                def scopes = secret.metadata.annotations[annoResourceScope];
                def applyNS = secret.metadata.annotations[annoApplyNS];

                if (scopes != null && address != null && applyNS != null){
                  address = address.replace("http://","").replace("https://","");
                  if (address.endsWith("/")){
                    address = address.substring(0, address.length() - 1)
                  }
                  def scopeList = scopes.split(",");
                  def applyNamespaces = applyNS.split(",")
                  if (applyNamespaces != null && applyNamespaces.contains(alaudaContext.getNamespace())) {
                    scopeList.each{ scope->
                      if ("${sourceImage.name}".startsWith(address + scope)){
                        sourceCredentialsId = globalCredentialNS + '-' + secret.metadata.name
                      }
                    }
                  }
                  if (sourceCredentialsId != ""){
                    break
                  }
                }
              }
            }

          }
        }
      }
    }
    if (sourceCredentialsId == ""){
      println("secret not found for ${Image} or the integration status of imageRepository is incorrect, resulting in not obtaining the credentials correctly, please check the integration status of imageRepository on the platform")
    } else {
      println("credential ${sourceCredentialsId} found for ${Image}")
    }

    //get target image info
    def TargetImage = "${targetImage.name}:${targetImage.tag}";
  def targetCredentialsId = ""

    // means we need the secret selection to find the secret which match this code repository
    if(targetCredentialsId == ""){
      alaudaDevops.withCluster(){
        alaudaDevops.withProject(alaudaContext.getNamespace()){

          def result = alaudaDevops.raw( 'get secret -o yaml');
          def secrets = readYaml text: """${result.out}""";

          for(secret in secrets.items){
            if (secret.metadata.annotations != null ){
              def address = secret.metadata.annotations[annoAddress];
              def scopes = secret.metadata.annotations[annoResourceScope];

              if (scopes != null && address != null){
                address = address.replace("http://","").replace("https://","");
                if (address.endsWith("/")){
                  address = address.substring(0, address.length() - 1)
                }
                def scopeList = scopes.split(",");
                scopeList.each{ scope->
                  if ("${targetImage.name}".startsWith(address + scope)){
                    targetCredentialsId = alaudaContext.getNamespace() + '-' + secret.metadata.name
                  }
                }
                if (targetCredentialsId != ""){
                  break
                }
              }
            }
          }
        }
        // secret may be exist in global credential namespace
        if (targetCredentialsId == ""){
          alaudaDevops.withProject(globalCredentialNS){

            def result = alaudaDevops.raw( 'get secret -o yaml');
            def secrets = readYaml text: """${result.out}""";

            for(secret in secrets.items){
              if (secret.metadata.annotations != null ){
                def address = secret.metadata.annotations[annoAddress];
                def scopes = secret.metadata.annotations[annoResourceScope];
                def applyNS = secret.metadata.annotations[annoApplyNS];

                if (scopes != null && address != null && applyNS != null){
                  address = address.replace("http://","").replace("https://","");
                  if (address.endsWith("/")){
                    address = address.substring(0, address.length() - 1)
                  }
                  def scopeList = scopes.split(",");
                  def applyNamespaces = applyNS.split(",")
                  if (applyNamespaces != null && applyNamespaces.contains(alaudaContext.getNamespace())) {
                    scopeList.each{ scope->
                      if ("${targetImage.name}".startsWith(address + scope)){
                        targetCredentialsId = globalCredentialNS + '-' + secret.metadata.name
                      }
                    }
                  }
                  if (targetCredentialsId != ""){
                    break
                  }
                }
              }
            }

          }
        }
      }
    }
    if (targetCredentialsId == ""){
      println("secret not found for ${TargetImage} or it is not provided")
    } else {
      println("credential ${targetCredentialsId} found for ${TargetImage}")
    }

    if (sourceCredentialsId != ""){
      try{
        withCredentials([usernamePassword(credentialsId: sourceCredentialsId, usernameVariable: "USERNAME", passwordVariable: "PASSWORD")]){
          def registryServer = Image.replaceAll("/.*","")
          def randFilename = "registry-password." + new Random().nextInt(Integer.MAX_VALUE).toString()
          writeFile file: randFilename, text: PASSWORD
          sh script: "cat ${randFilename} | skopeo login --tls-verify=${tlsVerify} -u ${USERNAME} --password-stdin ${registryServer}", label: 'login to registry'
          sh script: "rm -rf ${randFilename}"
        }
      }
      catch(err){
        error err.getMessage()
      }
    }

    // login to target docker registry
    if (targetCredentialsId != "" ){
      try{
        withCredentials([usernamePassword(credentialsId: targetCredentialsId, usernameVariable: "TARGETUSERNAME", passwordVariable: "TARGETPASSWORD")]){
          def registryServer = TargetImage.replaceAll("/.*","")
          def randFilename = "registry-password." + new Random().nextInt(Integer.MAX_VALUE).toString()
          writeFile file: randFilename, text: TARGETPASSWORD
          sh script: "cat ${randFilename} | skopeo login --tls-verify=${tlsVerify} -u ${TARGETUSERNAME} --password-stdin ${registryServer}", label: 'login to registry'
          sh script: "rm -rf ${randFilename}"
        }
      }
      catch(err){
        error err.getMessage()
      }
    }

    retry(2){
      sh script:"skopeo copy docker://${Image} docker://${TargetImage} --all --dest-tls-verify=${tlsVerify} --src-tls-verify=${tlsVerify}", label: 'copy image'
    }
    alaudaPipeline.appendInfo(STAGE_NAME, [source_image: "" + Image, target_image: "" + TargetImage], '_Sync')
  }
}

	}
pipeline{

	

	agent {label "tools"}
	environment{
			ALAUDA_PROJECT = "a-g1-c6e-e2eprj-devops"
	}
    options{
        buildDiscarder(logRotator(numToKeepStr: '200'))
	}

	stages{
		stage("alaudaSyncImage"){

	
	steps{
		stepsFunc_alaudaSyncImage()
	}
}

	}
}

hmm you have an agent. The plugin Alauda DevOps Pipeline that you’re using was last released 5 years ago. So might be a bug in that plugin. The plugin also has a security vulnerability

Thanks I will check that plugin try to find the hidden bug