cancel
Showing results for 
Search instead for 
Did you mean: 

CICD build failed

JonoThomas
Explorer
0 Kudos

Hi,

I was doing the CICD deployment and encountered an issue in running the CI/CD job. Below is the Log for the build failure. Deployement from BAS is working without any issues.

Stage Logs (risk-management-job #6 - Build)
[2023-11-22T00:52:10.725Z] [INFO] No runFirst command defined for current stage (Build). Will not execute additional commands step
[2023-11-22T00:52:11.267Z] Trying to acquire lock on [risk-management-job]
[2023-11-22T00:52:11.270Z] Resource [risk-management-job] did not exist. Created.
[2023-11-22T00:52:11.271Z] Lock acquired on [risk-management-job]
[2023-11-22T00:52:11.308Z] Running on Jenkins in /jenkins_home/workspace/risk-management-job@2
[2023-11-22T00:52:11.349Z] Unstash content: pipelineConfigAndTests
[2023-11-22T00:52:11.378Z] Unstash content: source
[2023-11-22T00:52:12.921Z] Unstash content: cloudcitransfer
[2023-11-22T00:52:12.985Z] [piperPipelineStageBuild] Sending telemetry data is disabled.
[2023-11-22T00:52:13.415Z] --- Begin library step of: buildExecute ---
[2023-11-22T00:52:13.642Z] [null] Sending telemetry data is disabled.
[2023-11-22T00:52:14.070Z] --- Begin library step of: mtaBuild ---
[2023-11-22T00:52:14.342Z] + '[' -x ./piper ]
[2023-11-22T00:52:14.353Z] Found piper binary in the workspace - skipping unstash
[2023-11-22T00:52:14.370Z] Unstash content: pipelineConfigAndTests
[2023-11-22T00:52:14.433Z] Step params [:]
[2023-11-22T00:52:14.477Z] PIPER_parametersJSON: {}
[2023-11-22T00:52:14.750Z] + ./piper getConfig --contextConfig --stepMetadata .pipeline/tmp/metadata/mtaBuild.yaml --defaultConfig .pipeline/.pipeline/cicdCustomDefaults.yml --ignoreCustomDefaults
[2023-11-22T00:52:14.751Z] time="2023-11-22T00:52:14Z" level=info msg="Version daf159ae1145d8c743bf54f673d6d8b7cecf0b9e" library=SAP/jenkins-library
[2023-11-22T00:52:14.751Z] time="2023-11-22T00:52:14Z" level=info msg="Printing stepName " library=SAP/jenkins-library
[2023-11-22T00:52:14.781Z] Context Config: [dockerImage:devxci/mbtci-java17-node18@sha256:3c4903882815c3a2a67bfb30b3842ad90d85ee10da4224a7b39a5a0dd1a3e21f, dockerPullImage:false]
[2023-11-22T00:52:14.800Z] [INFO] executing pipeline step 'mtaBuild' with docker image 'devxci/mbtci-java17-node18@sha256:3c4903882815c3a2a67bfb30b3842ad90d85ee10da4224a7b39a5a0dd1a3e21f'
[2023-11-22T00:52:15.384Z] --- Begin library step of: dockerExecute ---
[2023-11-22T00:52:15.596Z] [dockerExecute] Sending telemetry data is disabled.
[2023-11-22T00:52:16.204Z] --- Begin library step of: dockerExecuteOnKubernetes ---
[2023-11-22T00:52:16.410Z] [dockerExecuteOnKubernetes] Sending telemetry data is disabled.
[2023-11-22T00:52:16.429Z] Stash content: workspace-e48a1485-28ed-42a6-a19d-ce0ec1205776 (includes: **/*, excludes: nohup.out, useDefaultExcludes: true, allowEmpty: true)
[2023-11-22T00:52:24.773Z] Stashed 65 file(s)
[2023-11-22T00:52:28.018Z] Created Pod: kubernetes steward-run-2tmrp-main-6rjd4/dynamic-agent-e48a1485-28ed-42a6-a19d-ce0ec1205776-0rkc4-ks2sz
[2023-11-22T00:52:31.055Z] Agent dynamic-agent-e48a1485-28ed-42a6-a19d-ce0ec1205776-0rkc4-ks2sz is provisioned from template dynamic-agent-e48a1485-28ed-42a6-a19d-ce0ec1205776-0rkc4
[2023-11-22T00:52:31.261Z] Running on dynamic-agent-e48a1485-28ed-42a6-a19d-ce0ec1205776-0rkc4-ks2sz in /home/jenkins/agent/workspace/risk-management-job
[2023-11-22T00:52:31.465Z] ContainerConfig: [name:container-exec]
[2023-11-22T00:52:31.500Z] Unstash content: workspace-e48a1485-28ed-42a6-a19d-ce0ec1205776
[2023-11-22T00:52:34.537Z] invalidate stash workspace-e48a1485-28ed-42a6-a19d-ce0ec1205776
[2023-11-22T00:52:34.556Z] Stash content: workspace-e48a1485-28ed-42a6-a19d-ce0ec1205776 (includes: **/*.*, excludes: **/*, useDefaultExcludes: true, allowEmpty: true)
[2023-11-22T00:52:34.575Z] Warning: overwriting stash ‘workspace-e48a1485-28ed-42a6-a19d-ce0ec1205776’
[2023-11-22T00:52:34.707Z] Stashed 0 file(s)
[2023-11-22T00:52:34.719Z] [INFO][dockerExecute] Executing inside a Kubernetes Pod
[2023-11-22T00:52:35.476Z] + ./piper writePipelineEnv
[2023-11-22T00:52:35.476Z] time="2023-11-22T00:52:35Z" level=info msg="Version daf159ae1145d8c743bf54f673d6d8b7cecf0b9e" library=SAP/jenkins-library
[2023-11-22T00:52:35.541Z] Unstash content: pipelineStepReports
[2023-11-22T00:52:35.571Z] Unstash failed: pipelineStepReports (No such saved stash ‘pipelineStepReports’)
[2023-11-22T00:52:36.230Z] + ./piper mtaBuild --defaultConfig .pipeline/.pipeline/cicdCustomDefaults.yml --ignoreCustomDefaults
[2023-11-22T00:52:36.231Z] time="2023-11-22T00:52:36Z" level=info msg="Version daf159ae1145d8c743bf54f673d6d8b7cecf0b9e" library=SAP/jenkins-library
[2023-11-22T00:52:36.231Z] info  mtaBuild - running command: npm config get registry
[2023-11-22T00:52:36.497Z] info  mtaBuild - Discovered pre-configured npm registry registry with value https://registry.npmjs.com/
[2023-11-22T00:52:36.497Z] 
[2023-11-22T00:52:36.498Z] info  mtaBuild - "mta.yaml" file found in project sources
[2023-11-22T00:52:36.498Z] info  mtaBuild - No timestamp contained in "mta.yaml". File has not been modified.
[2023-11-22T00:52:36.498Z] info  mtaBuild - Executing mta build call: "mbt build --mtar risk-management.mtar --platform CF --source ./ --target /home/jenkins/agent/workspace/risk-management-job"
[2023-11-22T00:52:36.498Z] info  mtaBuild - running command: mbt build --mtar risk-management.mtar --platform CF --source ./ --target /home/jenkins/agent/workspace/risk-management-job
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO Cloud MTA Build Tool version 1.2.25
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO generating the "Makefile_20231122005236.mta" file...
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO done
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO executing the "make -f Makefile_20231122005236.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command...
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO validating the MTA project
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO running the "before-all" build...
[2023-11-22T00:52:36.498Z] info  mtaBuild - [2023-11-22 00:52:36]  INFO executing the "npx cds build --production" command...
[2023-11-22T00:52:37.434Z] error mtaBuild - npm ERR! could not determine executable to run
[2023-11-22T00:52:37.434Z] info  mtaBuild - 
[2023-11-22T00:52:37.434Z] error mtaBuild - npm ERR! A complete log of this run can be found in:
[2023-11-22T00:52:37.434Z] error mtaBuild - npm ERR!     /home/mta/.npm/_logs/2023-11-22T00_52_36_822Z-debug-0.log
[2023-11-22T00:52:37.434Z] error mtaBuild - [2023-11-22 00:52:37] ERROR the "before-all"" build failed: could not execute the "npx cds build --production" command: exit status 1
[2023-11-22T00:52:37.434Z] info  mtaBuild - make: *** [Makefile_20231122005236.mta:28: pre_build] Error 1
[2023-11-22T00:52:37.434Z] info  mtaBuild - Error: could not build the MTA project: could not execute the "make -f Makefile_20231122005236.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command: exit status 2
[2023-11-22T00:52:37.434Z] info  mtaBuild - fatal error: errorDetails{"category":"build","correlationId":"n/a","error":"running command 'mbt' failed: cmd.Run() failed: exit status 1","library":"SAP/jenkins-library","message":"failed to execute mta build","result":"failure","stepName":"mtaBuild","time":"2023-11-22T00:52:37.361631795Z"}
[2023-11-22T00:52:37.434Z] fatal mtaBuild - failed to execute mta build - running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-11-22T00:52:37.434Z] info  mtaBuild - persisting reports to GCS is disabled, because gcsBucketId is empty
[2023-11-22T00:52:37.435Z] info  mtaBuild - Step telemetry data:{"StepStartTime":"2023-11-22 00:52:36.04385709 +0000 UTC","PipelineURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","BuildURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","StageName":"Build","StepName":"mtaBuild","ErrorCode":"1","StepDuration":"1318","ErrorCategory":"build","CorrelationID":"n/a","PiperCommitHash":"daf159ae1145d8c743bf54f673d6d8b7cecf0b9e","ErrorDetail":{"category":"build","correlationId":"n/a","error":"running command 'mbt' failed: cmd.Run() failed: exit status 1","library":"SAP/jenkins-library","message":"failed to execute mta build","result":"failure","stepName":"mtaBuild","time":"2023-11-22T00:52:37.361631795Z"}}
[2023-11-22T00:52:38.199Z] + ./piper readPipelineEnv
[2023-11-22T00:52:38.199Z] time="2023-11-22T00:52:37Z" level=info msg="Version daf159ae1145d8c743bf54f673d6d8b7cecf0b9e" library=SAP/jenkins-library
[2023-11-22T00:52:38.238Z] Transfer Influx data
[2023-11-22T00:52:38.273Z] Stash content: pipelineStepReports (includes: .pipeline/stepReports/**, excludes: , useDefaultExcludes: true, allowEmpty: true)
[2023-11-22T00:52:38.296Z] Stashed 0 file(s)
[2023-11-22T00:52:39.051Z] Stash content: container-e48a1485-28ed-42a6-a19d-ce0ec1205776 (includes: **/*, excludes: **/node_modules/**,nohup.out, useDefaultExcludes: true, allowEmpty: true)
[2023-11-22T00:52:47.190Z] Stashed 73 file(s)
[2023-11-22T00:52:47.313Z] Unstash content: container-e48a1485-28ed-42a6-a19d-ce0ec1205776
[2023-11-22T00:52:49.422Z] invalidate stash container-e48a1485-28ed-42a6-a19d-ce0ec1205776
[2023-11-22T00:52:49.440Z] Stash content: container-e48a1485-28ed-42a6-a19d-ce0ec1205776 (includes: **/*.*, excludes: **/*, useDefaultExcludes: true, allowEmpty: true)
[2023-11-22T00:52:49.462Z] Warning: overwriting stash ‘container-e48a1485-28ed-42a6-a19d-ce0ec1205776’
[2023-11-22T00:52:49.470Z] Stashed 0 file(s)
[2023-11-22T00:52:49.546Z] ----------------------------------------------------------
[2023-11-22T00:52:49.547Z] --- An error occurred in the library step: dockerExecuteOnKubernetes
[2023-11-22T00:52:49.547Z] ----------------------------------------------------------
[2023-11-22T00:52:49.547Z] 
[2023-11-22T00:52:49.547Z] The following parameters were available to the step:
[2023-11-22T00:52:49.547Z] ***
[2023-11-22T00:52:49.547Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-11-22T00:52:49.547Z] *** WARNING: this may reveal sensitive information. ***
[2023-11-22T00:52:49.547Z] ***
[2023-11-22T00:52:49.547Z] 
[2023-11-22T00:52:49.547Z] The error was:
[2023-11-22T00:52:49.547Z] ***
[2023-11-22T00:52:49.547Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-11-22T00:52:49.547Z] ***
[2023-11-22T00:52:49.547Z] 
[2023-11-22T00:52:49.547Z] Further information:
[2023-11-22T00:52:49.547Z] * Documentation of library step dockerExecuteOnKubernetes: https://sap.github.io/jenkins-library/steps/dockerExecuteOnKubernetes/
[2023-11-22T00:52:49.547Z] * Source code of library step dockerExecuteOnKubernetes: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecuteOnKubernetes.groovy
[2023-11-22T00:52:49.547Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-11-22T00:52:49.547Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-11-22T00:52:49.547Z] 
[2023-11-22T00:52:49.547Z] ----------------------------------------------------------
[2023-11-22T00:52:49.547Z] --- End library step of: dockerExecuteOnKubernetes ---
[2023-11-22T00:52:49.595Z] ----------------------------------------------------------
[2023-11-22T00:52:49.595Z] --- An error occurred in the library step: dockerExecute
[2023-11-22T00:52:49.595Z] ----------------------------------------------------------
[2023-11-22T00:52:49.595Z] 
[2023-11-22T00:52:49.596Z] The following parameters were available to the step:
[2023-11-22T00:52:49.596Z] ***
[2023-11-22T00:52:49.596Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-11-22T00:52:49.596Z] *** WARNING: this may reveal sensitive information. ***
[2023-11-22T00:52:49.596Z] ***
[2023-11-22T00:52:49.596Z] 
[2023-11-22T00:52:49.596Z] The error was:
[2023-11-22T00:52:49.596Z] ***
[2023-11-22T00:52:49.596Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-11-22T00:52:49.596Z] ***
[2023-11-22T00:52:49.596Z] 
[2023-11-22T00:52:49.596Z] Further information:
[2023-11-22T00:52:49.596Z] * Documentation of library step dockerExecute: https://sap.github.io/jenkins-library/steps/dockerExecute/
[2023-11-22T00:52:49.596Z] * Source code of library step dockerExecute: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecute.groovy
[2023-11-22T00:52:49.596Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-11-22T00:52:49.596Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-11-22T00:52:49.596Z] 
[2023-11-22T00:52:49.596Z] ----------------------------------------------------------
[2023-11-22T00:52:49.596Z] --- End library step of: dockerExecute ---
[2023-11-22T00:52:49.671Z] ----------------------------------------------------------
[2023-11-22T00:52:49.671Z] --- An error occurred in the library step: mtaBuild
[2023-11-22T00:52:49.671Z] ----------------------------------------------------------
[2023-11-22T00:52:49.671Z] 
[2023-11-22T00:52:49.671Z] The following parameters were available to the step:
[2023-11-22T00:52:49.671Z] ***
[2023-11-22T00:52:49.671Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-11-22T00:52:49.671Z] *** WARNING: this may reveal sensitive information. ***
[2023-11-22T00:52:49.671Z] ***
[2023-11-22T00:52:49.671Z] 
[2023-11-22T00:52:49.671Z] The error was:
[2023-11-22T00:52:49.671Z] ***
[2023-11-22T00:52:49.671Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-11-22T00:52:49.672Z] ***
[2023-11-22T00:52:49.672Z] 
[2023-11-22T00:52:49.672Z] Further information:
[2023-11-22T00:52:49.672Z] * Documentation of library step mtaBuild: https://sap.github.io/jenkins-library/steps/mtaBuild/
[2023-11-22T00:52:49.672Z] * Source code of library step mtaBuild: https://github.com/SAP/jenkins-library/blob/master/vars/mtaBuild.groovy
[2023-11-22T00:52:49.672Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-11-22T00:52:49.672Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-11-22T00:52:49.672Z] 
[2023-11-22T00:52:49.672Z] ----------------------------------------------------------
[2023-11-22T00:52:49.672Z] --- End library step of: mtaBuild ---
[2023-11-22T00:52:49.714Z] ----------------------------------------------------------
[2023-11-22T00:52:49.714Z] --- An error occurred in the library step: buildExecute
[2023-11-22T00:52:49.714Z] ----------------------------------------------------------
[2023-11-22T00:52:49.714Z] 
[2023-11-22T00:52:49.714Z] The following parameters were available to the step:
[2023-11-22T00:52:49.714Z] ***
[2023-11-22T00:52:49.714Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-11-22T00:52:49.714Z] *** WARNING: this may reveal sensitive information. ***
[2023-11-22T00:52:49.714Z] ***
[2023-11-22T00:52:49.715Z] 
[2023-11-22T00:52:49.715Z] The error was:
[2023-11-22T00:52:49.715Z] ***
[2023-11-22T00:52:49.715Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-11-22T00:52:49.715Z] ***
[2023-11-22T00:52:49.715Z] 
[2023-11-22T00:52:49.715Z] Further information:
[2023-11-22T00:52:49.715Z] * Documentation of library step buildExecute: https://sap.github.io/jenkins-library/steps/buildExecute/
[2023-11-22T00:52:49.715Z] * Source code of library step buildExecute: https://github.com/SAP/jenkins-library/blob/master/vars/buildExecute.groovy
[2023-11-22T00:52:49.715Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-11-22T00:52:49.715Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-11-22T00:52:49.715Z] 
[2023-11-22T00:52:49.715Z] ----------------------------------------------------------
[2023-11-22T00:52:49.715Z] --- End library step of: buildExecute ---
[2023-11-22T00:52:49.734Z] Stash content: cloudcitransfer (includes: cloudcitransfer/**/*, excludes: cloudcitransfer/**/node_modules/**)
[2023-11-22T00:52:49.765Z] Warning: overwriting stash ‘cloudcitransfer’
[2023-11-22T00:52:49.766Z] Stashed 2 file(s)
[2023-11-22T00:52:49.836Z] [null] Sending telemetry data is disabled.
[2023-11-22T00:52:49.880Z] Lock released on resource [risk-management-job]

Regards,

Jono Thomas

Accepted Solutions (1)

Accepted Solutions (1)

LindaSieb
Product and Topic Expert
Product and Topic Expert

Hi Jono,

Unfortunately I haven't seen this error before, but some of my colleagues had some ideas on how to fix this that I will share here:

Please try adding "npm install" within the "before-all" parameter in your mta.yaml file, so that it will run before you execute the command "npx cds build --production".

If that doesn't work, maybe the cds tool is not installed? You could try adding the "@sap/cds-dk" dev-dependency to your package.json file and run "npm install --include-dev" to make sure that it's included.

Hope that helps!

Linda Siebert

JonoThomas
Explorer

Hi Linda,

Thank you for the hint. It's working after I added the npm install. "@sap/cds-dk" was already in my package.json.

Attaching the screenshot in case anyone else is searching for similar problems.

Regards,

Jono Thomas

Answers (0)