H14 error upon Django app deployment on Heroku - django

I tried today to deploy my Django app on Heroku.
I first had success and got the message that it is deployed. However upon Heroku open I had a screen informing me that an error occurred and that I should check the logs which look as follows:
2020-05-17T21:01:16.000000+00:00 app[api]: Build succeeded
2020-05-17T21:01:23.528711+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=wsb-project.herokuapp.com request_id=4ea57e57-b230-4d49-99d6-f5f17856b589 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:01:23.897006+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=wsb-project.herokuapp.com request_id=59fc1c4d-330c-4084-8e9e-1a3d7d8ed292 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:09:45.484945+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=wsb-project.herokuapp.com request_id=f1cd7d3d-8781-49b8-80e0-278ca06139ce fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:09:45.885362+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=wsb-project.herokuapp.com request_id=64c1d78c-8e75-47d0-b748-9ffbf239c545 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
Heroku ps tells me that no dynos are on my app.
I tried this tutorial:
and when scaling dynos I was informed that "couldn't find that process type(web)"
So I tried to clear and add the buildpacks again using this link
And still nothing works.
Thanks in advance in any of you know where I could find a solution as I am slowly running out of options here :)
Cheers.
Adding directory:
drwxr-xr-x 1 bapti 197609 0 May 17 14:18 ./
drwxr-xr-x 1 bapti 197609 0 May 16 14:22 ../
drwxr-xr-x 1 bapti 197609 0 May 18 19:09 .git/
-rw-r--r-- 1 bapti 197609 72 May 13 20:29 .gitignore
drwxr-xr-x 1 bapti 197609 0 May 16 14:44 .idea/
-rw-r--r-- 1 bapti 197609 155648 May 17 14:18 db.sqlite3
-rwxr-xr-x 1 bapti 197609 652 Apr 1 14:16 manage.py*
-rw-r--r-- 1 bapti 197609 43 May 15 19:01 Procfile.txt
drwxr-xr-x 1 bapti 197609 0 May 14 22:25 python-getting-started/
drwxr-xr-x 1 bapti 197609 0 May 15 17:46 register/
-rw-r--r-- 1 bapti 197609 301 May 16 11:11 requirements.txt
drwxr-xr-x 1 bapti 197609 0 May 16 13:31 restaurants/
-rw-r--r-- 1 bapti 197609 12 May 15 19:03 runtime.txt
drwxr-xr-x 1 bapti 197609 0 Apr 14 11:45 sent_emails/
drwxr-xr-x 1 bapti 197609 0 May 17 23:33 WSB_website/

This is most likely the result of scaling your web dynos down to 0 dynos. To fix it, scale your web dynos to 1 or more dynos:
heroku ps:scale web=1 or if it asks for an app, heroku ps:scale web=1 -a wsb-project
The Procfile is always a simple text file that is named Procfile without a file extension. For example, Procfile.txt is not valid.
The Procfile must live in your app’s root (main) directory. It does not function if placed anywhere else.
The content of Procfiles can be set up as following,
web: gunicorn blog.wsgi --log-file -

Related

heroku H10 issue

I am geting the Error:
at=error code=H10 desc="App crashed" method=GET path="/" host=quiz-iu.herokuapp.com request_id=9ee6412c-b248-4eeb-8eba-066f07b38a4f
fwd="93.201.118.59" dyno= connect= service= status=503 bytes= protocol=https
2022-12-19T17:47:36.743985+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=quiz-iu.herokuapp.com request_id=071363bb-8ce2-4eed-bdc5-93cd3b39581f fwd="93.201.118.59" dyno= connect= service= status=503 bytes= protocol=https
And if I set into the consul : heroku run rails console,
I get: bash: line 1: rails: command not found
Can someone please help me fix this issue?
A few things to confirm:
Make sure that git is initialized in the same directory where the manage.py file is located.
Make sure that the Procfile is written with the capital P and the rest in small letters, as written in this sentence.
Make sure that the Procfile, requirements.txt, and runtime.txt (if you have one) are in the same directory as the manage.py file.
Copy-paste the following line as it is in your Procfile and replace djangoheroku with the name of your Django project.
web: gunicorn djangoheroku.wsgi --log-file -
Note: Don't forget to replace djangoheroku with the name of your Django project.

Heroku Application Erros Django

I don't understand why this application error. I followed djangogirls-extension deploy tutorial.
here is the output of >heroku logs --tail --app srms-demo command
2019-02-09T02:31:06.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/9822ee2e-0b33-4163-9dd1-5d9897a5b7c7/activity/builds/e01929d2-7a31-45fe-97c3-90eab053a667
2019-02-09T02:47:00.587192+00:00 heroku[run.9364]: State changed from up to complete
2019-02-09T02:50:39.686144+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=srms-demo.herokuapp.com request_id=5859852f-3ae2-47c8-9f6e-3ba05f1c5bbb fwd="43.245.123.100" dyno= connect= service= status=503 bytes= protocol=https
2019-02-09T03:10:39.561398+00:00 heroku[run.2791]: Process exited with status 0
2019-02-09T03:11:20.141798+00:00 heroku[run.6801]: State changed from up to complete
2019-02-09T03:15:30.610720+00:00 heroku[web.1]: State changed from crashed to starting
then is visited error link and found this
-----> Python app detected
! Requested runtime (python-3.7) is not available for this stack (heroku-18).
! Aborting. More info: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed
Update
After changing runtime.txt to python-3.7.1 pushed it on Heroku master
here is the output of heroku logs --tail --app srms-demo command
2019-02-09T02:31:06.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/9822ee2e-0b33-4163-9dd1-5d9897a5b7c7/activity/builds/e01929d2-7a31-45fe-97c3-90eab053a667
2019-02-09T02:47:00.587192+00:00 heroku[run.9364]: State changed from up to complete
2019-02-09T02:50:39.686144+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=srms-demo.herokuapp.com request_id=5859852f-3ae2-47c8-9f6e-3ba05f1c5bbb fwd="43.245.123.100" dyno= connect= service= status=503 bytes= protocol=https
2019-02-09T03:10:39.561398+00:00 heroku[run.2791]: Process exited with status 0
2019-02-09T03:11:20.141798+00:00 heroku[run.6801]: State changed from up to complete
2019-02-09T03:15:30.610720+00:00 heroku[web.1]: State changed from crashed to starting
2019-02-09T06:28:53.311604+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=srms-demo.herokuapp.com request_id=04075507-aa74-4f7b-b303-081b50c4d876 fwd="116.58.205.24" dyno= connect= service= status=503 bytes= protocol=https

Cannot push django app to Heroku

I am trying to deploy a CMS application on Heroku. But when I try
git push heroku master
I am getting the following errors.
Counting objects: 2841, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2775/2775), done.
Writing objects: 100% (2841/2841), 13.35 MiB | 497.00 KiB/s, done.
Total 2841 (delta 917), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.6
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1))
remote: Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1)) (from versions: )
remote: No matching distribution found for pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to peaceful-olympic-84671.
remote:
To https://git.heroku.com/peaceful-olympic-84671.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/peaceful-olympic-84671.git'
I have already seen many answers to this same question on stack overflow but none of the answers is working for me. Please help.
Update: Removing the pkg-resources from requirements.txt helped. But the application isn't being displayed. It says application errors, check your logs for details.
This is my log file in Heroku.
2018-07-04T13:19:20.003057+00:00 heroku[web.1]: Starting process with command `gunicorn zoomtail.wsgi --log-file -`
2018-07-04T13:19:22.351320+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-04T13:19:22.264506+00:00 app[web.1]: bash: gunicorn: command not found
2018-07-04T13:19:22.329998+00:00 heroku[web.1]: Process exited with status 127
2018-07-04T15:49:08.058951+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=b22e6349-7456-4bfe-bb40-7be7b285e027 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:08.609553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=cb458cf7-fd71-4342-a3be-e46f258b6072 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:44.078076+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=a3d03045-0204-44e4-9739-afeaa95eb1d0 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:45.057346+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=dde12264-b1a6-4394-8427-4f431a292a6c fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:52:41.870237+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=95caff68-1fc2-4767-a835-e3e51fb867a8 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:52:42.608603+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=7b5ad55a-8c59-4c92-8480-a9ed11572306 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
I cannot make sense of the error. Please help.
Remove Following line from requirements.txt before push to heroku.
pkg-resources==0.0.0

Docker-compose + Heroku + Django + Gunicorn H14 error

I am getting an H14 Heroku error when trying to deploy my built docker image to heroku.
Since the Heroku documentation says a CMD command is required and it appears that the commands in the Procfile are not actually run I am at a bit of a loss as to what to do.
My heroku error log : `
2017-11-01T11:19:47.714787+00:00 app[globus.1]: Post-processed 'admin/css/forms.css' as 'admin/css/forms.2003a066ae02.css'
2017-11-01T11:19:47.715387+00:00 app[globus.1]:
2017-11-01T11:19:47.715389+00:00 app[globus.1]: 0 static files copied to '/globus/staticfiles', 62 unmodified, 24 post-processed.
2017-11-01T11:20:48.337975+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=kolland-globus-1.herokuapp.com request_id=e2a6eda9-e2bf-477b-9987-b5995d110b0e fwd="2.87.181.37" dyno= connect= service= status=503 bytes= protocol=https
2017-11-01T11:20:48.683132+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=kolland-globus-1.herokuapp.com request_id=eb2e00ee-826a-4ddd-aa22-78e242612e8f fwd="2.87.181.37" dyno= connect= service= status=503 bytes= protocol=https
2017-11-01T11:20:48.766644+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=kolland-globus-1.herokuapp.com request_id=60d645a6-8657-4236-80d9-7a8f8e880640 fwd="2.87.181.37" dyno= connect= service= status=503 bytes= protocol=https
Output of heroku ps:
=== globus (Free): /start.sh (1)
globus.1: up 2017/11/01 13:19:44 +0200 (~ 17m ago)
Heroku Control Panel for the app says:
globus /start.sh
My code is as follows:
1) The start.sh script:
#!/bin/bash
python manage.py migrate # Apply database migrations
python manage.py collectstatic --clear --noinput # clearstatic files
python manage.py collectstatic --noinput # collect static files
# Prepare log files and start outputting logs to stdout
exec gunicorn globus.wsgi --bind 0.0.0.0:$PORT --workers 3
#python manage.py runserver 0.0.0.0:$PORT --settings=globus.settings.production
2) The docker-compose file :
version: '2'
services:
globus:
build: .
image: globus:latest
ports:
- "5000:5000"
env_file: .env
volumes:
- ./globus:/opt/globus
3) Dockerfile:
FROM python:2.7.14
ENV PYTHONUNBUFFERED 1
ADD ./requirements.txt /requirements.txt
ADD ./start.sh /start.sh
ADD . /globus
RUN pip install -r requirements.txt
RUN groupadd -r django && useradd -r -g django django
RUN chown -R django /globus && chmod +x start.sh && chown django start.sh
WORKDIR /globus
CMD ["/start.sh"]
What I've tried ::
CMD [ "python", "./manage.py", "runserver", "0.0.0.0:$PORT", "--settings=globus.settings.production" ]
CMD ["exec", "gunicorn", "globus.wsgi", "-b", "0.0.0.0:$PORT", "--log-file", "-"]
CMD exec gunicorn globus.wsgi -b 0.0.0.0:$PORT --log-file -
CMD ["/start.sh"]
&& ENTRYPOINT ["/start.sh"](without exec gunicorn cmd) + CMD exec gunicorn globus.wsgi -b 0.0.0.0:$PORT
Additionally I've run in the docker-compose file:
command: python manage.py runserver 0.0.0.0:$PORT --settings=globus.settings.production
command: python manage.py makemigrations && python manage.py migrate && python manage.py collectstatic && python manage.py runserver 0.0.0.0:$PORT --settings=globus.settings.production
Notes:
**
Running docker-compose build + up locally works for all aforementioned aproaches provided I change $PORT to 5000.
**
I have a feeling it might have something to do with permissions because I am running docker-compose build + up as root user although am not sure how to change the Dockerfile to avoid that beyond the two lines I have added.
dyno= connect= service= in the error logs I believe means that the app is somehow either crashing or not exposed to the heroku router.
The databse is the Heroku Postgresql Addon and the credentials are stored in an env file. The addon works even if I run docker-compose up on my local machine.
I have a working heroku app that was deployed via git.
When I did an:
heroku run bash
> ls
I could see the file structure
When I do the same on for this app I get nothing
Any help would be greatly appreciated!!!
Result of the Netstat command:
2017-11-01T20:50:11.186705+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [6] [INFO] Starting gunicorn 19.7.1
2017-11-01T20:50:11.187111+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [6] [INFO] Listening at: http://0.0.0.0:18815 (6)
2017-11-01T20:50:11.202914+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [12] [INFO] Booting worker with pid: 12
2017-11-01T20:50:11.187194+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [6] [INFO] Using worker: sync
2017-11-01T20:50:11.192252+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [11] [INFO] Booting worker with pid: 11
2017-11-01T20:50:11.247884+00:00 app[globus.1]: [2017-11-01 20:50:11 +0000] [13] [INFO] Booting worker with pid: 13
2017-11-01T20:50:16.019831+00:00 heroku[globus.1]: Process exited with status 0
2017-11-01T20:50:15.952136+00:00 app[globus.1]: (Not all processes could be identified, non-owned process info
2017-11-01T20:50:15.957398+00:00 app[globus.1]: Active Internet connections (servers and established)
2017-11-01T20:50:15.957400+00:00 app[globus.1]: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
2017-11-01T20:50:15.952156+00:00 app[globus.1]: will not be shown, you would have to be root to see it all.)
2017-11-01T20:50:15.957400+00:00 app[globus.1]: tcp 0 0 0.0.0.0:18815 0.0.0.0:* LISTEN 6/python
2017-11-01T20:50:16.031459+00:00 heroku[globus.1]: State changed from up to crashed
2017-11-01T20:51:19.828010+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=kolland-globus-1.herokuapp.com request_id=59003956-da54-4a6f-921f-70ed4930fc3e fwd="2.87.181.37" dyno= connect= service= status=503 bytes= protocol=https
2017-11-01T20:51:19.652507+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=kolland-globus-1.herokuapp.com request_id=6a090f48-214f-457b-9471-09e2995817fe fwd="2.87.181.37" dyno= connect= service= status=503 bytes= protocol=https

"Internal Server Error" on Heroku in Django/Mezzanine app

I'm deploying my Mezzanine app on heroku, and I think I've finally set most things up.
Now though, every page of my app gives an Internal Server Error, and no logs mention anything error-like at all. Same error on local as well.
The logs from the command 'heroku logs' look like this:
2014-09-03T07:07:52.555930+00:00 heroku[web.1]: Starting process with command `g
unicorn wsgi -b 0.0.0.0:30978 -w 1`
2014-09-03T07:07:53.900072+00:00 heroku[web.1]: State changed from starting to u
p
2014-09-03T07:08:27.706884+00:00 heroku[router]: at=info method=GET path="/" hos
t=sheplusplus.herokuapp.com request_id=70b72520-1094-4ed7-83d7-ff44277c603b fwd=
"98.234.178.149" dyno=web.1 connect=2ms service=5ms status=500 bytes=713
2014-09-03T07:08:29.832027+00:00 heroku[router]: at=info method=GET path="/" hos
t=sheplusplus.herokuapp.com request_id=5a32f20e-5244-4f15-9e4b-dadd6b0fcfbb fwd=
"98.234.178.149" dyno=web.1 connect=2ms service=3ms status=500 bytes=713
2014-09-03T07:08:31.720436+00:00 heroku[router]: at=info method=GET path="/" hos
t=sheplusplus.herokuapp.com request_id=9ed6536a-3bb3-4dd9-904c-b2b3f1db2827 fwd=
"98.234.178.149" dyno=web.1 connect=2ms service=3ms status=500 bytes=713
and the logs from Papertrail look like this:
Sep 03 00:07:48 sheplusplus heroku/web.1: State changed from up to starting
Sep 03 00:07:51 sheplusplus heroku/web.1: Stopping all processes with SIGTERM
Sep 03 00:07:52 sheplusplus heroku/web.1: Process exited with status 0
Sep 03 00:07:52 sheplusplus heroku/web.1: Starting process with command `gunicorn wsgi -b 0.0.0.0:30978 -w 1`
Sep 03 00:07:54 sheplusplus heroku/web.1: State changed from starting to up
Sep 03 00:08:28 sheplusplus heroku/router: at=info method=GET path="/" host=sheplusplus.herokuapp.com request_id=70b72520-1094-4ed7-83d7-ff44277c603b fwd="98.234.178.149" dyno=web.1 connect=2ms service=5ms status=500 bytes=713
Sep 03 00:08:30 sheplusplus heroku/router: at=info method=GET path="/" host=sheplusplus.herokuapp.com request_id=5a32f20e-5244-4f15-9e4b-dadd6b0fcfbb fwd="98.234.178.149" dyno=web.1 connect=2ms service=3ms status=500 bytes=713
Sep 03 00:08:31 sheplusplus heroku/router: at=info method=GET path="/" host=sheplusplus.herokuapp.com request_id=9ed6536a-3bb3-4dd9-904c-b2b3f1db2827 fwd="98.234.178.149" dyno=web.1 connect=2ms service=3ms status=500 bytes=713
My procfile looks like so:
web: gunicorn wsgi -b 0.0.0.0:$PORT -w 1
I have no idea how to begin fixing this because I see absolutely nothing wrong.
locally do:
python manage.py runserver
And watch the output when you load a page. It should expose the error in a clearer message.