0

For some reason, when I am doing the following in my Jenkinsfile for a declarative pipeline,

script{
                    withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${env.AWS_DEPLOYMENT_CREDENTIALS}"]]){
                        echo "==================\n\nDeploying.\n\n=================="
                        String scriptOutput =  sh(
                                    script: 'aws apigateway get-rest-api --rest-api-id <some-id>',
                                    returnStdout: true
                                    ).trim()
                            echo "scriptOutput: ${scriptOutput}"

                    }
                }

I am getting:

process apparently never started
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

and the command with sh never runs but the code executes Deploying correctly.

  1. The durable-task plugin is 1.36. [https://stackoverflow.com/questions/58346984/how-to-fix-process-apparently-never-started-in-error-in-jenkins-pipeline]
  2. When I copy and paste the entire groovy file in script console with org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true I get: No signature of method: Script1.pipeline() is applicable for argument types: (Script1$_run_closure1) values:

NOTE: the exact same script works with another jenkins master. I am not sure which version/plugin should I look at to resolve the issue.

harry123
  • 560
  • 1
  • 4
  • 14

0 Answers0