in heroku nodemon app crash when i am trying to run the server.heroku logs --tail this error showing node/internalmodule/cjsloader936 - node.js

GITHUB LINK - https://github.com/sc43412/ecomerce-api.git
enter image description here demon] app crashed - waiting for file changes before starting...
2022-03-11T18:52:20.928289+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch.Stopping process with SIGKILLError: Cannot find module '../models/Product'

Related

heroku error Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

I made a scraper with puppeteer and I didn't specified any port for serving it. it just runs and scrape data and exits with process.exit() command.
I deployed it to heroku with cli but after running it throw error:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch.
Stopping process with SIGKILL
Process exited with status 137
whats wrong?
Looks like you have a Web Dyno so the app must bind to $PORT.
You can instead define a worker (in the Procfile) if you do not need incoming HTTP requests.

How can I fix Error R10 (Boot timeout) on Gatsby JS?

I want to set up Gatsby on Heroku. I have followed the steps from https://www.gatsbyjs.org/docs/deploying-to-heroku/ and created a Procfile as described here https://devcenter.heroku.com/articles/procfile, but I'm still getting a timeout error on deploy. It seems like the port is starting to work, but for some reason it stops.
I've tried different lines to put in Procfile, but none of them worked. Currently I have web: gatsby serve --port $PORT - this is the last thing that I've tried putting in this file. Also I tried with web: npm start -- --port $PORT and other options that can be googled easily.
2019-10-24T23:06:52.707649+00:00 app[web.1]:
2019-10-24T23:07:49.930330+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-24T23:07:49.832843+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-10-24T23:07:49.832843+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-10-24T23:07:49.910127+00:00 heroku[web.1]: Process exited with status 137
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2019-10-24T23:06:52.444262+00:00 app[web.1]: ║ To learn more, checkout https://gatsby.dev/telemetry ║
2019-10-24T23:06:52.444263+00:00 app[web.1]: ║ ║
2019-10-24T23:06:52.444264+00:00 app[web.1]: ╚════════════════════════════════════════════════════════════════════════╝
2019-10-24T23:06:52.445563+00:00 app[web.1]:
2019-10-24T23:06:52.707515+00:00 app[web.1]: [2K[1A[2K[Ginfo gatsby serve running at: http://localhost:4563/
2019-10-24T23:06:52.707649+00:00 app[web.1]:
2019-10-24T23:07:49.930330+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-24T23:07:49.832843+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-10-24T23:07:49.832843+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-10-24T23:07:49.910127+00:00 heroku[web.1]: Process exited with status 137
Any ideas how can I get it working?
You would want to use gatsby build and not gatsby serve as the latter is meant for testing locally. gatsby build will give you static assets and speed optimizations. Try to remove the Procfile and then Heroku should catch the build command in package.json.

Heroku Logs - open log referred to in error message

I'm deploying a node.js app to heroku (cedar stack)
I've set the NODE_ENV like this:
heroku config:add NODE_ENV=production
I then do:
git push heroku
However, after starting (i've got a console.log generating the first log entry) the app crashes.
I run:
heroku logs
and get the below error.
How can I open the /app/log/production.log that it's referring to?
app[web.1]: listening on port 32168 within production environment
app[web.1]:
app[web.1]: events.js:48
app[web.1]: throw arguments[1]; // Unhandled 'error' event
app[web.1]: ^
app[web.1]: Error: ENOENT, open '/app/log/production.log'
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
The error you're getting means that it's trying to open '/app/log/production.log' and is unable to do so. So find out where this logging is being attempted and disable or change it.
According to Heroku you should just be sending your application logs to STDOUT:
https://devcenter.heroku.com/articles/logging
So a console.log should be sufficient.

App works locally, crashes on Heroku - Node.JS

I'm running a simple express app, it is pulling static files from S3, and runs fine locally, but on Heroku it crashes constantly on a warning about permission denied but with no further info.
Is there a way I could find out what is causing the permission error?
Heroku log from deploy to crash:
2011-12-26T22:41:14+00:00 heroku[slugc]: Slug compilation started
2011-12-26T22:41:19+00:00 heroku[api]: Deploy 20d0578 by jeffandersen#gmail.com
2011-12-26T22:41:19+00:00 heroku[api]: Release v20 created by jeffandersen#gmail.com
2011-12-26T22:41:20+00:00 heroku[web.1]: State changed from crashed to created
2011-12-26T22:41:20+00:00 heroku[web.1]: State changed from created to starting
2011-12-26T22:41:21+00:00 heroku[slugc]: Slug compilation finished
2011-12-26T22:41:22+00:00 heroku[web.1]: Starting process with command `node server.js`
2011-12-26T22:41:23+00:00 app[web.1]: info - socket.io started
2011-12-26T22:41:23+00:00 app[web.1]: warn - error raised: Error: EACCES, Permission denied
2011-12-26T22:41:24+00:00 heroku[web.1]: State changed from starting to crashed
2011-12-26T22:41:25+00:00 heroku[web.1]: Process exited
Are you binding the server port to the environment variable injected by Heroku, $PORT?

Error after (seemingly) following the Heroku instructions for Node.js

ANSWER: Don't put a Gemfile into the root of your Node.js project. Heroku get's confused and treats it like a Ruby app.
I am trying to follow the instructions from the Heroku documentation but am receiving an error: "No such file or directory - node web.js".
My Procfile is...
web: node web.js
Foreman runs locally as expected.
Here's a logging snapshot...
2011-07-21T23:28:49+00:00 heroku[web.1]: State changed from starting to crashed
2011-07-21T23:37:50+00:00 heroku[web.1]: State changed from crashed to created
2011-07-21T23:37:50+00:00 heroku[web.1]: State changed from created to starting
2011-07-21T23:37:51+00:00 heroku[web.1]: Starting process with command: `node web.js`
2011-07-21T23:37:51+00:00 app[web.1]: Error: No such file or directory - node web.js
2011-07-21T23:37:52+00:00 heroku[web.1]: Process exited
And my heroku ps output...
Process State Command
------------ ------------------ ------------------------------
web.1 crashed for 8m node web.js
Source is https://github.com/just3ws/hellode
If it didn't run locally I'd move forward and just assume it was only me.
Thanks in advance.
My guess is it's the Gemfile or .rvmrc ;)
http://twitter.com/ryanbriones/status/94212379654631424

Resources