0

I'm trying to deploy a very simple app on Openode. I use VSCode to code the app. I also use the command below:

openode deploy

in the terminal. But every time I get the log below:

[Wed May 04 2022 15:43:23] -  [+] Authentication valid.
⠋ Sending files (trial 1) - file=./app.js size=421 operation=M
Sending files (trial 1) - file=./Dockerfile size=400 operation=C
Sending files (trial 1) - file=./package-lock.json size=576070 operation=M
Sending files (trial 1) - file=./package.json size=311 operation=M
⠴ 4/4
⠇ [info] Preparing instance image...
⠦ [info] ----------------------------- REMOTE BUILD OUTPUT ------------------------------
starting build "be7caca6-4d24-4fb8-868a-788fe21724fc"

FETCHSOURCE
Fetching storage object: gs://openode_cloudbuild/source/1651662817.856651-        4ca57dee159a459aad0de20597a0ea87.tgz#1651662818498367
Copying gs://openode_cloudbuild/source/1651662817.856651-    4ca57dee159a459aad0de20597a0ea87.tgz#1651662818498367...
/ [1 files][101.8 KiB/101.8 KiB]
Operation completed over 1 objects/101.8 KiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon  581.1kB
Step 1/8 : FROM node:16-alpine
16-alpine: Pulling from library/node
...
Digest: sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10
Status: Downloaded newer image for node:16-alpine
 ---> e5065cc78074
Step 2/8 : WORKDIR /opt/app
 ---> Running in 43eba802f064
Removing intermediate container 43eba802f064
 ---> 36eb952180bb
Step 3/8 : ENV PORT=80
 ---> Running in 52a96acb666c
Removing intermediate container 52a96acb666c
 ---> 142b3a4b0300
Step 4/8 : RUN echo 'crond' > /boot.sh
 ---> Running in 4bd61428068e
Removing intermediate container 4bd61428068e
 ---> 514493001fc5
Step 5/8 : COPY package*.json ./
 ---> 47992535fb05
Step 6/8 : RUN npm install --production
 ---> Running in 483bb82428b1
npm WARN deprecated strip-eof@2.0.0: Renamed to `strip-final-newline` to better represent its functionality.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

added 753 packages, and audited 754 packages in 33s

29 packages are looking for funding
run `npm fund` for details

20 vulnerabilities (8 moderate, 12 high)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 8.5.5 -> 8.8.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.8.0>
npm notice Run `npm install -g npm@8.8.0` to update!
npm notice
Removing intermediate container 483bb82428b1
 ---> 554d52fb54fd
Step 7/8 : COPY . .
 ---> 438b64e10f1c
Step 8/8 : CMD sh /boot.sh && npm start
 ---> Running in 8e1ee006be51
Removing intermediate container 8e1ee006be51
 ---> ee70ea9d469a
Successfully built ee70ea9d469a
Successfully tagged gcr.io/openode/tert2:tert2--30794--1712208
PUSH
Pushing gcr.io/openode/tert2:tert2--30794--1712208
The push refers to repository [gcr.io/openode/tert2]
...
tert2--30794--1712208: digest:         sha256:c10cd20b145af3d939b461a2612779f31ffc9e4ed1cd095e92065b3104941d1f size: 2204
DONE
--------------------------------------------------------------------------------

[info] Deploying instance...
⠼ [error] Deploying container to Cloud Run service [instance-30794] in project [openode]     region [europe-west1]
Deploying new service...
Setting IAM Policy..................done
Creating     Revision................................................................................................................................................................................................failed
Deployment failed
ERROR: (gcloud.run.deploy) Cloud Run error: The user-provided container failed to start and listen on the port defined provided by the PORT=80 
environment variable. Logs for this revision might contain more information.


⠴ [error] Unable to deploy the instance with success
[info] Finalizing...
[info] Stopping instance...
⠴ [info] 

*** Final Deployment state: FAILED ***

[info] ...finalized.

As it can be observed in the log, it looks like the main error lays in this part: ERROR: (gcloud.run.deploy) Cloud Run error: The user-provided container failed to start and listen on the port defined provided by the PORT=80 .

I have seen a post discussing the same issue deploying an app, but it didn't help me solve the issue. Though that post doesn't directly discuss the NodeJS.

saraX
  • 181
  • 2
  • 13

0 Answers0