I have a node.js web app running on a Heroku eco dyno. Eco dynos sleep if not used for 30 minutes. My app has been running on the free dynos for a couple of years without issue, and "upgraded" to eco when Heroku eliminated the free tier. A couple of weeks ago (suspiciously, the first day operating as eco instead of free) when we started work for the day every attempt to access the app returned "Application error". In the Heroku logs there was an H10 "App crashed" message for each access, but nothing else. Clicking "Restart all dynos" on the dashboard cleared the problem. Inconvenient, but problem solved.
Until this morning, exactly two weeks later, when it happened again. Manually restarting the dyno cleared it again. My app doesn't log or report any errors, because it doesn't get started. And the Heroku logs don't appear to contain any useful information.
I've made no changes to the app since the previous kerfuffle two weeks ago; it's been starting fine every morning.
Here's an example error message from logtail (xxx.xxx.xxx.xxx is our IP address):
2022-12-16 13:33:20.653 [exampledyno] router connect= GET exampledyno.herokuapp.com / xxx.xxx.xxx.xxx at=error code=H10 desc="App crashed" method=GET path="/" host=exampledyno.herokuapp.com request_id=[blah] fwd="xxx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes= protocol=https
The last messages in the log prior to this are the normal "Idling" sequence as the dyno goes to sleep:
2022-12-15 22:59:00.585 [exampledyno] web.1 Idling
2022-12-15 22:59:00.587 [exampledyno] web.1 State changed from up to down
2022-12-15 22:59:01.567 [exampledyno] web.1 Stopping all processes with SIGTERM
2022-12-15 22:59:01.764 [exampledyno] web.1 1 Process exited with status 0
Then nothing overnight, until it fails to wake up the next morning.
Now I'd like to figure out what's happening because once is annoying but twice is the beginning of a pattern.
Related
My backend was hosted on heroku for more than a month and was working fine. Now, today when i opened my website it shows this error in heroku logs.
heroku logs
`` 2022-11-26T13:59:37.770793+00:00 heroku[web.1]: Unidling 2022-11-26T13:59:37.773849+00:00
` 2022-11-26T13:59:37.770793+00:00 heroku[web.1]: Unidling 2022-11-26T13:59:37.773849+00:00 heroku[web.1]: State changed from down to starting 2022-11-26T13:`your text`59:40.671794+00:00 heroku[web.1]: Starting process with command `npm start` `2022-11-26T13:59:43.453482+00:00 app\[web.1\]:\`
2022-11-26T13:59:43.453508+00:00 app\[web.1\]: \> server#1.0.0 start
2022-11-26T13:59:43.453508+00:00 app\[web.1\]: \> node index.js
2022-11-26T13:59:43.453509+00:00 app\[web.1\]:
2022-11-26T13:59:43.936570+00:00 app\[web.1\]: Server started successfully on port 28406
2022-11-26T13:59:44.394629+00:00 heroku\[web.1\]: State changed from starting to up
2022-11-26T13:59:45.969634+00:00 app\[web.1\]: MongoDB Connected: ac-rbrrtx1-shard-00-02.hnnmtja.mongodb.net
2022-11-26T13:59:47.331529+00:00 heroku\[router\]: at=info method=GET path="/todos" host=to-do.herokuapp.com request_id=498c9348-ac27-4d03-98c5-ed9650e5b6d3 fwd="74.125.215.152" dyno=web.1 connect=0ms service=2501ms status=200 bytes=770 protocol=https
2022-11-26T14:35:38.862987+00:00 heroku\[web.1\]: Idling
2022-11-26T14:35:38.864646+00:00 heroku\[web.1\]: State changed from up to down
2022-11-26T14:35:39.633081+00:00 heroku\[web.1\]: Stopping all processes with SIGTERM
2022-11-26T14:35:39.834323+00:00 heroku\[web.1\]: Process exited with status 143
2022-12-02T12:31:11.037127+00:00 app\[api\]: Scaled to web#0:Eco by user api-maintenance#heroku.com
2022-12-08T18:34:07.067959+00:00 heroku\[router\]: at=error code=H14 desc="No web processes running" method=GET path="/robots.txt" host=to-do.herokuapp.com request_id=c7c564c9-6334-4140-bf27-6b0750093c26 fwd="5.255.253.147" dyno= connect= service= status=503 bytes= protocol=https\`\`
`
First, I would like to confirm whether you are using free plan of Heroku or not. Because Heroku stopped its free plan starting from November-26-2022.
For further information:
https://make.wordpress.org/plugins/2022/09/13/heroku-free-tier-being-retired/
If you have a paid version then it's a problem associated with dynos as the error is giving code H14 (last line). This is most likely the result of scaling your web dynos down to 0 dynos. Scale up your dynos to fix it.
For more information visit Heroku error codes:
Heroku error codes
I made this project and deployed it on Heroku successfully and it was working, I checked it again two months and it was working properly, but today when I tried to open the website link it says Application error.
Logs are as follows:
2022-12-06T08:17:30.897980+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=limitless-shelf-83830.herokuapp.com request_id=d0c862ec-c21d-4e94-94e5-f6fed3d71af6 fwd="103.141.116.193" dyno= connect= service= status=503 bytes= protocol=https
2022-12-06T08:17:31.345120+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=limitless-shelf-83830.herokuapp.com request_id=a98c5850-0aa3-413d-94d9-4480a218ec3d fwd="103.141.116.193" dyno= connect= service= status=503 bytes= protocol=https
Is this issue from my side or heroku servers are down? What is the cause of this error and what are possible solutions?
I tried running
heroku ps:scale web=1
but it had no use.
Edit: I found the issue, Heroku has stopped offering free plans from 28th Nov 2022, and I deployed it free server.
As you mentioned, Heroku no longer provides free dyno plans.
Although if you have previously deployed apps, you can still access them after subscribing to one of their plans. If you are still experiencing an H14 error, try to reconfigure your dyno. Just change your dyno type to the subscribed plan and make sure you have toggle the selected dyno to the right in order to enable it.
I have a nodejs app that runs on heroku and works fine until it idles(because im on the free plan). After it idles when I try to wake the app up it logs: "App Crashed". This issue is fixed by restarting the app using the cli: heroku restart. However this is not a working solution for the end user. I am using deploy through github and webpack, which I mention because those are the only differences from my other heroku apps which unidle just fine. Is there a way to have the request unidle the app?
Here are the logs:
2022-06-30T17:13:21.294071+00:00 heroku[web.1]: Idling
2022-06-30T17:13:21.308560+00:00 heroku[web.1]: State changed from up to down
2022-06-30T17:13:22.877570+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2022-06-30T17:13:23.113129+00:00 heroku[web.1]: Process exited with status 143
2022-07-02T17:42:20.649030+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fwpsg.herokuapp.com request_id=1f058e06-12e9-4210-a9bc-097ebdce811d fwd="73.247.37.113"
dyno= connect= service= status=503 bytes= protocol=https
I have a Heroku free web app which was working nicely with my initial testing, but with a bigger test it just crashed:
2020-06-17T21:45:10.068131+00:00 app[web.1]: my last console.log message
2020-06-17T21:46:39.334604+00:00 heroku[web.1]: Idling
2020-06-17T21:46:39.336851+00:00 heroku[web.1]: State changed from up to down
2020-06-17T21:46:40.202867+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-06-17T21:46:40.240320+00:00 heroku[router]: at=info method=GET path="/sockjs/432/q7l5m7n6/websocket" host=not-my-real-app.herokuapp.com request_id=ec5f9418-fe2b-4b50-8f92-fb59e315f2ce fwd="CLIENT-IP" dyno=web.1 connect=0ms service=2415813ms status=101 bytes=175 protocol=https
2020-06-17T21:46:40.240323+00:00 heroku[router]: at=info method=GET path="/sockjs/106/0_a5cq0q/websocket" host=not-my-real-app.herokuapp.com request_id=5ca1d1cb-03d4-4107-887b-a206449692c7 fwd="CLIENT-IP" dyno=web.1 connect=0ms service=2321844ms status=101 bytes=175 protocol=https
+12 other similar messages, one per browser window connected
2020-06-17T21:46:40.288644+00:00 heroku[web.1]: Process exited with status 143
2020-06-17T21:46:40.451795+00:00 heroku[web.1]: Unidling
2020-06-17T21:46:40.459070+00:00 heroku[web.1]: Unidling
2020-06-17T21:46:40.464243+00:00 heroku[web.1]: State changed from down to starting
2020-06-17T21:46:40.469937+00:00 heroku[web.1]: Unidling
The logs seem to indicate that the dyno was stopped by Heroku. This was some time into my first test with many (14) simultaneous web clients connections, so it wasn't idle (certainly not for 30 minutes), and I have plenty (989.08) of free dyno hours remaining.
Do you know why my app might have been killed? I could upgrade to a hobby account, but I don't know if that would help.
Or could it be a crash of my application code, despite what the logs seem to show?
Details:
Free web dyno
mLab MongoDB add-on
Region: Europe
Stack: heroku-18
Framework: Node.js
Slug size: 47.2 MiB of 500 MiB
After testing this out many times, I found that Heroku killed my Dyno after 34:41 to 38:25 (mins:secs) from when it was started ("Unidling" to "Idling" messages). According to the documentation, it should only do this for idle Dynos. Each time I was using it throughout the ~35 minutes, ie. open connections, server activity (evidenced by console.log messages in the server log), and client-server traffic.
I switched to a "Hobby" type Dyno, and after that they ran uninterrupted. I just used it for 2 hours without trouble, and have tested it left idle overnight.
I can understand Heroku having a restriction on free apps, but these should be accurately documented. It does not speak well for their reliability as a hosting service that they kill Dynos without explanation or notification (as far as I can see). For me this is an ugly stain on their otherwise excellent service.
I'm trying to get mern app working on heroku. But right now even fixing of node server would be enough.
This is what i have already done.
Created app in heroku and push my project to it.
Added mLab database link. (running properly on local server)
put dev dependencies on the dependencies.
Tried running "heroku run node server.js" through heroku CLI. Then it logs as server started on port 8080.
But I cannot access the API or the web interface.
My app url = http://travelaround.herokuapp.com
Please note my web application was create using create-react-app
My Logs at heroku,
2017-05-14T17:17:50.113754+00:00 heroku[api.1]: Process exited with status 0
2017-05-14T17:17:52.979224+00:00 heroku[api.1]: Starting process with command `nodemon server.js`
2017-05-14T17:17:53.538796+00:00 heroku[api.1]: State changed from starting to up
2017-05-14T17:17:55.154398+00:00 app[api.1]: [33m[nodemon] 1.11.0[39m
2017-05-14T17:17:55.156364+00:00 app[api.1]: [33m[nodemon] to restart at any time, enter `rs`[39m
2017-05-14T17:17:55.156522+00:00 app[api.1]: [33m[nodemon] watching: *.*[39m
2017-05-14T17:17:55.157062+00:00 app[api.1]: [32m[nodemon] starting `node server.js`[39m
2017-05-14T17:17:55.982045+00:00 app[api.1]: Database connection Established at mongodb://test:asd123#ds139791.mlab.com:39791/travelaround
2017-05-14T17:17:56.008148+00:00 app[api.1]: api running on port 3000
2017-05-15T14:22:19.692618+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=travelaround.herokuapp.com request_id=b46a031e-db9d-4cac-93fa-ffd73f51e5f3 fwd="93.65.70.107" dyno= connect= service= status=503 bytes= protocol=http
2017-05-15T14:22:20.297803+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=travelaround.herokuapp.com request_id=9ca4977c-b45e-4f3e-b98a-1034855e8c4f fwd="93.65.70.107" dyno= connect= service= status=503 bytes= protocol=http
Ok, so from the screenshot of your Heroku dashboard and error, it looks like your dynos are not running. I suggest you compile all of your react code, so you only have static content on your frontend, and then turn on the API dyno, so you can actually curl to it from your react code.