cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP app deployment to Cloud Foundry failed ("some instances have crashed")

iperez-sofos
Participant

Greetings everyone!

I am working on a project based on SAP CAP and SAP HANA DB, in the SAP BTP environment (trial account).

Following the CAPm model, my application consists of a database module (db), a services module (srv) and an app module that is only the approuter (I don't have a Fiori UI or any other, since I don't require it).

Following these the following tutorials from Thomas Jung (and some others, to a lesser extent):

https://developers.sap.com/tutorials/hana-cloud-cap-create-project.html (from that tutorial, all of the following)

https://developers.sap.com/tutorials/hana-cloud-cap-deploy-mta.html

I have managed to advance a lot in understanding the process, and get closer to what I need to do: Deploy my application to my space in Cloud Foundry (within my SAP BTP Trial account).

However, so far I always get the same error when I try to deploy my application (the corresponding .mtar file):

Error starting application "UAM-app-srv": Some instances have crashed. Check the logs of your application for more information.

UAM-app is the name of my application, and UAM-app-srv is the service module.

In the registry in the cockpit (Most recent Application Events) I have the following message (just an excerpt) for the different events of the service module (srv) deployment:

exit_description: APP/PROC/WEB: Exited with status 1, reason: CRASHED

At the moment I have no further clues as to the cause of the error. I have thought that it could even be due to limitations of the Trial account, perhaps regarding the number of applications that can be running at the same time in the Cloud Foundry environment, could it be?

Note: I only have three applications deployed in Cloud Foundry, corresponding to the three modules of my application (the one I am dealing with here: db deployer, app and srv).

Thank you very much in advance for any helpful answers and/or comments.

P.S:

I have not published here the record that is generated in the Deployment process, with all the corresponding details, because I think it is very extensive. I can publish it, however, if someone considers that it is necessary to be able to give an answer regarding the error I have with the deployment.

gregorw
Active Contributor
0 Kudos

Please run:

cf logs UAM-app-srv

while deploying your applicaiton. Check what errors you see there. Have you specified the minimul Node.JS version as mentioned in Check the Node.js version

iperez-sofos
Participant
0 Kudos

Greetings back, Mr. Gregor Wolf.

Thank you very much for your answer.

The result (an extract) of the command that indicates me is the following:

2021-05-31T07:51:45.94+0000 [APP/PROC/WEB/0] ERR     Node.js v12.18 or higher is required for @sap/cds 5.1.4.
   2021-05-31T07:51:45.94+0000 [APP/PROC/WEB/0] ERR     Current v10.24 does not satisfy this.
   2021-05-31T07:51:45.94+0000 [APP/PROC/WEB/0] ERR     
   2021-05-31T07:51:45.95+0000 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
   2021-05-31T07:51:45.95+0000 [APP/PROC/WEB/0] ERR npm ERR! errno 1
   2021-05-31T07:51:45.96+0000 [APP/PROC/WEB/0] ERR npm ERR! uam-app@1.0.0 start: `NODE_ENV=production cds run`
   2021-05-31T07:51:45.96+0000 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1
   2021-05-31T07:51:45.96+0000 [APP/PROC/WEB/0] ERR npm ERR! 
   2021-05-31T07:51:45.96+0000 [APP/PROC/WEB/0] ERR npm ERR! Failed at the uam-app@1.0.0 start script.
   2021-05-31T07:51:45.96+0000 [APP/PROC/WEB/0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My question is now what options do I have?

  1. Do I have to use an older version of @sap/cds in my application?
  2. Can I update the Node version used in Cloud Foundry? Is this last option convenient?
vicky_parida
Explorer
0 Kudos

Hi Isaac,

Hope you are doing well. I am also facing the same issue while starting the service it's crashing. Were you able to resolve the issue. If yes please let me know so I can follow the same footsteps.

Thanks & Regards,

Vicky Parida

SantiagoB
Explorer
0 Kudos

Regards, Vicky.

In principle, it's been a long time since I had this problem, and I don't exactly remember everything about my solution back then.

What I am sure of is that I added to my package.json file the lines that Gregor Wolf indicated in his answer below. Namely:

     "engine": {
"node": "^12 || ^14"
},

I don't remember if that was enough or if I did something else.

From the previous fragment, you must adapt it to your circumstance, placing the version of NodeJS that you are using in your development.

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
Active Contributor

Seems you're not reading the mentioned documentation exactly. You have to add an engines section to your package.json. Check out package.json#L7.

iperez-sofos
Participant

Excuse me, I didn't see the second part of your answer: "while deploying your applicaiton. Check what errors you see there. Have you specified the minimul Node.JS version as mentioned in Check the Node.js version"

A mistake on my part.

Thanks again.

nuppena
Explorer
0 Kudos

Hi Gregor Wolf

Please can you help on the below issues, I have implemented CAP application using SAP BTP PostgreSQL hyperscalar servicein trial account.

Followed the blogs

https://blogs.sap.com/2020/11/16/getting-started-with-cap-on-postgresql-node.js/

Issue#1

Deployed the CAP application in SAP BTP Cloud foundry, but below service is crashed there is few log messages. Also updated the node version in package.json but still the same issue

"engines": {

"node": "^14 || ^16" },

Issue#2

I am trying to connect PostgreSQL from the SAP BAS CAP using the default-env.json with VCAP_SERVICES but getting connection issue

[cds] - Error: read ECONNRESET

at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {

errno: -104,

code: 'ECONNRESET',

syscall: 'read',

id: '1348379',

level: 'ERROR',

timestamp: 1661942574081

}

gregorw
Active Contributor
0 Kudos

Please do not hijack solved questions. Please post a new question. But before you do this for your PostgreSQL issue try my pg-beershop sample project.

Answers (0)