cloudfoundry / nodejs-buildpack

Cloud Foundry buildpack for Node.js
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
170 stars 384 forks source link

**ERROR** Unable to install npm: exit status 9 #521

Closed KevinJCross closed 1 year ago

KevinJCross commented 1 year ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version? cf8

What version of the buildpack you are using? latest

If you were attempting to accomplish a task, what was it you were attempting to do? deploy an app

What did you expect to happen? the app to deploy

What was the actual behavior? failed with error saying can not install npm

Can you provide a sample app? yes. https://github.com/cloudfoundry/app-autoscaler-release/tree/main/src/acceptance/assets/app/nodeApp

Please confirm where necessary:

API endpoint: https://api.autoscaler.app-runtime-interfaces.ci.cloudfoundry.org API version: 3.126.0 user: admin org: test space: test_app Creating space test_app in org test as admin... Space 'test_app' already exists. OK

API endpoint: https://api.autoscaler.app-runtime-interfaces.ci.cloudfoundry.org API version: 3.126.0 user: admin org: test space: test_app

up to date, audited 243 packages in 910ms

70 packages are looking for funding run npm fund for details

found 0 vulnerabilities Pushing app test_app to org test / space test_app as admin... Applying manifest file /Users/kevincross/SAPDevelop/cf/app-autoscaler-release/src/acceptance/assets/app/nodeApp/app_manifest.yml...

Updating with these attributes...

applications:

Waiting for API to complete processing files...

Staging app and tracing logs... Downloading nodejs_buildpack... Downloaded nodejs_buildpack Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 creating container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d Security group rules were updated Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 successfully created container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d Downloading app package... Downloaded app package (6M) -----> Nodejs Buildpack version 1.8.0 -----> Installing binaries engines.node (package.json): ^18.0.0 engines.npm (package.json): unspecified (use default) -----> Installing node 18.9.0 Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_18.9.0_linux_x64_cflinuxfs3_f8baeb81.tgz] BuildpackCompileFailed - App staging failed in the buildpack compile phase FAILED

cf log 

Applied manifest to app with guid 356dc5da-7e89-4a49-af0c-ef323eaa702e (--- 2022-10-13T10:56:09.35+0100 [API/0] OUT applications: 2022-10-13T10:56:09.36+0100 [API/0] OUT - name: test_app 2022-10-13T10:56:09.36+0100 [API/0] OUT path: "/Users/kevincross/SAPDevelop/cf/app-autoscaler-release/src/acceptance/assets/app/nodeApp" 2022-10-13T10:56:09.36+0100 [API/0] OUT processes: 2022-10-13T10:56:09.36+0100 [API/0] OUT - disk_quota: 256M 2022-10-13T10:56:09.36+0100 [API/0] OUT health-check-http-endpoint: "/health" 2022-10-13T10:56:09.36+0100 [API/0] OUT health-check-type: http 2022-10-13T10:56:09.36+0100 [API/0] OUT timeout: 120 2022-10-13T10:56:09.37+0100 [API/0] OUT instances: 1 2022-10-13T10:56:09.37+0100 [API/0] OUT memory: 4096M 2022-10-13T10:56:09.37+0100 [API/0] OUT type: web 2022-10-13T10:56:09.37+0100 [API/0] OUT health-check-invocation-timeout: 10 2022-10-13T10:56:09.37+0100 [API/0] OUT default-route: true 2022-10-13T10:56:09.37+0100 [API/0] OUT stack: cflinuxfs3 2022-10-13T10:56:09.37+0100 [API/0] OUT buildpacks: 2022-10-13T10:56:09.38+0100 [API/0] OUT - nodejs_buildpack 2022-10-13T10:56:09.38+0100 [API/0] OUT env: "[PRIVATE DATA HIDDEN]" 2022-10-13T10:56:09.38+0100 [API/0] OUT routes: 2022-10-13T10:56:09.38+0100 [API/0] OUT - protocol: http1 2022-10-13T10:56:09.38+0100 [API/0] OUT route: test_app.autoscaler.app-runtime-interfaces.ci.cloudfoundry.org 2022-10-13T10:56:09.38+0100 [API/0] OUT ) 2022-10-13T10:56:20.99+0100 [API/2] OUT Uploading app package for app with guid 356dc5da-7e89-4a49-af0c-ef323eaa702e 2022-10-13T10:56:33.38+0100 [API/1] OUT Creating build for app with guid 356dc5da-7e89-4a49-af0c-ef323eaa702e 2022-10-13T10:56:33.50+0100 [STG/0] OUT Downloading nodejs_buildpack... 2022-10-13T10:56:33.51+0100 [STG/0] OUT Downloaded nodejs_buildpack 2022-10-13T10:56:33.51+0100 [STG/0] OUT Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 creating container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d 2022-10-13T10:56:33.84+0100 [STG/0] OUT Security group rules were updated 2022-10-13T10:56:33.86+0100 [STG/0] OUT Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 successfully created container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d 2022-10-13T10:56:34.05+0100 [STG/0] OUT Downloading app package... 2022-10-13T10:56:34.80+0100 [STG/0] OUT Downloaded app package (6M) 2022-10-13T10:56:34.89+0100 [STG/0] OUT -----> Nodejs Buildpack version 1.8.0 2022-10-13T10:56:35.14+0100 [STG/0] OUT -----> Installing binaries 2022-10-13T10:56:35.14+0100 [STG/0] OUT engines.node (package.json): ^18.0.0 2022-10-13T10:56:35.14+0100 [STG/0] OUT engines.npm (package.json): unspecified (use default) 2022-10-13T10:56:35.14+0100 [STG/0] OUT -----> Installing node 18.9.0 2022-10-13T10:56:35.14+0100 [STG/0] OUT Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_18.9.0_linux_x64_cflinuxfs3_f8baeb81.tgz] 2022-10-13T10:56:37.53+0100 [STG/0] OUT ERROR Unable to install npm: exit status 9 2022-10-13T10:56:37.70+0100 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14 2022-10-13T10:56:37.71+0100 [STG/0] OUT Exit status 223 2022-10-13T10:56:38.20+0100 [STG/0] OUT Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 stopping instance 15b431dc-2a5c-47c7-8318-6425df463a0d 2022-10-13T10:56:38.20+0100 [STG/0] OUT Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 destroying container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d 2022-10-13T10:56:38.25+0100 [API/2] ERR Failed to stage build: staging failed 2022-10-13T10:56:40.76+0100 [STG/0] OUT Cell 07c6d139-9cb7-4680-a1e3-a475c48b0d02 successfully destroyed container for instance 15b431dc-2a5c-47c7-8318-6425df463a0d

* [x] My log includes an error message
yes
* [x] I have included steps for reproduction
just deploy it. 

cf push \ --var app_name=test_app\ --var app_domain="$(getConfItem apps_domain)"\ --var service_name="$(getConfItem service_name)"\ --var instances=1\ --var node_tls_reject_unauthorized=0\ --var memory_mb="$(getConfItem node_memory_limit||echo 128)"\ --var maxheap_mb="$(getConfItem node_memory_limit||echo 128)"\ -p "$app_dir"\ -f "$app_dir/app_manifest.yml"

KevinJCross commented 1 year ago

This issue is closed by #522 when its merged. For reference the output becomes:

2022-10-13T13:24:58.41+0100 [STG/0] OUT Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_18.10.0_linux_x64_cflinuxfs3_5d530541.tgz]
   2022-10-13T13:25:01.19+0100 [STG/0] OUT **ERROR** node: --expose-gc is not allowed in NODE_OPTIONS
   2022-10-13T13:25:01.19+0100 [STG/0] OUT **ERROR** Unable to install npm: exit status 9
   2022-10-13T13:25:01.36+0100 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14
ryanmoran commented 1 year ago

Closing as #522 has been merged.