3

I run my Django project on localhost by 'python manage.py runserver' - it works. I deploy it on Google App Engine - on xxx.appspot.com it print 502 Bad Gateway/by Ngnix and raise followed:

gunicorn.errors.HaltServer:

    Traceback (most recent call last):
  File "/env/bin/gunicorn", line 10, in <module>
    sys.exit(run())
  File "/env/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/env/lib/python3.7/site-packages/gunicorn/app/base.py", line 228, in run
    super().run()
  File "/env/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 229, in run
    self.halt(reason=inst.reason, exit_status=inst.exit_status)
  File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 342, in halt
    self.stop()
  File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 380, in stop
    and not self.cfg.reuse_port
  File "/env/lib/python3.7/site-packages/gunicorn/config.py", line 201, in reuse_port
    @property
  File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
    self.reap_workers()
  File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

Python 37 Django 2.1.14

I`m first time with Django&GAE, pleese help

shulya403
  • 422
  • 1
  • 6
  • 17
  • Are you meeting [application startup requrements](https://cloud.google.com/appengine/docs/standard/python3/runtime#application_startup) or are you using an entrypoint? Also please update your question with app.yaml file. – Emil Gi Apr 02 '20 at 09:41
  • The use of 'entrypoint: gunicorn -b :$PORT main:app' in app.yaml has some chenched situation, but not runs server yet. Now it alrm: "500 Server Error. /Error: Server Error/ The server encountered an error and could not complete your request.' – shulya403 Apr 02 '20 at 15:23
  • WIth default entrypoint you need a "main.py" file in your root directory which exports "app". Check the same file in [this tutorial](https://cloud.google.com/python/django/appengine) for clarification. – Emil Gi Apr 02 '20 at 16:02
  • Also check [this answer](https://stackoverflow.com/a/24550912/12232507) – Emil Gi Apr 02 '20 at 16:04

0 Answers0