cancel
Showing results for 
Search instead for 
Did you mean: 

CLD200 - Manual Deployment keeps erroring out

dhrubajyoti
Advisor
Advisor
0 Kudos

SAP Extension Suite 

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 Run `npm install -g npm@8.3.0` to update!

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/-/yallist-4.0.0.tgz 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

 

Did anyone come across this issue & how did you resolve this?

Thanks.

- Dhruba

Sabarim_07
Explorer

Hi Dhruba,

For issue 1,
Step 1: 
Add the .npmrc file

add the content registry=https://registry.npmjs.com/

Step 2:

Delete the package-lock.json & node_module in your existing project with the respective files from the repository.
Then run command npm ci within the root of your project.

I also faced the same issue#1, by following these step it will be resolved.
Thanks,

Sabari Nathan

View Entire Topic
jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @dhrubajyoti @Jarmo_Tuominen ,

unfortunately I cannot reproduce the issue. I have adjusted the instructions, can you try to execute these adjusted instructions?

  • remove package-lock.json file from your project

  • create a file .npmrc in the directory where the package.json resides
  • add following line into the .npmrc file 
    registry=https://registry.npmjs.com/
  • run command npm install in the terminal within the root directory of your project (where the package.json file resides)
  • try to do the cf push again
  • let us know the results

I took inspiration from the following question in the community https://answers.sap.com/questions/13544661/how-to-avoid-changes-in-package-lockjson-when-usin.html , but unfortunately as said cannot reproduce the issue myself.

Thanks and best regards,

Jannes

Tiwari
Explorer
0 Kudos
deleted package-lock.json and then created file .npmrc in the same directory where package.json resides. then ran npm install and then CF PUSH.. but again same error..
Tiwari
Explorer
0 Kudos
I had even tried replacing content http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/ from package-lock.json with this URL. but, still it did'nt work.
Tiwari
Explorer
0 Kudos
someone has suggested on stackoverflow - npm config set proxy http://domain:8080 but, I am not sure as how to try this 😞
Tiwari
Explorer
0 Kudos

I may be wrong but the URL ( http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/) may be causing this. this may be locally accessible from SAP network but not from outside. This is just a vague thought. I tried opening this link and it says that it is not reachable. this URL is generated in package-lock.json file.

Tiwari
Explorer
0 Kudos
i also added "engines": { "node": "16.11.1", "npm": "8.0.0" } in package.json but no luck 😞
Tiwari
Explorer
0 Kudos
Sorry Jannes .. I know it would be difficult for you as you are not able to reproduce this issue. I am also trying different options to check and let you know so that something can trigger some thoughts which could be helpful for us facing this issue. Thanks
Tiwari
Explorer
0 Kudos

i tried command- "npm help config"    result --- npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2022-03-30T16_44_12_569Z-debug-0.log

jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Tiwari,

thanks for your efforts and for keeping us informed. Could you please try to run command

npm ci

instead of the npm i or npm install? npm ci is doing a clean install of all dependencies, e.g. removing all existing node modules before installing them again.

Best regards,

Jannes

Tiwari
Explorer
0 Kudos
Hi Jannes.. npm ci is throwing error if we remove package-lock.json. i ran npm install first and the ran npm ci. after that, i ran cf push but i am still getting the same error.
Tiwari
Explorer
0 Kudos
@Jannes - I tried npm help config command --- getting below error - npm help config npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in.. I am not sure if you can get any clue with this error. Thanks for your help!