cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot deploy app to SAP Cloud Platform from WebIDE

Richie
Product and Topic Expert
Product and Topic Expert
5,719

Hi,

I'm following the learning plan here: https://learning.sap.com/learning-journey/developing-with-sap-extension-suite/deploy-manually and I am facing issues.

When running cf push to push the app to my trial account. I'm getting the following errors.

npm ERR! code ENOTFOUND

npm ERR! syscall getaddrinfo

npm ERR! errno ENOTFOUND

npm ERR! network request to http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/yallist/-/yallis... failed, reason: getaddrinfo ENOTFOUND nginx-redirector.repo-cache.svc.cluster.local

npm ERR! network This is a problem related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:

npm ERR! /tmp/cache/final/.npm/_logs/2021-12-16T10_59_15_309Z-debug.log

**ERROR** Unable to build dependencies: exit status 1

Failed to compile droplet: Failed to run all supply scripts: exit status 14

Exit status 223

Cell cfeb172d-f2c7-42d1-a157-58148983025c stopping instance 6a8d2f73-d181-4569-b51b-03b4c12a79b6

Cell cfeb172d-f2c7-42d1-a157-58148983025c destroying container for instance 6a8d2f73-d181-4569-b51b-03b4c12a79b6

BuildpackCompileFailed - App staging failed in the buildpack compile phase

FAILED

I am sure that I have no network issues as the errors suggests. Can anyone shed some light on this?

Richie

VVancalbergh
Contributor

You are using the wrong tag, this question is not related to SAP Cloud Applications Studio. Maybe SAP Cloud Studio? (not the same thing)

Dino
Explorer
0 Kudos

Hi Richie,

I have a similar problem with my project since last week when pushing my service to CF.

network request to http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/node-bin-setup/-... failed, reason: getaddrinfo ENOTFOUND nginx-redirector.repo-cache.svc.cluster.local

I can still build the MTA and deploy this. So I have a workaround. But it is much faster to just deploy the changes of a part (e.g. the service)


Did you find any solution?

Best Regards,
Dino

Richie
Product and Topic Expert
Product and Topic Expert

Hi Dino,

No I still have not found a resolution. I have raised the issue here: https://groups.community.sap.com/t5/sap-btp-learning/code-snippets-for-the-quot-developing-with-sap-...

Maybe you could also comment on that blog as I did get an initial response.

Thanks,

Richie

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Kudos

i also facing the same issue when deploying my MTA file from Business application studio.

Accepted Solutions (0)

Answers (8)

Answers (8)

SebastianEsch
Active Participant

Hi,

I think you are using SAP Business Application Studio and not SAP Web IDE, right?

The problem you are probably running into is, BAS creates a package-lock.json with URLs for the NPM repository, which cannot be resolved outside BAS. For example in the Cloud Foundry environment, when you deploy your app.

To avoid this problem, follow the steps in the accepted answer of How to avoid changes in package-lock.json when using local and BAS development in parallel?

In short: add a file named .npmrc to your project directory with the content

registry=https://registry.npmjs.com/

then run npm install again and you should notice in your package-lock.json that the repository URLs have changed from http://nginx-redirector.repo-cache.svc.cluster.local/repository/. to https://registry.npmjs.com/.

Kind regards,

Sebastian

tomjohn_br
Explorer

Hi everyone,

I was facing the same issue and I solved it by changing the address from http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/ to https://registry.npmjs.org/ in the package-lock.json file.

I.e.

from: http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/passport/-/passp...

to: https://registry.npmjs.org/passport/-/passport-0.6.0.tgz

I have executed the command cds build --production and cf push after that and it worked.

I hope it helps.

SumiKang
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @tomjohn.br, Thanks for your comment.

I have one question. I changed all code in the package-lock.json file like under.


After that, I built my MTA file and deployed it, but I was still stuck in the same error. Can you help me?

Staging application "btpdms-fiori-approuter"...<br>Error staging application "btpdms-fiori-approuter": BuildpackCompileFailed - App staging failed in the buildpack compile phase<br>Download the application logs via the dmol command and check them for more information.<br>A step of the process has failed. Retrying it may solve the issue.<br>Process failed.
minjie_lao
Product and Topic Expert
Product and Topic Expert

i still have the same issue, and also tried to add .npmrc file to change the url in package-lock.json, but seems the npm install is NOT modifying the url from "http://nginx-redirector.repo-cache.svc.cluster.local/repository/ to https://registry.npmjs.com/.

Does anyone now how to solve the issue?

minjie_lao
Product and Topic Expert
Product and Topic Expert

Finally, i solved the issue by manually updating the all URLs (http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/) to https://registry.npmjs.com/ in package-lock.json of project root folder

then rebuild mtar file, my application is deployed to BTP successfully.

As above comments, seems the repo-cache url was not working properly, BTP is not able to download the packages against the url.

Hope the eng team can fix it.

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Kudos

one more hints, if rebuilding the manually update url plus rebuild the mtar file is not working.

If you building your project in Business application stuido.

Download the generated mtar file to your local machine, change the extension 'mtar' to 'rar' then update the package-lock.json file of xxxx-srv folder manually. then upload / replace the mtar file in BAS

Sometimes, rebuilding the mtar file, BAS will overwrite the url again.

0 Kudos

if i specify the nodejs version as 14.x.x then it works fine for me otherwise it throws the same error.

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi All
Try this with my new blog written for CAP Project lowcode nocode deploy to BTP
https://blogs.sap.com/2022/05/25/build-cap-project-using-low-code-based-full-stack-cloud-application...

Richie
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi All,

Can you try again today, mine just unexpectedly began to work 🙂

Dino
Explorer

Hi Richie,
great to hear that it is working for you now.

I could solve my problem today.
I had to set the node/npm versions in the package.json:

"engines": { "node": "16.11.1", "npm": "8.0.0" }
dhrubajyoti
Advisor
Advisor
0 Kudos

I have the same exact problem. My MTA also fails.

I am going through the CLD200 documentation stepwise and building the sample application.

It has been working properly, until I get to the Manual Deployment chapter.

Issue#1: The cf push command from page #156 from the document keeps failing. When I run the cf push command, I get the below error:

user: risk-management $ cf push

Pushing apps risk-management-srv, risk-management-db-deployer to org 20afb725trial / space dev as dhrubajyoti.basak@sap.com...

Applying manifest file /home/user/projects/risk-management/manifest.yml...

Manifest applied

Packaging files to upload...

Uploading files...

9.24 KiB / 9.24 KiB 100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...

Downloading nodejs_buildpack...

Downloaded nodejs_buildpack

Cell 5ddf71ab-938b-4a0b-bfba-5933153fd5a9 creating container for instance cc92ccaf-1a67-403e-8b7a-66172f1e59ea

Cell 5ddf71ab-938b-4a0b-bfba-5933153fd5a9 successfully created container for instance cc92ccaf-1a67-403e-8b7a-66172f1e59ea

Downloading app package...

Downloaded app package (327.8K)

-----> Nodejs Buildpack version 1.7.63

-----> Installing binaries

engines.node (package.json): >=12.18

engines.npm (package.json): unspecified (use default)

**WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html

-----> Installing node 16.11.1

Copy [/tmp/buildpacks/b5d6a61786998958022dd900561c3bef/dependencies/b1672274bee4660a04596e3593464719/node_16.11.1_linux_x64_cflinuxfs3_beefe428.tgz]

Using default npm version: 8.0.0

-----> Installing yarn 1.22.17

Copy [/tmp/buildpacks/b5d6a61786998958022dd900561c3bef/dependencies/4984aeaaf5967be21b1e442d431a1957/yarn_1.22.17_linux_noarch_any-stack_08892f64.tgz]

Installed yarn 1.22.17

-----> Creating runtime environment

PRO TIP: It is recommended to vendor the application's Node.js dependencies

Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring

NODE_ENV=production

NODE_HOME=/tmp/contents3826178700/deps/0/node

NODE_MODULES_CACHE=true

NODE_VERBOSE=false

NPM_CONFIG_LOGLEVEL=error

NPM_CONFIG_PRODUCTION=true

-----> Building dependencies

Installing node modules (package.json + package-lock.json)

npm notice

npm notice New minor version of npm available! 8.0.0 -> 8.3.0

npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0

npm notice

npm ERR! code ENOTFOUND

npm ERR! syscall getaddrinfo

npm ERR! errno ENOTFOUND

npm ERR! network request to http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/yallist/-/yallis... failed, reason: getaddrinfo ENOTFOUND nginx-redirector.repo-cache.svc.cluster.local

npm ERR! network This is a problem related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:

npm ERR! /tmp/cache/final/.npm/_logs/2022-01-12T16_47_09_948Z-debug.log

**ERROR** Unable to build dependencies: exit status 1

BuildpackCompileFailed - App staging failed in the buildpack compile phase

FAILED

Issue #2: I am also facing issues with the MTA build process. When I run the command “mbt build -t ./”, it also fails with the below error:

user: risk-management $ mbt build -t ./

[2022-01-12 20:00:41] INFO Cloud MTA Build Tool version 1.2.7

[2022-01-12 20:00:41] INFO generating the "Makefile_20220112200041.mta" file...

[2022-01-12 20:00:41] INFO done

[2022-01-12 20:00:41] INFO executing the "make -f Makefile_20220112200041.mta p=cf mtar= strict=true mode= t=\"./\"" command...

[2022-01-12 20:00:41] INFO validating the MTA project

[2022-01-12 20:00:41] INFO running the "before-all" build...

[2022-01-12 20:00:41] INFO executing the "npm ci" command...

npm WARN prepare removing existing node_modules/ before installation

npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.

npm ERR!

npm ERR!

npm ERR! Missing: hdb@^0.18.3

npm ERR!

npm ERR! A complete log of this run can be found in:

npm ERR! /home/user/.npm/_logs/2022-01-12T20_00_42_587Z-debug.log

[2022-01-12 20:00:42] ERROR the "before-all"" build failed: could not execute the "npm ci" command: exit status 1

make: *** [Makefile_20220112200041.mta:28: pre_build] Error 1

Error: could not build the MTA project: could not execute the "make -f Makefile_20220112200041.mta p=cf mtar= strict=true mode= t=\"./\"" command: exit status 2

alicegavanelli
Participant
0 Kudos

Hi richie.feeney,

I have exactly the same problem.

Have you solved it?

Regards.

Alice Gavanelli

Richie
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alice,

No I still have not found a resolution. I have raised the issue here: https://groups.community.sap.com/t5/sap-btp-learning/code-snippets-for-the-quot-developing-with-sap-...

Maybe you could also comment on that blog as I did get an initial response.

Thanks,

Richie