1

I an trying to host my Django application on Heroku.

My log says "No web processes running", so I tried to scale up my web dynos by running heroku ps:scale web=1. Unfortunately, this gave a new error:

Scaling dynos...! ! Couldn't find that process type (web)

I have defined a web process in my Procfile:

��web :  gunicorn grouppublishingindia.wsgi --log-file -

Here are the runtime logs:

2021-01-29T19:05:21.512000+00:00 heroku[run.6267]: Starting process with command `python manage.py migrate`
2021-01-29T19:05:29.245349+00:00 heroku[run.6267]: Process exited with status 0
2021-01-29T19:05:29.281276+00:00 heroku[run.6267]: State changed from up to complete
2021-01-29T19:12:55.201869+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=1cd6be75-9711-4890-ac37-542c02731f37 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:13:01.315149+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=9cb635ac-f755-437c-9706-b956967f9f32 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:14:17.641461+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=d8ed6b4d-3fe4-4c3a-95d7-fc1a4bc7cd52 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:14:20.774568+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=61570fe1-d1d3-41d0-846d-8f482e9f8bfe fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:16:09.470063+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=19bd2fb7-9739-4a80-b881-759f36c0e5b6 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:16:13.909655+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=321e5a3a-798a-42ce-a9ab-39786097717f fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:25:36.896690+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=13206d28-14c4-4fc1-b57a-2d6b82ab05c9 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:25:38.638019+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=307e0608-6e83-480a-98f5-bf1454408672 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:25:47.279682+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin" host=grouppublishingindia.herokuapp.com request_id=309fce6e-4834-4560-b7e0-3895ccdb90d3 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:25:48.583128+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=a1d0de6a-182e-4aca-83b4-e8ebdee8261f fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:26:09.418186+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin/login" host=grouppublishingindia.herokuapp.com request_id=7f80cab5-bdc8-4097-83b9-12151a53ce48 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:26:10.777570+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=94b74270-ce45-4bdb-9554-1d18278df029 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:28:40.734847+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin/login" host=grouppublishingindia.herokuapp.com request_id=6d20d9fa-e28e-4e1f-8d6d-373d1a4b376c fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:28:42.085017+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=7fc8b4fa-87d9-4e17-9bac-5ecf4f5074be fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:28:56.508972+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=4abf5e65-d489-4012-8f31-c252eba7b52a fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:28:57.316760+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=9a96ef97-5e10-428a-a200-99e5b5a15d97 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:33:52.810241+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=c6d4e435-d6cc-4108-a773-878f3456cd7b fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T19:33:54.091221+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=31539be1-c151-4eed-859b-6dec7af9233c fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
2021-01-29T20:17:16.061323+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=37e1cc44-bb1e-4b13-b4ef-09409de1d34d fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
 2021-01-29T20:17:17.915649+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=eb2cb4a9-6313-431a-a36e-2653f68787ea fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
 2021-01-29T20:40:54.627487+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=070ea498-6e5d-4712-984e-a7d5cbd27105 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
 2021-01-29T20:40:55.709483+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=7631e771-5802-4f2d-8a61-a4b308b2b985 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
 2021-01-29T20:42:53.761946+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=grouppublishingindia.herokuapp.com request_id=33998968-5c6c-48a0-b393-1b4d0d6545a4 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https
 2021-01-29T20:42:54.387231+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=grouppublishingindia.herokuapp.com request_id=ad62faad-3231-4fe8-89e4-2c0188627923 fwd="103.252.25.76" dyno= connect= service= status=503 bytes= protocol=https

And here are my settings, in case they help:

"""
Django settings for grouppublishingindia project.

Generated by 'django-admin startproject' using Django 3.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATE_DIR = os.path.join(BASE_DIR,'templates')

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'grouppublishingindiaoffice@gmail.com'
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')



# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = **************************************

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

ALLOWED_HOSTS = ['grouppublishingindia.herokuapp.com','.grouppublishingindia.com']


# Application definition

INSTALLED_APPS = [

    'django.contrib.auth',
    'Inventory',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'crispy_forms',
    'debug_toolbar',
    'import_export',
    'django.contrib.admin',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware'
]

CRISPY_TEMPLATE_PACK = "bootstrap4"

ROOT_URLCONF = 'grouppublishingindia.urls'


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS':  [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'grouppublishingindia.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    'default':{
       'ENGINE': 'django.db.backends.sqlite3',
       'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
       }
}

import dj_database_url
db_from_env = dj_database_url.config()
DATABASES['default'].update(db_from_env)
#DATABASES['default']['CONN_MAX_AGE'] = 500

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'
LOGIN_REDIRECT_URL = "contenu"

#SMTP (Simple Mail Transfert Protcole) Configuration

CORS_REPLACE_HTTPS_REFERER      = True
HOST_SCHEME                     = "https://"
SECURE_PROXY_SSL_HEADER         = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_SSL_REDIRECT             = True
SESSION_COOKIE_SECURE           = True
CSRF_COOKIE_SECURE              = True
SECURE_HSTS_INCLUDE_SUBDOMAINS  = True
SECURE_HSTS_SECONDS             = 1000000
SECURE_FRAME_DENY               = True
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257

2 Answers2

1

The error states no web process is running (code H14)

There are two possibilities for this issue:

  1. You have scaled down the number of web dynos to 0.

To solve this problem, simply run on your terminal: heroku ps:scale web=1 or heroku ps:scale web=1 -a [name of your heroku app] (if you have multiple apps.

  1. You did not define a web process in your Procfile. You need to define at the root of your Django project a file called Procfile that will describe your web processes and worker processes.

This file should look like this:

release: ./release.sh
web: gunicorn config.wsgi
worker: celery worker --app config.celery.app

In your case, it will probably be as simple as:

web: gunicorn {name-of-your-project}.wsgi

the WSGI.py is a file located within your project folder

Make sure to go through the Django configuration on Heroku documentation as you will need to install the python package for django-heroku and gunicorn.

  • @ Yassine Belmamoun, Thank you for your answer. I will go through what you said and get back to you. :) – AchailletBadigra Jan 30 '21 at 14:33
  • I did what you said but I'm still getting this error: remote: ! Push rejected to grouppublishingindia. remote: To https://git.heroku.com/grouppublishingindia.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/grouppublishingindia.git'. – AchailletBadigra Jan 30 '21 at 15:33
  • @Leo, that's a different problem. It should be asked separately, and it needs a _lot_ more detail. There should be a bunch of other output above that that explains _why_ the build failed. – ChrisGPT was on strike Jan 30 '21 at 17:23
  • @Chris, I'm getting this error: Scaling dynos...! ! Couldn't find that process type (web). what that means – AchailletBadigra Jan 31 '21 at 10:09
0

Your Procfile has some weird encoding:

��web :  gunicorn grouppublishingindia.wsgi --log-file -

Those characters shouldn't be there. Please edit it to contain only

web: gunicorn grouppublishingindia.wsgi --log-file -

then save it with UTF-8 encoding. Commit that change and redeploy.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257