Skip to content

Deploy a CAP Business Application to SAP Cloud Platform #5036

@ibibhu

Description

@ibibhu

Tutorial URL: https://developers.sap.com/tutorials/cap-service-deploy.html

Please specify the step you are referring to Step 3: Deploy using cf push
"cf push -f gen/srv --random-route" fails with the following error

2020-04-28T11:06:48.32+0530 [APP/PROC/WEB/0] OUT > my-bookshop@1.0.0 start /home/vcap/app 2020-04-28T11:06:48.32+0530 [APP/PROC/WEB/0] OUT > npx cds run 2020-04-28T11:06:55.22+0530 [APP/PROC/WEB/0] OUT [cds] - model loaded from 1 file(s): 2020-04-28T11:06:55.22+0530 [APP/PROC/WEB/0] OUT srv/csn.json 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR [ERROR] Cannot find module '@sap/hana-client' 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Function.Module._load (internal/modules/cjs/loader.js:562:25) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Module.require (internal/modules/cjs/loader.js:692:17) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at require (internal/modules/cjs/helpers.js:25:18) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at _getClient (/home/vcap/deps/0/node_modules/@sap/cds-hana/lib/client/hanaClient.js:7:36) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/deps/0/node_modules/@sap/cds-hana/lib/client/hanaClient.js:18:18) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Module._compile (internal/modules/cjs/loader.js:778:30) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at Module.load (internal/modules/cjs/loader.js:653:32) 2020-04-28T11:06:59.02+0530 [APP/PROC/WEB/0] ERR at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 2020-04-28T11:06:59.12+0530 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE 2020-04-28T11:06:59.12+0530 [APP/PROC/WEB/0] ERR npm ERR! errno 1 2020-04-28T11:06:59.12+0530 [APP/PROC/WEB/0] ERR npm ERR! my-bookshop@1.0.0 start: npx cds run2020-04-28T11:06:59.21+0530 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1 2020-04-28T11:06:59.21+0530 [APP/PROC/WEB/0] ERR npm ERR! 2020-04-28T11:06:59.21+0530 [APP/PROC/WEB/0] ERR npm ERR! Failed at the my-bookshop@1.0.0 start script. 2020-04-28T11:06:59.21+0530 [APP/PROC/WEB/0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2020-04-28T11:06:59.23+0530 [APP/PROC/WEB/0] ERR npm ERR! A complete log of this run can be found in: 2020-04-28T11:06:59.23+0530 [APP/PROC/WEB/0] ERR npm ERR! /home/vcap/app/.npm/_logs/2020-04-28T05_36_59_218Z-debug.log 2020-04-28T11:06:59.26+0530 [APP/PROC/WEB/0] OUT Exit status 1 2020-04-28T11:06:59.51+0530 [CELL/0] OUT Cell f9b5a5be-6f20-4e3d-a360-d9e708a8a230 stopping instance 803b1cd4-b823-4f74-5ace-df7b 2020-04-28T11:06:59.51+0530 [CELL/0] OUT Cell f9b5a5be-6f20-4e3d-a360-d9e708a8a230 destroying container for instance 803b1cd4-b823-4f74-5ace-df7b 2020-04-28T11:06:59.54+0530 [API/46] OUT Process has crashed with type: "web" 2020-04-28T11:06:59.55+0530 [API/46] OUT App instance exited with guid 66a41264-b752-44df-89b9-0c8909293dc9 payload: {"instance"=>"803b1cd4-b823-4f74-5ace-df7b", "index"=>0, "cell_id"=>"f9b5a5be-6f20-4e3d-a360-d9e708a8a230", "reason"=>"CRASHED", "exit_description"=>"APP/PROC/WEB: Exited with status 1", "crash_count"=>3, "crash_timestamp"=>1588052219506569629, "version"=>"3d705077-89f2-4eb7-aba4-3cbf9b55038e"} 2020-04-28T11:07:00.33+0530 [CELL/0] OUT Cell f9b5a5be-6f20-4e3d-a360-d9e708a8a230 successfully destroyed container for instance 803b1cd4-b823-4f74-5ace-df7b 2020-04-28T11:07:59.70+0530 [CELL/0] OUT Cell f8a111ad-25ff-4323-a3a0-e15550e4a4b1 creating container for instance 373330d8-b8c2-49c3-75c1-bdd3 2020-04-28T11:08:02.65+0530 [CELL/0] OUT Cell f8a111ad-25ff-4323-a3a0-e15550e4a4b1 successfully created container for instance 373330d8-b8c2-49c3-75c1-bdd3 2020-04-28T11:08:02.79+0530 [CELL/0] OUT Downloading droplet... 2020-04-28T11:08:04.62+0530 [CELL/0] OUT Downloaded droplet (27.9M) 2020-04-28T11:08:04.62+0530 [CELL/0] OUT Starting health monitoring of container 2020-04-28T11:08:12.50+0530 [APP/PROC/WEB/0] OUT > my-bookshop@1.0.0 start /home/vcap/app 2020-04-28T11:08:12.50+0530 [APP/PROC/WEB/0] OUT > npx cds run 2020-04-28T11:08:19.49+0530 [APP/PROC/WEB/0] OUT [cds] - model loaded from 1 file(s): 2020-04-28T11:08:19.49+0530 [APP/PROC/WEB/0] OUT srv/csn.json 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR [ERROR] Cannot find module '@sap/hana-client' 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Function.Module._load (internal/modules/cjs/loader.js:562:25) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Module.require (internal/modules/cjs/loader.js:692:17) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at require (internal/modules/cjs/helpers.js:25:18) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at _getClient (/home/vcap/deps/0/node_modules/@sap/cds-hana/lib/client/hanaClient.js:7:36) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/deps/0/node_modules/@sap/cds-hana/lib/client/hanaClient.js:18:18) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Module._compile (internal/modules/cjs/loader.js:778:30) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at Module.load (internal/modules/cjs/loader.js:653:32) 2020-04-28T11:08:23.30+0530 [APP/PROC/WEB/0] ERR at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 2020-04-28T11:08:23.40+0530 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE 2020-04-28T11:08:23.40+0530 [APP/PROC/WEB/0] ERR npm ERR! errno 1 2020-04-28T11:08:23.49+0530 [APP/PROC/WEB/0] ERR npm ERR! my-bookshop@1.0.0 start:npx cds run 2020-04-28T11:08:23.49+0530 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1 2020-04-28T11:08:23.49+0530 [APP/PROC/WEB/0] ERR npm ERR! 2020-04-28T11:08:23.49+0530 [APP/PROC/WEB/0] ERR npm ERR! Failed at the my-bookshop@1.0.0 start script. 2020-04-28T11:08:23.49+0530 [APP/PROC/WEB/0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2020-04-28T11:08:23.50+0530 [APP/PROC/WEB/0] ERR npm ERR! A complete log of this run can be found in: 2020-04-28T11:08:23.50+0530 [APP/PROC/WEB/0] ERR npm ERR! /home/vcap/app/.npm/_logs/2020-04-28T05_38_23_499Z-debug.log

I checked the pacakge.json : "@sap/hana-client" was not there

"dependencies": { "@sap/cds": "^3", "express": "^4", "hana": "0.0.2" }

So I added it to the dependencies @sap/hana-client.

"dependencies": { "@sap/cds": "^3", "@sap/hana-client": "^2.4.194", "express": "^4", "hana": "0.0.2" }

And the service was up and running and able to access the oData.

Can you please check why "hana" is required as dependency.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions