Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
c5291887 opened this issue Sep 12, 2024 · 17 comments
Open

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

c5291887 opened this issue Sep 12, 2024 · 17 comments

Comments

@c5291887
Copy link

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
Copy link
Contributor

jmmargo commented Sep 12, 2024

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

@renejeglinsky
Copy link
Contributor

Hi @c5291887 ,

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

@c5291887
Copy link
Author

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

@renejeglinsky
Copy link
Contributor

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

@c5291887 c5291887 reopened this Sep 13, 2024
@renejeglinsky
Copy link
Contributor

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

@c5291887
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

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

@c5291887
Copy link
Author

Hi Rene,
image

@renejeglinsky
Copy link
Contributor

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/[email protected] and at the same time using @cap-js/[email protected]. 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: [email protected]
npm ERR! Found: @sap/[email protected]
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/[email protected]
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/[email protected] when doing cds v -i. And then also the MBT build works.

@c5291887
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

renejeglinsky commented Sep 16, 2024

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
Copy link
Contributor

@c5291887 Can you confirm it worked?

@c5291887
Copy link
Author

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
Copy link
Contributor

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

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

@c5291887
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants