Flask App not Working After Build Succeed - python-3.x

Flask App works fine locally and even succeeded Build.
I just can't understand this error.
Logs:
2021-07-18T10:28:35.000000+00:00 app[api]: Build succeeded
2021-07-18T10:28:42.023914+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=appname.herokuapp.com request_id=24g1h015-2591-4c3e-9887-c6767d50ec51 fwd="116.88.77.105" dyno= connect= service= status=503 bytes= protocol=https
2021-07-18T10:28:42.464216+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=appname.herokuapp.com request_id=50f62645-ac6e-487a-2491-985f9ad6b329 fwd="116.88.77.105" dyno= connect= service= status=503 bytes= protocol=https

You have to open the heroku client and type:
heroku ps:scale web=1
to enable the web dynos.
Or instead declare a procfile in your root directory:
web: gunicorn gettingstarted.wsgi
See more here

Related

Application error while opening URL for app deployed in Heroku

I have deployed my webpage on Heroku, with MongoAtlas for hosting database. The site has been deployed successfully, but on opening the URL it shows the following 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
The logs show this
2020-06-10T10:31:25.558083+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-06-10T10:31:25.676299+00:00 heroku[web.1]: Process exited with status 137
2020-06-10T10:31:25.723593+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-11T04:42:15.117508+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-harbor-74512.herokuapp.com request_id=cd4e6bba-2b33-447a-9b73-da66c77c4946 fwd=
"47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
2020-06-11T04:42:15.971379+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=immense-harbor-74512.herokuapp.com request_id=b5b1c208-bd9e-48b3-9c96-d8b79a
af9123 fwd="47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
2020-06-11T04:42:37.965020+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-harbor-74512.herokuapp.com request_id=52f3dcab-4f12-41cd-96dd-12856fbfb240 fwd=
"47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
What is the problem and how to solve it

Heroku Build Successful but application error in React/Node app

I'm running a React.js/Node.js application on heroku. I have been successfully deploying for a while but after changing the code base yesterday The build is successful and I get an application error. Specigically what I changed in the code base was switching back from SASS to CSS na dadding OAuth to my nodemailer functionality.
I have checked all the environment variables and my port is set to process.env.PORT || 8080
2020-04-23T18:00:39.000000+00:00 app[api]: Build started by user mlisonek98#gmail.com
2020-04-23T18:01:29.044301+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-23T18:01:28.000000+00:00 app[api]: Build succeeded
2020-04-23T18:01:28.310226+00:00 app[api]: Release v109 created by user mlisonek98#gmail.com
2020-04-23T18:01:28.310226+00:00 app[api]: Deploy 8bb6c992 by user mlisonek98#gmail.com
2020-04-23T18:01:36.276828+00:00 app[web.1]:
2020-04-23T18:01:36.276853+00:00 app[web.1]: > badgrey#1.0.0 start /app
2020-04-23T18:01:36.276854+00:00 app[web.1]: > node server
2020-04-23T18:01:36.276854+00:00 app[web.1]:
2020-04-23T18:01:36.971835+00:00 app[web.1]:
2020-04-23T18:02:34.074965+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-23T18:02:35.428955+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=badgrey-dev.herokuapp.com request_id=a08398b4-fa84-4b9c-9365-af9a5f357652 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T18:02:35.774613+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=badgrey-dev.herokuapp.com request_id=d6bea10e-304f-4b1b-be04-33815ffb6c26 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T18:02:37.499473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=badgrey-dev.herokuapp.com request_id=405f4943-a154-47d4-8bb5-0699597e8649 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
I get an h10 error, and there is no other information. This application is running on the heroku free tier. Any suggestions as to why this is happeneing? I would be glad to upoad more code but I'm not sure what I would, especially since everything works locally.
It was the node version, Node released version 14 yesterday or something.

Cannot run my node app on Heroku. I attached the log [duplicate]

This question already has answers here:
Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch)
(38 answers)
Closed 2 years ago.
My node app worked fine when I hosted it in Glitch and DigitalOcean server.
But it doesn't work when I try in Heroku.
Here's the log I get after running heroku logs --tail:
› Warning: heroku update available from 7.35.0 to 7.39.5.
2020-04-24T18:56:56.066168+00:00 app[api]: Initial release by user
cuinjune#gmail.com 2020-04-24T18:56:56.167629+00:00 app[api]: Enable
Logplex by user cuinjune#gmail.com 2020-04-24T18:56:56.167629+00:00
app[api]: Release v2 created by user cuinjune#gmail.com
2020-04-24T18:56:56.066168+00:00 app[api]: Release v1 created by user
cuinjune#gmail.com 2020-04-24T18:57:07.000000+00:00 app[api]: Build
started by user cuinjune#gmail.com 2020-04-24T18:57:25.352788+00:00
app[api]: Deploy 1958e9f7 by user cuinjune#gmail.com
2020-04-24T18:57:25.370743+00:00 app[api]: Scaled to web#1:Free by
user cuinjune#gmail.com 2020-04-24T18:57:25.352788+00:00 app[api]:
Release v3 created by user cuinjune#gmail.com
2020-04-24T18:57:26.000000+00:00 app[api]: Build succeeded
2020-04-24T18:57:30.065364+00:00 app[web.1]:
2020-04-24T18:57:30.065389+00:00 app[web.1]: > battle-square#1.0.0
start /app 2020-04-24T18:57:30.065389+00:00 app[web.1]: > node
index.js 2020-04-24T18:57:30.065390+00:00 app[web.1]:
2020-04-24T18:57:30.206325+00:00 app[web.1]: Server is running
localhost on port: 3000 2020-04-24T18:58:28.351045+00:00
heroku[web.1]: State changed from starting to crashed
2020-04-24T18:58:28.354624+00:00 heroku[web.1]: State changed from
crashed to starting 2020-04-24T18:58:33.378248+00:00 app[web.1]:
2020-04-24T18:58:33.378282+00:00 app[web.1]: > battle-square#1.0.0
start /app 2020-04-24T18:58:33.378283+00:00 app[web.1]: > node
index.js 2020-04-24T18:58:33.378283+00:00 app[web.1]:
2020-04-24T18:58:33.576646+00:00 app[web.1]: Server is running
localhost on port: 3000 2020-04-24T18:58:52.316240+00:00
heroku[router]: at=error code=H20 desc="App boot timeout" method=GET
path="/" host=secure-eyrie-48591.herokuapp.com
request_id=6ee36c25-45d3-4e0a-aae0-c9ddc89e1b69 fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T18:59:31.070175+00:00 heroku[web.1]: State changed from
starting to crashed 2020-04-24T18:59:38.566167+00:00 heroku[router]:
at=error code=H10 desc="App crashed" method=GET path="/"
host=secure-eyrie-48591.herokuapp.com
request_id=55127020-5b19-4154-885f-79287266284a fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T18:59:39.185406+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=secure-eyrie-48591.herokuapp.com
request_id=0f99d119-de28-4e80-a22d-0dab655469f7 fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T19:00:26.640037+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/"
host=secure-eyrie-48591.herokuapp.com
request_id=462f5dd6-c6ee-42d2-9251-50894d822936 fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T19:00:27.065538+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=secure-eyrie-48591.herokuapp.com
request_id=5e8e1903-9520-4c1e-a468-aecb35ba453f fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T19:06:10.144325+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/"
host=secure-eyrie-48591.herokuapp.com
request_id=ca404bc9-b117-42c9-82db-db08862572a8 fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
2020-04-24T19:06:10.679020+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=secure-eyrie-48591.herokuapp.com
request_id=c18910bc-34ad-4ae0-8d88-b1dfbfed00f9 fwd="69.116.190.29"
dyno= connect= service= status=503 bytes= protocol=https
And here's the link to my repo: https://github.com/cuinjune/battle-square
What's the problem and how to fix this?
The cause is in the logs: Server is running localhost on port: 3000.
The app is using port 3000, locally is fine but Heroku gives you a dynamic port upon deployment, therefore you need to bind to this port which is provided through the env variable $PORT

State changed from up to crashed in Heroku

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

Recurring Logentries crash notification on Heroku (NodeJS server)

I've running a NodeJS-based application server on Heroku, and this morning it started crashing repeatedly. It runs one traditional 1x dyno (i.e. the free tier). Heroku takes it down due to idleness, which is fine, but it then gets into a state where I get a crash notification from Logentries every few seconds indefinitely.
I can stop it by taking manually taking the server down to 0 dynos, and then back up to 1.
Note that the very first thing the server does is print a debugging message to console.log, so the fact that I'm not seeing that in the middle of all these crash messages suggests that my app isn't even being run.
Any idea what might be causing this?
02 <45>1 2015-12-05T21:03:30.039646+00:00 heroku web.1 - - Idling
125 <45>1 2015-12-05T21:03:30.040156+00:00 heroku web.1 - - State changed from up to down
131 <45>1 2015-12-05T21:03:34.298780+00:00 heroku web.1 - - Stopping all processes with SIGTERM
301 <158>1 2015-12-05T21:03:35.730386+00:00 heroku router - - at=info method=GET path="/" host=<server name redacted>.herokuapp.com request_id=e3c6cdbf-3012-4e5e-ab89-24e8c2eb0e03 fwd="50.0.151.247" dyno=web.1 connect=0ms service=2085875ms status=101 bytes=189
310 <158>1 2015-12-05T21:03:36.299732+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=35c719d9-5153-49e8-a640-91f848f853b9 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:36.730513+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=138f048e-4229-4e9f-9e56-8d0d9e691734 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
126 <45>1 2015-12-05T21:03:36.690366+00:00 heroku web.1 - - Process exited with status 143
310 <158>1 2015-12-05T21:03:40.160167+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=0a451a1b-04f2-4f59-bc1e-abc1f2599607 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:40.586679+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=c7681cce-f486-447b-9f76-b36a8db3570b fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:44.024709+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=ddd8187f-c8c7-45aa-8add-863b17bdfc5f fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
It turned out that the version of node I was using (4.2.1) was attempting to use more than the 512MB of memory available on a traditional 1x dyno (this is why Node kept crashing before it executed even the first line of my server code). The solution was to modify the Procfile to cap Node's memory usage to fit into the available memory. The Procfile now looks like so:
web: node --optimize_for_size --max_old_space_size=500 --gc_interval=100 server.js
(note that it's 500 rather than 512 out of my habitual desire to be a wee bit conservative).

Resources