sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
718 stars 772 forks source link

Issue in Build a Business Application Using CAP for Node.js #23731

Open c5291887 opened 1 week ago

c5291887 commented 1 week ago

Hi Colleagues,

We are testing Starter Scenario for September month cycle in US region.

Tutorial link: https://developers.sap.com/tutorials/cap-service-deploy.html Trial account link: https://cockpit.hanatrial.ondemand.com/trial/#/home/trial

Here in step no 3, deploy using CF deploy, this command "mbt build -t gen --mtar mta.tar" is giving error as below.

image

" [2024-09-12 14:40:04] ERROR could not build the MTA project: could not execute the "make -f Makefile_20240912143957.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2 Error: could not build the MTA project: could not execute the "make -f Makefile_20240912143957.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2"

Please find the attached screen shot for reference. image

Thanks & Regards, Aruna J R

jmmargo commented 1 week ago

@renejeglinsky please respond to the user's feedback. Thank you.

renejeglinsky commented 1 week ago

Hi @c5291887 ,

you're using Powershell. Could you please test it with another CLI?

c5291887 commented 1 week ago

Hi Rene we have verified in git bash and cmd but still the same error exists. kindly help us to proceed further. image

renejeglinsky commented 1 week ago

As this is a different error and you closed the issue, I assume you executed the tutorial successfully. Thanks for testing and reaching out :)

renejeglinsky commented 1 week ago

For the current error, you need to create a DB, according to the error message.

c5291887 commented 1 week ago

Hi Rene Yesterday i did some work around n got some different error. But now i executed same scenario from scratch and got same error in Git Bash also. Kindly suggest me to proceed further. Thanks for your support.

image

renejeglinsky commented 1 week ago

There seems to be a problem with the nmp ci command. Could you attach the whole error log? I'm not sure what causes this upstream conflict. I haven't seen this before

renejeglinsky commented 6 days ago

And please provide the versions you're using: cds v -i

c5291887 commented 6 days ago

Hi Rene, image

renejeglinsky commented 6 days ago

Please do cds v -i inside the my-bookshop project. I'm pretty sure you'll find @sap/cds with 8.1 or less there. I could reproduce your error when using @sap/cds@8.1 and at the same time using @cap-js/hana@1.2.0. You log in the terminal (was not part of your screenshot) contains:

Error: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-bookshop@1.0.0
npm ERR! Found: @sap/cds@8.1.1
npm ERR! node_modules/@sap/cds
npm ERR!   @sap/cds@"8.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @sap/cds@">=8.2" from @cap-js/hana@1.2.0
npm ERR! node_modules/@cap-js/hana
npm ERR!   @cap-js/hana@"^1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Solution: You dependencies in your package.json should look as follows:

"dependencies": {
    "@sap/cds": "^8",
    "express": "^4",
    "@sap/xssec": "^4",
    "@cap-js/hana": "^1"
  },

After npm install you should find @sap/cds@8.2 when doing cds v -i. And then also the MBT build works.

c5291887 commented 5 days ago

We are able to create mta.tar file with cds version "@sap/cds": "^8" and while deploying i got this below error.

Creating service "my-bookshop-db" from MTA resource "my-bookshop-db"... Error monitoring creation or update of services: Error creating service "my-bookshop-db" from offering "hana" and plan "hdi-shared": Service broker error: Service broker hana-broker failed with: Can not create service instance 'my-bookshop-db': There is no database available. Ensure that you have a database available in space 'dev' within organization 'd5e66d9btrial'.

image

c5291887 commented 5 days ago

Am able to create database instance manually but from vs code its not happening "cf deploy gen/mta.tar".

image

The instance "abc1234" which we created manually. image

Kindly suggest me to proceed further. Thanks

renejeglinsky commented 5 days ago

Hi, I can't reproduce this. For me it works.

Please delete all service instances and apps related to this tutorial and make a fresh deployment. I'm sure it will work then if the DB is running.

renejeglinsky commented 2 days ago

@c5291887 Can you confirm it worked?

c5291887 commented 1 day ago

Hi Rene, Yesterday i retested the scenario with new instance creation and deployed successfully and log file is generated as per the requirement.

image

The URL generated in log file is not launching as per requirnment. image

Kindly suggest me to proceed further. Thanks

renejeglinsky commented 1 day ago

Please use the other URL from the AppRouter (the one without -srv):

Application "my-bookshop" started and available ...

c5291887 commented 1 day ago

I have launched this URL "fb2f4044trial-dev-my-bookshop.cfapps.us10-001.hana.ondemand.com" in different browsers and i got below response.

Application "my-bookshop" started and available at "fb2f4044trial-dev-my-bookshop.cfapps.us10-001.hana.ondemand.com"

image