I have developed nodejs, socketIO based real time chat application. I have deployed on heroku. Build was successful. After 30-60 seconds, this app will crash every time.
019-11-12T19:39:57.319082+00:00 heroku[router]: at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=LjT06AikcmD9YNWMAAAA" host=ichatbd.herokuapp.com request_id=9e763230-a0c9-4dde-a147-f15ca50f7d67 fwd="103.218.24.238" dyno=web.1 connect=0ms service=21766ms status=101 bytes=183 protocol=https
2019-11-12T19:39:57.327674+00:00 heroku[router]: at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=_RnJVJZCLbuNcLBsAAAC" host=ichatbd.herokuapp.com request_id=7d6c1d10-9968-4b72-ac90-5eb7405ec9bd fwd="103.218.24.238" dyno=web.1 connect=1ms service=18554ms status=101 bytes=175 protocol=https
2019-11-12T19:39:57.382419+00:00 heroku[web.1]: Process exited with status 1
2019-11-12T19:39:57.333853+00:00 heroku[router]: at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=g04ocLYoRLBqkwfTAAAB" host=ichatbd.herokuapp.com request_id=e8f312d2-e337-44ef-88a7-1c255f98a2f4 fwd="175.41.44.170" dyno=web.1 connect=0ms service=21288ms status=101 bytes=175 protocol=https
2019-11-12T19:39:58.398679+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/styles/style.css" host=ichatbd.herokuapp.com request_id=945c9699-1b14-4be0-901e-879dd369e91f fwd="103.218.24.238" dyno=web.1 connect=1ms service= status=503 bytes= protocol=https
2019-11-12T19:39:58.954315+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/socket.io/?EIO=3&transport=polling&t=MvX8Jki" host=ichatbd.herokuapp.com request_id=826c4735-8fd3-4b6f-9f79-f21ef12c0825 fwd="103.218.24.238" dyno= connect= service= status=503 bytes= protocol=https
Cant identify, whats the problem is. After using google, changed on port setup. I have added some code where i just implemented node server.
const express = require('express');
const app = express();
app.set('port', process.env.PORT || 4000);
const server = require('http').Server(app);
const io = require('socket.io')(server);
const port = app.get('port');
So, can anybody help me to identify & solve this problem.
Thanks in advance
you can share us file where you are implementing io.connect.
I believe that you have a bug in somewhere of your code. also you can share us all logs of heroku with heroku cli you can see them eg. heroku logs app xxxxxx(nameapp in heroku)
Related
I'm working on an app that basically retrieves data from mongoDB, performs some basic sorting/math, then post the results for the users.
I'm getting H12 errors from Heroku sporadically - seems like some queries are taking more than 30 seconds. I have not been able to replicate this problem once I restart the dyno.
Is there a way to build a middleware to ping the server/client if the request is taking more than 15 seconds to fulfill? or some other way to mitigate this other than crashing the whole application?
First time builder here so appreciate any help. Thanks.
I'm using NodeJS, Express Routers, and Heroku (Hobby Dyno) to host the application. Runs fine until recently, the application has been crashing on Heroku:
2022-08-23T14:05:25.673220+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/index?customerType=Buyer&town=&zipcode=01235" host=www.agentometer.com request_id=6350ff01-69ed-4c4b-b958-d880b5ceef73 fwd="98.216.185.71" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2022-08-23T14:06:34.759586+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/index?customerType=Buyer&town=Boston&zipcode=" host=www.agentometer.com request_id=da8df716-44c9-4c5b-8db6-96d11d299302 fwd="98.216.185.71" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2022-08-23T14:26:10.643969+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=www.agentometer.com request_id=c7a9472d-5a7a-4250-83f7-827b4416019e fwd="108.26.205.219" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2022-08-23T14:26:12.036207+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=www.agentometer.com request_id=13978436-5a55-4c41-ad60-2416fd0e853c fwd="108.26.205.219" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
I am deploying an app to node.js mongodb-Atlas hosted Heroku app and after deploying it, it started to crash. here is the log of the incident:
2019-11-07T14:03:44.54763+00:00 app[web.1]:
2019-11-07T14:03:44.547905+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-11-07T14:03:44.548078+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-07T14_03_43_920Z-debug.log
2019-11-07T14:03:44.609666+00:00 heroku[web.1]: Process exited with status 1
2019-11-07T14:03:44.660116+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-07T14:08:46.771752+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=flix-app-test.herokuapp.com request_id=14978e4f-fb93-44c8-a6c1-294a6a254e1e fwd="84.17.61.226" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:08:47.381666+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=flix-app-test.herokuapp.com request_id=b067c4c5-8b09-44c7-907e-bb2010dd97ec fwd="84.17.61.226" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:15:51.61258+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=flix-app-test.herokuapp.com request_id=5290a4ea-94b1-4d79-a8fe-6709e6cb2a15 fwd="91.168.132.252" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:15:52.254787+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=flix-app-test.herokuapp.com request_id=41f76767-00c8-490c-9c13-22c0906fedb9 fwd="91.168.132.252" dyno= connect= service= status=503 bytes= protocol=https
Most posts I found regarding this H10 error point to an issue on the lines that define the port which through Heroku listens, that it does not accept a rigid one, but the listening of the app is done by this code:
var port = process.env.PORT || 3000;
app.listen(port, "0.0.0.0", function() {
console.log('Listening on Heroku defined port');
});
The code is working locally (double checked), but the Heroku app does not even loads. Databases are running and available and I could find no visible problem.
I'd like to know how should I proceed to find out which part of the code is broken OR to find out that it's a Heroku temporarily issue.
Thanks in advance.
If you are using ExpressJS, just do:
var port = process.env.PORT;
Promise.resolve(app.listen(port)).then(() => {
console.log("Running!");
});
Anyways, 503 is Service Unavailable HTTP code. If the above code does not work, please post your router and controller code for the errored routes.
I am getting the following error on Heroku logs:
2018-10-29T00:48:34.198959+00:00 heroku[reminder.1]: State changed from up to crashed
2018-10-29T00:48:59.855673+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=promo-reminder.herokuapp.com request_id=253b5e26-384e-4b02-b65c-51342fb46a4e fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:49:01.143244+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=promo-reminder.herokuapp.com request_id=b1b8cb23-01d8-4f59-ac42-a98f28cb9c10 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:56:23.879027+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=promo-reminder.herokuapp.com request_id=00c30077-8e31-4fea-a700-f7fffd45e446 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:56:25.162371+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=promo-reminder.herokuapp.com request_id=1684c085-7c4a-4f90-beed-a6667c60ab88 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
my Procfile is:
reminder: python src/quickstart.py
Heroku web page shows:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
Only the web process type on Heroku will allow you to receive HTTP requests.
You need to replace your Procfile:
reminder: python src/quickstart.py
Then, start a web dyno:
heroku ps:scale web=1
See https://devcenter.heroku.com/articles/dynos#dyno-configurations
I've tried everything I can think of and exhausted google searches. I've already ruled out the most common problems (ex: not using process.env.PORT in app.listen).
Here are the heroku logs:
2018-07-18T02:43:26.705491+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=limitless-river-42936.herokuapp.com request_id=78261d20-9656-4f24-9a50-6a8e90fe216f fwd="104.32.39.36" dyno= connect= service= status=503 bytes= protocol=https
2018-07-18T02:43:28.104845+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=limitless-river-42936.herokuapp.com request_id=dab234a8-b9d7-4bbe-aa2b-36e6c4b2fcc9 fwd="104.32.39.36" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
And here is the server.js file
Any help would be greatly appreciated!
It turns out the log files weren't showing all the errors for some reason -- there was a typo in one of my imports. :)
I keep getting error code=H10 randomly when I start my Heroku app. Sometimes the app starts, sometimes it doesn't.
My app is built with NodeJS, Express, MySQL and JawsDB.
Here's the details in my app's log:
2017-11-26T15:21:36.906937+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<my app name>.herokuapp.com request_id=4c63d70d-f081-44a5-b4fe-f0992116ba79 fwd="108.28.184.177" dyno= connect= service= status=503 bytes= protocol=https
2017-11-26T15:21:36.954063+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=<my app name>.herokuapp.com request_id=e42d6293-512f-4ea1-ba35-403f44e4fd9a fwd="108.28.184.177" dyno= connect= service= status=503 bytes= protocol=https
I've looked online and added favicon.ico in my public folder. Nothing changes. I've had this problem before with my previous app and I ran heroku restart and it works for that one, but doesn't for this one.