Issue trying to deploy on Heroku using waitress or gunicorn. /bin/bash: line 1: waitress-serve: command not found

76 Views Asked by At

This is my first time trying to deploy but I keep running into this error. I'm trying to deploy a Django project into Heroku but I get this error /bin/bash: line 1: waitress-serve: command not found

Recently removed my requirements.txt file and updated my pipfile and pipfile.lock. I've reinstalled all my dependancies, committed and pushed them but I keep getting the same error.

Here is the Heroku log

2024-01-25T03:05:40.020168+00:00 heroku[web.1]: State changed from crashed to starting
2024-01-25T03:05:45.036289+00:00 heroku[web.1]: Starting process with command `waitress-serve --port=34599 Website.wsgi:application`
2024-01-25T03:05:45.648621+00:00 app[web.1]: /bin/bash: line 1: waitress-serve: command not found
2024-01-25T03:05:45.722561+00:00 heroku[web.1]: Process exited with status 127
2024-01-25T03:05:45.745857+00:00 heroku[web.1]: State changed from starting to crashed
2024-01-25T03:08:48.965629+00:00 heroku[web.1]: State changed from crashed to starting
2024-01-25T03:08:54.963350+00:00 heroku[web.1]: Starting process with command `waitress-serve --port=52647 Website.wsgi:application`
2024-01-25T03:08:55.529692+00:00 app[web.1]: /bin/bash: line 1: waitress-serve: command not found
2024-01-25T03:08:55.586184+00:00 heroku[web.1]: Process exited with status 127
2024-01-25T03:08:55.607559+00:00 heroku[web.1]: State changed from starting to crashed

Here is my pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "==5.0.1"
django-cors-headers = "==4.3.1"
djoser = "==2.2.2"
djangorestframework = "==3.14.0"
requests = "==2.31.0"
django-heroku = "==0.3.1"
waitress = "==2.1.2"
asgiref = "==3.7.2"
certifi = "==2023.11.17"
cffi = "==1.16.0"
charset-normalizer = "==3.3.2"
cryptography = "==42.0.0"
defusedxml = "==0.8.0rc2"
dj-database-url = "==2.1.0"
django-templated-mail = "==1.1.1"
djangorestframework-simplejwt = "==5.3.1"
idna = "==3.6"
oauthlib = "==3.2.2"
packaging = "==23.2"
psycopg2 = "==2.9.9"
pycparser = "==2.21"
pyjwt = "==2.8.0"
python3-openid = "==3.2.0"
pytz = "==2023.3.post1"
requests-oauthlib = "==1.3.1"
social-auth-app-django = "==5.4.0"
social-auth-core = "==4.5.1"
sqlparse = "==0.4.4"
typing-extensions = "==4.9.0"
tzdata = "==2023.4"
urllib3 = "==2.1.0"
whitenoise = "==6.6.0"

[dev-packages]

[requires]
python_version = "3.12"

Procfile web: waitress-serve --port=$PORT Website.wsgi:application

Deploy Logs

remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)       
remote:
remote:        Resolving node version 20.x...
remote:        Downloading and installing node 20.11.0...
remote:        Using default npm version: 10.2.4
remote:
remote: -----> Restoring cache
remote:        - npm cache
remote:
remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:        rebuilt dependencies successfully
remote:        Installing any new modules (package.json)
remote:
remote:        up to date, audited 44 packages in 465ms
remote:
remote:        3 packages are looking for funding
remote:          run `npm fund` for details
remote:
remote:        found 0 vulnerabilities
remote:
remote: -----> Build
remote:
remote: -----> Caching build
remote:        - npm cache
remote:
remote: -----> Pruning devDependencies
remote:
remote:        up to date, audited 44 packages in 472ms
remote:
remote:        3 packages are looking for funding
remote:          run `npm fund` for details
remote:
remote:        found 0 vulnerabilities
remote:        npm notice
remote:        npm notice New minor version of npm available! 10.2.4 -> 10.4.0
remote:        npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
remote:        npm notice Run `npm install -g [email protected]` to update!
remote:        npm notice
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 130.5M
remote: -----> Launching...
remote:        Released v42
remote:        https://uchennasporfolio-e180324e16c1.herokuapp.com/ deployed to Heroku
remote:
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 91b62dc630283c6ca813293a9a08184a3b5e35d2
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 91b62dc630283c6ca813293a9a08184a3b5e35d2
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version   
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/uchennasporfolio.git
   d92f760..91b62dc  master -> master
0

There are 0 best solutions below