cancel
Showing results for 
Search instead for 
Did you mean: 

Building side-by-side extensions on SAP BTP: Automated Deployment build failed

former_member169522
Discoverer
0 Kudos

Hi All. I am following the Building side-by-side extensions on SAP BTP learning journey. I have followed all the steps until the Automated Deployment topic successfully, but when running the job, the build fails. Could I please get help on how to resolve this error? Thanks.

 

Phil3_0-1697774099475.png

The first error I see in the logs is error "mtaBuild - npm ERR! could not determine executable to run".

 

Stage Logs (risk-management-job #1 - Build)
[2023-10-20T02:57:48.829Z] [INFO] No runFirst command defined for current stage (Build). Will not execute additional commands step
[2023-10-20T02:57:49.331Z] Trying to acquire lock on [risk-management-job]
[2023-10-20T02:57:49.349Z] Resource [risk-management-job] did not exist. Created.
[2023-10-20T02:57:49.363Z] Lock acquired on [risk-management-job]
[2023-10-20T02:57:49.462Z] Running on Jenkins in /jenkins_home/workspace/risk-management-job@2
[2023-10-20T02:57:49.645Z] Unstash content: pipelineConfigAndTests
[2023-10-20T02:57:49.767Z] Unstash content: source
[2023-10-20T02:57:50.873Z] Unstash content: cloudcitransfer
[2023-10-20T02:57:51.107Z] [piperPipelineStageBuild] Sending telemetry data is disabled.
[2023-10-20T02:57:52.037Z] --- Begin library step of: buildExecute ---
[2023-10-20T02:57:52.490Z] [null] Sending telemetry data is disabled.
[2023-10-20T02:57:53.009Z] --- Begin library step of: mtaBuild ---
[2023-10-20T02:57:53.336Z] + '[' -x ./piper ]
[2023-10-20T02:57:53.403Z] Found piper binary in the workspace - skipping unstash
[2023-10-20T02:57:53.480Z] Unstash content: pipelineConfigAndTests
[2023-10-20T02:57:53.823Z] Step params [:]
[2023-10-20T02:57:54.197Z] PIPER_parametersJSON: {}
[2023-10-20T02:57:54.537Z] + ./piper getConfig --contextConfig --stepMetadata .pipeline/tmp/metadata/mtaBuild.yaml --defaultConfig .pipeline/.pipeline/cicdCustomDefaults.yml --ignoreCustomDefaults
[2023-10-20T02:57:54.557Z] time="2023-10-20T02:57:54Z" level=info msg="Version e38ee6774892fae7708a9ba6a9cc8c8985e78292" library=SAP/jenkins-library
[2023-10-20T02:57:54.570Z] time="2023-10-20T02:57:54Z" level=info msg="Printing stepName " library=SAP/jenkins-library
[2023-10-20T02:57:54.692Z] Context Config: [dockerImage:devxci/mbtci-java11-node18@sha256:3c081915700bf9e530edd8c19267e28294441a79f7c2e1cc4bbbb8cfd721179d, dockerPullImage:false]
[2023-10-20T02:57:54.799Z] [INFO] executing pipeline step 'mtaBuild' with docker image 'devxci/mbtci-java11-node18@sha256:3c081915700bf9e530edd8c19267e28294441a79f7c2e1cc4bbbb8cfd721179d'
[2023-10-20T02:57:55.442Z] --- Begin library step of: dockerExecute ---
[2023-10-20T02:57:55.722Z] [dockerExecute] Sending telemetry data is disabled.
[2023-10-20T02:57:56.424Z] --- Begin library step of: dockerExecuteOnKubernetes ---
[2023-10-20T02:57:56.839Z] [dockerExecuteOnKubernetes] Sending telemetry data is disabled.
[2023-10-20T02:57:56.918Z] Stash content: workspace-b21635e2-1b38-4bf2-89e1-d6063a80468c (includes: **/*, excludes: nohup.out, useDefaultExcludes: true, allowEmpty: true)
[2023-10-20T02:58:04.501Z] Stashed 62 file(s)
[2023-10-20T02:58:06.824Z] Created Pod: kubernetes steward-run-qfr39-main-gq8dq/dynamic-agent-b21635e2-1b38-4bf2-89e1-d6063a80468c-r93p3-pvns1
[2023-10-20T02:58:19.704Z] Still waiting to schedule task
[2023-10-20T02:58:20.191Z] Waiting for next available executor on ‘dynamic-agent-b21635e2-1b38-4bf2-89e1-d6063a80468c-r93p3-pvns1’
[2023-10-20T02:58:38.599Z] Agent dynamic-agent-b21635e2-1b38-4bf2-89e1-d6063a80468c-r93p3-pvns1 is provisioned from template dynamic-agent-b21635e2-1b38-4bf2-89e1-d6063a80468c-r93p3
[2023-10-20T02:58:38.622Z] Running on dynamic-agent-b21635e2-1b38-4bf2-89e1-d6063a80468c-r93p3-pvns1 in /home/jenkins/agent/workspace/risk-management-job
[2023-10-20T02:58:39.365Z] ContainerConfig: [name:container-exec]
[2023-10-20T02:58:39.509Z] Unstash content: workspace-b21635e2-1b38-4bf2-89e1-d6063a80468c
[2023-10-20T02:58:41.667Z] invalidate stash workspace-b21635e2-1b38-4bf2-89e1-d6063a80468c
[2023-10-20T02:58:41.748Z] Stash content: workspace-b21635e2-1b38-4bf2-89e1-d6063a80468c (includes: **/*.*, excludes: **/*, useDefaultExcludes: true, allowEmpty: true)
[2023-10-20T02:58:41.821Z] Warning: overwriting stash ‘workspace-b21635e2-1b38-4bf2-89e1-d6063a80468c’
[2023-10-20T02:58:41.989Z] Stashed 0 file(s)
[2023-10-20T02:58:42.060Z] [INFO][dockerExecute] Executing inside a Kubernetes Pod
[2023-10-20T02:58:43.003Z] + ./piper writePipelineEnv
[2023-10-20T02:58:43.021Z] time="2023-10-20T02:58:42Z" level=info msg="Version e38ee6774892fae7708a9ba6a9cc8c8985e78292" library=SAP/jenkins-library
[2023-10-20T02:58:43.238Z] Unstash content: pipelineStepReports
[2023-10-20T02:58:43.360Z] Unstash failed: pipelineStepReports (No such saved stash ‘pipelineStepReports’)
[2023-10-20T02:58:44.177Z] + ./piper mtaBuild --defaultConfig .pipeline/.pipeline/cicdCustomDefaults.yml --ignoreCustomDefaults
[2023-10-20T02:58:44.198Z] time="2023-10-20T02:58:43Z" level=info msg="Version e38ee6774892fae7708a9ba6a9cc8c8985e78292" library=SAP/jenkins-library
[2023-10-20T02:58:44.219Z] info  mtaBuild - running command: npm config get registry
[2023-10-20T02:58:44.498Z] info  mtaBuild - Discovered pre-configured npm registry registry with value https://registry.npmjs.com/
[2023-10-20T02:58:44.512Z] 
[2023-10-20T02:58:44.530Z] info  mtaBuild - "mta.yaml" file found in project sources
[2023-10-20T02:58:44.541Z] info  mtaBuild - No timestamp contained in "mta.yaml". File has not been modified.
[2023-10-20T02:58:44.553Z] info  mtaBuild - Executing mta build call: "mbt build --mtar risk-management.mtar --platform CF --source ./ --target /home/jenkins/agent/workspace/risk-management-job"
[2023-10-20T02:58:44.566Z] info  mtaBuild - running command: mbt build --mtar risk-management.mtar --platform CF --source ./ --target /home/jenkins/agent/workspace/risk-management-job
[2023-10-20T02:58:44.577Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO Cloud MTA Build Tool version 1.2.23
[2023-10-20T02:58:44.589Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO generating the "Makefile_20231020025844.mta" file...
[2023-10-20T02:58:44.603Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO done
[2023-10-20T02:58:44.615Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO executing the "make -f Makefile_20231020025844.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command...
[2023-10-20T02:58:44.628Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO validating the MTA project
[2023-10-20T02:58:44.640Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO running the "before-all" build...
[2023-10-20T02:58:44.652Z] info  mtaBuild - [2023-10-20 02:58:44]  INFO executing the "npx cds build --production" command...
[2023-10-20T02:58:45.229Z] error mtaBuild - npm ERR! could not determine executable to run
[2023-10-20T02:58:45.246Z] info  mtaBuild - 
[2023-10-20T02:58:45.258Z] error mtaBuild - npm ERR! A complete log of this run can be found in:
[2023-10-20T02:58:45.270Z] error mtaBuild - npm ERR!     /home/mta/.npm/_logs/2023-10-20T02_58_44_595Z-debug-0.log
[2023-10-20T02:58:45.283Z] error mtaBuild - [2023-10-20 02:58:45] ERROR the "before-all"" build failed: could not execute the "npx cds build --production" command: exit status 1
[2023-10-20T02:58:45.295Z] info  mtaBuild - make: *** [Makefile_20231020025844.mta:28: pre_build] Error 1
[2023-10-20T02:58:45.308Z] info  mtaBuild - Error: could not build the MTA project: could not execute the "make -f Makefile_20231020025844.mta p=CF mtar=risk-management.mtar strict=true mode= t=\"/home/jenkins/agent/workspace/risk-management-job\"" command: exit status 2
[2023-10-20T02:58:45.319Z] 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-10-20T02:58:45.174752663Z"}
[2023-10-20T02:58:45.330Z] fatal mtaBuild - failed to execute mta build - running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-10-20T02:58:45.343Z] info  mtaBuild - persisting reports to GCS is disabled, because gcsBucketId is empty
[2023-10-20T02:58:45.356Z] info  mtaBuild - Step telemetry data:{"StepStartTime":"2023-10-20 02:58:43.964976561 +0000 UTC","PipelineURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","BuildURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","StageName":"Build","StepName":"mtaBuild","ErrorCode":"1","StepDuration":"1210","ErrorCategory":"build","CorrelationID":"n/a","PiperCommitHash":"e38ee6774892fae7708a9ba6a9cc8c8985e78292","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-10-20T02:58:45.174752663Z"}}
[2023-10-20T02:58:46.320Z] + ./piper readPipelineEnv
[2023-10-20T02:58:46.345Z] time="2023-10-20T02:58:46Z" level=info msg="Version e38ee6774892fae7708a9ba6a9cc8c8985e78292" library=SAP/jenkins-library
[2023-10-20T02:58:46.637Z] Transfer Influx data
[2023-10-20T02:58:47.152Z] Stash content: pipelineStepReports (includes: .pipeline/stepReports/**, excludes: , useDefaultExcludes: true, allowEmpty: true)
[2023-10-20T02:58:47.263Z] Stashed 0 file(s)
[2023-10-20T02:58:48.327Z] Stash content: container-b21635e2-1b38-4bf2-89e1-d6063a80468c (includes: **/*, excludes: **/node_modules/**,nohup.out, useDefaultExcludes: true, allowEmpty: true)
[2023-10-20T02:58:56.078Z] Stashed 70 file(s)
[2023-10-20T02:58:56.584Z] Unstash content: container-b21635e2-1b38-4bf2-89e1-d6063a80468c
[2023-10-20T02:58:57.853Z] invalidate stash container-b21635e2-1b38-4bf2-89e1-d6063a80468c
[2023-10-20T02:58:57.925Z] Stash content: container-b21635e2-1b38-4bf2-89e1-d6063a80468c (includes: **/*.*, excludes: **/*, useDefaultExcludes: true, allowEmpty: true)
[2023-10-20T02:58:57.993Z] Warning: overwriting stash ‘container-b21635e2-1b38-4bf2-89e1-d6063a80468c’
[2023-10-20T02:58:58.054Z] Stashed 0 file(s)
[2023-10-20T02:58:58.209Z] ----------------------------------------------------------
[2023-10-20T02:58:58.228Z] --- An error occurred in the library step: dockerExecuteOnKubernetes
[2023-10-20T02:58:58.241Z] ----------------------------------------------------------
[2023-10-20T02:58:58.252Z] 
[2023-10-20T02:58:58.266Z] The following parameters were available to the step:
[2023-10-20T02:58:58.276Z] ***
[2023-10-20T02:58:58.287Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-10-20T02:58:58.299Z] *** WARNING: this may reveal sensitive information. ***
[2023-10-20T02:58:58.311Z] ***
[2023-10-20T02:58:58.321Z] 
[2023-10-20T02:58:58.335Z] The error was:
[2023-10-20T02:58:58.347Z] ***
[2023-10-20T02:58:58.358Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-10-20T02:58:58.370Z] ***
[2023-10-20T02:58:58.382Z] 
[2023-10-20T02:58:58.393Z] Further information:
[2023-10-20T02:58:58.405Z] * Documentation of library step dockerExecuteOnKubernetes: https://sap.github.io/jenkins-library/steps/dockerExecuteOnKubernetes/
[2023-10-20T02:58:58.418Z] * Source code of library step dockerExecuteOnKubernetes: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecuteOnKubernetes.groovy
[2023-10-20T02:58:58.428Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-10-20T02:58:58.441Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-10-20T02:58:58.454Z] 
[2023-10-20T02:58:58.464Z] ----------------------------------------------------------
[2023-10-20T02:58:58.478Z] --- End library step of: dockerExecuteOnKubernetes ---
[2023-10-20T02:58:58.612Z] ----------------------------------------------------------
[2023-10-20T02:58:58.632Z] --- An error occurred in the library step: dockerExecute
[2023-10-20T02:58:58.644Z] ----------------------------------------------------------
[2023-10-20T02:58:58.657Z] 
[2023-10-20T02:58:58.707Z] The following parameters were available to the step:
[2023-10-20T02:58:58.724Z] ***
[2023-10-20T02:58:58.736Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-10-20T02:58:58.750Z] *** WARNING: this may reveal sensitive information. ***
[2023-10-20T02:58:58.762Z] ***
[2023-10-20T02:58:58.773Z] 
[2023-10-20T02:58:58.787Z] The error was:
[2023-10-20T02:58:58.799Z] ***
[2023-10-20T02:58:58.811Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-10-20T02:58:58.825Z] ***
[2023-10-20T02:58:58.836Z] 
[2023-10-20T02:58:58.847Z] Further information:
[2023-10-20T02:58:58.861Z] * Documentation of library step dockerExecute: https://sap.github.io/jenkins-library/steps/dockerExecute/
[2023-10-20T02:58:58.872Z] * Source code of library step dockerExecute: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecute.groovy
[2023-10-20T02:58:58.884Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-10-20T02:58:58.898Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-10-20T02:58:58.908Z] 
[2023-10-20T02:58:58.920Z] ----------------------------------------------------------
[2023-10-20T02:58:58.935Z] --- End library step of: dockerExecute ---
[2023-10-20T02:58:59.142Z] ----------------------------------------------------------
[2023-10-20T02:58:59.160Z] --- An error occurred in the library step: mtaBuild
[2023-10-20T02:58:59.175Z] ----------------------------------------------------------
[2023-10-20T02:58:59.187Z] 
[2023-10-20T02:58:59.197Z] The following parameters were available to the step:
[2023-10-20T02:58:59.256Z] ***
[2023-10-20T02:58:59.276Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-10-20T02:58:59.292Z] *** WARNING: this may reveal sensitive information. ***
[2023-10-20T02:58:59.304Z] ***
[2023-10-20T02:58:59.315Z] 
[2023-10-20T02:58:59.326Z] The error was:
[2023-10-20T02:58:59.338Z] ***
[2023-10-20T02:58:59.353Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-10-20T02:58:59.364Z] ***
[2023-10-20T02:58:59.376Z] 
[2023-10-20T02:58:59.386Z] Further information:
[2023-10-20T02:58:59.398Z] * Documentation of library step mtaBuild: https://sap.github.io/jenkins-library/steps/mtaBuild/
[2023-10-20T02:58:59.410Z] * Source code of library step mtaBuild: https://github.com/SAP/jenkins-library/blob/master/vars/mtaBuild.groovy
[2023-10-20T02:58:59.422Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-10-20T02:58:59.433Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-10-20T02:58:59.445Z] 
[2023-10-20T02:58:59.457Z] ----------------------------------------------------------
[2023-10-20T02:58:59.469Z] --- End library step of: mtaBuild ---
[2023-10-20T02:58:59.633Z] ----------------------------------------------------------
[2023-10-20T02:58:59.650Z] --- An error occurred in the library step: buildExecute
[2023-10-20T02:58:59.691Z] ----------------------------------------------------------
[2023-10-20T02:58:59.704Z] 
[2023-10-20T02:59:00.158Z] The following parameters were available to the step:
[2023-10-20T02:59:00.186Z] ***
[2023-10-20T02:59:00.199Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-10-20T02:59:00.213Z] *** WARNING: this may reveal sensitive information. ***
[2023-10-20T02:59:00.233Z] ***
[2023-10-20T02:59:00.245Z] 
[2023-10-20T02:59:00.256Z] The error was:
[2023-10-20T02:59:00.271Z] ***
[2023-10-20T02:59:00.285Z] hudson.AbortException: [mtaBuild] Step execution failed (category: build). Error: running command 'mbt' failed: cmd.Run() failed: exit status 1
[2023-10-20T02:59:00.297Z] ***
[2023-10-20T02:59:00.448Z] 
[2023-10-20T02:59:00.459Z] Further information:
[2023-10-20T02:59:00.472Z] * Documentation of library step buildExecute: https://sap.github.io/jenkins-library/steps/buildExecute/
[2023-10-20T02:59:00.484Z] * Source code of library step buildExecute: https://github.com/SAP/jenkins-library/blob/master/vars/buildExecute.groovy
[2023-10-20T02:59:00.497Z] * Library documentation: https://sap.github.io/jenkins-library/
[2023-10-20T02:59:00.507Z] * Library repository: https://github.com/SAP/jenkins-library/
[2023-10-20T02:59:00.520Z] 
[2023-10-20T02:59:00.533Z] ----------------------------------------------------------
[2023-10-20T02:59:00.543Z] --- End library step of: buildExecute ---
[2023-10-20T02:59:00.605Z] Stash content: cloudcitransfer (includes: cloudcitransfer/**/*, excludes: cloudcitransfer/**/node_modules/**)
[2023-10-20T02:59:00.678Z] Warning: overwriting stash ‘cloudcitransfer’
[2023-10-20T02:59:00.700Z] Stashed 2 file(s)
[2023-10-20T02:59:00.851Z] [null] Sending telemetry data is disabled.
[2023-10-20T02:59:01.019Z] Lock released on resource [risk-management-job]

 

 

 

 

View Entire Topic
former_member169522
Discoverer

Finally got it to work. I just added - npm install in the build-parameters commands in the mta.yaml file.

Phil3_0-1697854064475.png

Lots of missing steps in this tutorial.