I have this problem where it Failed the deployment without an obvious reason or any errors during the deployment using Render

Hi, I am having this issue in Render where when the deploy logs proceed to the node dist/index.js then my deployment for my server is suddenly Failed without an obvious reason, Render did not even throws an error, I’ve been fixing this for like 1 day but still no luck,
I already put the specific NODE_VERSION in environtment variable as render recommend.
anyone can help me please:(

The LOGS
==> Cloning from https:*************

Mar 9 11:01:48 AM==> Checking out commit c5fbe1012021dc69c9ff001d190296d5241c11cb in branch master

Mar 9 11:01:50 AM==> Using Node version 20.9.0 via environment variable NODE_VERSION

Mar 9 11:01:50 AM==> Docs on specifying a Node version: link

Mar 9 11:01:55 AM==> Running build command ‘npm install && npm run build’…

Mar 9 11:01:58 AM

Mar 9 11:01:58 AMadded 168 packages, and audited 169 packages in 3s

Mar 9 11:01:58 AM

Mar 9 11:01:58 AM16 packages are looking for funding

Mar 9 11:01:58 AM run npm fund for details

Mar 9 11:01:58 AM

Mar 9 11:01:58 AMfound 0 vulnerabilities

Mar 9 11:01:59 AM

Mar 9 11:01:59 AM> build

Mar 9 11:01:59 AM> tsc

Mar 9 11:01:59 AM

Mar 9 11:02:01 AM==> Uploading build…

Mar 9 11:02:09 AM==> Build uploaded in 7s

Mar 9 11:02:09 AM==> Build successful :tada:

Mar 9 11:02:12 AM==> Deploying…

Mar 9 11:02:29 AM==> Using Node version 20.9.0 via environment variable NODE_VERSION

Mar 9 11:02:29 AM==> Docs on specifying a Node version: link

Mar 9 11:02:32 AM==> Running ‘npm run start’

Mar 9 11:02:35 AM

Mar 9 11:02:35 AM> start

Mar 9 11:02:35 AM> node dist/index.js

Mar 9 11:02:35 AM

Mar 9 11:03:11 AM==> Using Node version 20.9.0 via environment variable NODE_VERSION

Mar 9 11:03:11 AM==> Docs on specifying a Node version: link

Mar 9 11:03:11 AM==> Common ways to troubleshoot your deploy: Troubleshooting Your Deploy | Render Docs

Mar 9 11:03:13 AM==> Running ‘npm run start’

Mar 9 11:03:17 AM

Mar 9 11:03:17 AM> start

Mar 9 11:03:17 AM> node dist/index.js

Mar 9 11:03:17 AM

Mar 9 11:04:05 AM==> Using Node version 20.9.0 via environment variable NODE_VERSION

Mar 9 11:04:05 AM==> Docs on specifying a Node version: link

Mar 9 11:04:07 AM==> Running ‘npm run start’

Mar 9 11:04:10 AM

Mar 9 11:04:10 AM> start

Mar 9 11:04:10 AM> node dist/index.js

My Directory

image

My package.json

{
“name”: “server”,
“version”: “”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“start”: “node dist/index.js”,
“dev”: “nodemon src/index.ts”,
“build”: “tsc”
},
“engines”: {
“node”: “20.9.0”
},
“devDependencies”: {
“@types/bcrypt”: “^5.0.2”,
“@types/cookie-parser”: “^1.4.7”,
“@types/cors”: “^2.8.17”,
“@types/dotenv”: “^8.2.0”,
“@types/express”: “^4.17.21”,
“@types/helmet”: “^4.0.0”,
“@types/jsonwebtoken”: “^9.0.6”,
“@types/morgan”: “^1.9.9”,
“nodemon”: “^3.0.2”,
“typescript”: “^5.3.3”
},
“dependencies”: {
“bcrypt”: “^5.1.1”,
“cookie-parser”: “^1.4.6”,
“cors”: “^2.8.5”,
“dotenv”: “^16.3.1”,
“express”: “^4.18.2”,
“express-async-handler”: “^1.2.0”,
“helmet”: “^7.1.0”,
“jsonwebtoken”: “^9.0.2”,
“mongoose”: “^8.0.3”,
“morgan”: “^1.10.0”
}
}
What I entered in during deployment

server
master
npm install && npm run build
npm run start
Please anyone can help me:(

Hey,

Is your server running on 0.0.0.0? Is your application working when you’re deploying it locally?

Jérémy.
Render Support, UTC+3

1 Like

May i know if how to run the server at 0.0.0.0?

This is my first time to deploy my full stack application:)

BY THE WAY, THANKS FOR THE REPLY!

Yes they are working perfectly, I also tried to run my application locally while deploying my server but still no luck:(

Hey,

You don’t have to run your app locally when you’re getting it up on Render, but I was wondering… did you check for and clear out any clear-cut errors? How’s your app doing when you run and deploy it on your own machine?

See https://stackoverflow.com/questions/33953447/express-app-server-listen-all-interfaces-instead-of-localhost-only on how to make sure your server is running on 0.0.0.0. Also, make sure there is single port listening, or specify the port via the ‘PORT’ environment variable.

Jérémy.
Render Support, UTC+3

OMGGGG, It is now working!!!

my fault, the problem is my server can’t connect to the database because the .env returns undefined, and it throws an error so i fix it then it works, THANK YOUU!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.