简体   繁体   中英

I am not able to launch my Django app with elastic beanstalk. Receive 500 - Internal Service Error

I am attempting to deploy a simple Django project, using Amazon's guide: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html . However, I am receiving 500 errors, Internal Server Error. I have retrieved the error log, however am struggling to debug. The project runs fine locally.

I've tried:

  • Ensuring my WSGI path is correct
  • Downgrading to Django 2.1.1
  • I've included the EB domain name in ALLOWED_HOSTS

Here is the error log

[Mon Oct 21 20:13:48.477960 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:13:48.477965 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
[Mon Oct 21 20:13:48.477968 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     app_config.import_models()
[Mon Oct 21 20:13:48.477973 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
[Mon Oct 21 20:13:48.477977 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     self.models_module = import_module(models_module_name)
[Mon Oct 21 20:13:48.477981 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Mon Oct 21 20:13:48.477985 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     return _bootstrap._gcd_import(name[level:], package, level)
[Mon Oct 21 20:13:48.477990 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Mon Oct 21 20:13:48.477995 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Mon Oct 21 20:13:48.478000 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Mon Oct 21 20:13:48.478005 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Mon Oct 21 20:13:48.478010 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Mon Oct 21 20:13:48.478015 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Mon Oct 21 20:13:48.478020 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/current/app/projects/models.py", line 6, in <module>
[Mon Oct 21 20:13:48.478023 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     class Project(models.Model):
[Mon Oct 21 20:13:48.478028 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/base.py", line 117, in __new__
[Mon Oct 21 20:13:48.478031 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     new_class.add_to_class('_meta', Options(meta, app_label))
[Mon Oct 21 20:13:48.478036 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/base.py", line 321, in add_to_class
[Mon Oct 21 20:13:48.478039 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     value.contribute_to_class(cls, name)
[Mon Oct 21 20:13:48.478044 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/options.py", line 204, in contribute_to_class
[Mon Oct 21 20:13:48.478047 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Mon Oct 21 20:13:48.478058 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/__init__.py", line 28, in __getattr__
[Mon Oct 21 20:13:48.478062 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     return getattr(connections[DEFAULT_DB_ALIAS], item)
[Mon Oct 21 20:13:48.478067 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/utils.py", line 201, in __getitem__
[Mon Oct 21 20:13:48.478070 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     backend = load_backend(db['ENGINE'])
[Mon Oct 21 20:13:48.478075 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/utils.py", line 110, in load_backend
[Mon Oct 21 20:13:48.478078 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     return import_module('%s.base' % backend_name)
[Mon Oct 21 20:13:48.478083 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Mon Oct 21 20:13:48.478086 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     return _bootstrap._gcd_import(name[level:], package, level)
[Mon Oct 21 20:13:48.478091 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Mon Oct 21 20:13:48.478096 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Mon Oct 21 20:13:48.478101 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Mon Oct 21 20:13:48.478106 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Mon Oct 21 20:13:48.478111 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Mon Oct 21 20:13:48.478116 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Mon Oct 21 20:13:48.478121 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 66, in <module>
[Mon Oct 21 20:13:48.478125 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     check_sqlite_version()
[Mon Oct 21 20:13:48.478130 2019] [:error] [pid 31600] [remote 127.0.0.1:0]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 63, in check_sqlite_version
[Mon Oct 21 20:13:48.478133 2019] [:error] [pid 31600] [remote 127.0.0.1:0]     raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
[Mon Oct 21 20:13:48.478148 2019] [:error] [pid 31600] [remote 127.0.0.1:0] django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
[Mon Oct 21 20:13:49.481612 2019] [:error] [pid 31600] [remote 127.0.0.1:208] mod_wsgi (pid=31600): Target WSGI script '/opt/python/current/app/personal_website/wsgi.py' cannot be loaded as Python module.
[Mon Oct 21 20:13:49.481778 2019] [:error] [pid 31600] [remote 127.0.0.1:208] mod_wsgi (pid=31600): Exception occurred processing WSGI script '/opt/python/current/app/personal_website/wsgi.py'.
[Mon Oct 21 20:13:49.483087 2019] [:error] [pid 31600] [remote 127.0.0.1:208] Traceback (most recent call last):
[Mon Oct 21 20:13:49.483130 2019] [:error] [pid 31600] [remote 127.0.0.1:208]   File "/opt/python/current/app/personal_website/wsgi.py", line 16, in <module>
[Mon Oct 21 20:13:49.483135 2019] [:error] [pid 31600] [remote 127.0.0.1:208]     application = get_wsgi_application()
[Mon Oct 21 20:13:49.483142 2019] [:error] [pid 31600] [remote 127.0.0.1:208]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Oct 21 20:13:49.483145 2019] [:error] [pid 31600] [remote 127.0.0.1:208]     django.setup(set_prefix=False)
[Mon Oct 21 20:13:49.483151 2019] [:error] [pid 31600] [remote 127.0.0.1:208]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Mon Oct 21 20:13:49.483161 2019] [:error] [pid 31600] [remote 127.0.0.1:208]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:13:49.483167 2019] [:error] [pid 31600] [remote 127.0.0.1:208]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
[Mon Oct 21 20:13:49.483170 2019] [:error] [pid 31600] [remote 127.0.0.1:208]     raise RuntimeError("populate() isn't reentrant")
[Mon Oct 21 20:13:49.483187 2019] [:error] [pid 31600] [remote 127.0.0.1:208] RuntimeError: populate() isn't reentrant
[Mon Oct 21 20:13:50.486625 2019] [:error] [pid 31600] [remote 127.0.0.1:212] mod_wsgi (pid=31600): Target WSGI script '/opt/python/current/app/personal_website/wsgi.py' cannot be loaded as Python module.
[Mon Oct 21 20:13:50.486672 2019] [:error] [pid 31600] [remote 127.0.0.1:212] mod_wsgi (pid=31600): Exception occurred processing WSGI script '/opt/python/current/app/personal_website/wsgi.py'.
[Mon Oct 21 20:13:50.486779 2019] [:error] [pid 31600] [remote 127.0.0.1:212] Traceback (most recent call last):
[Mon Oct 21 20:13:50.486812 2019] [:error] [pid 31600] [remote 127.0.0.1:212]   File "/opt/python/current/app/personal_website/wsgi.py", line 16, in <module>
[Mon Oct 21 20:13:50.486817 2019] [:error] [pid 31600] [remote 127.0.0.1:212]     application = get_wsgi_application()
[Mon Oct 21 20:13:50.486824 2019] [:error] [pid 31600] [remote 127.0.0.1:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Oct 21 20:13:50.486827 2019] [:error] [pid 31600] [remote 127.0.0.1:212]     django.setup(set_prefix=False)
[Mon Oct 21 20:13:50.486833 2019] [:error] [pid 31600] [remote 127.0.0.1:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Mon Oct 21 20:13:50.486836 2019] [:error] [pid 31600] [remote 127.0.0.1:212]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:13:50.486842 2019] [:error] [pid 31600] [remote 127.0.0.1:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
[Mon Oct 21 20:13:50.486845 2019] [:error] [pid 31600] [remote 127.0.0.1:212]     raise RuntimeError("populate() isn't reentrant")
[Mon Oct 21 20:13:50.486859 2019] [:error] [pid 31600] [remote 127.0.0.1:212] RuntimeError: populate() isn't reentrant
[Mon Oct 21 20:13:51.489943 2019] [:error] [pid 31600] [remote 127.0.0.1:18644] mod_wsgi (pid=31600): Target WSGI script '/opt/python/current/app/personal_website/wsgi.py' cannot be loaded as Python module.
[Mon Oct 21 20:13:51.489987 2019] [:error] [pid 31600] [remote 127.0.0.1:18644] mod_wsgi (pid=31600): Exception occurred processing WSGI script '/opt/python/current/app/personal_website/wsgi.py'.
[Mon Oct 21 20:13:51.490115 2019] [:error] [pid 31600] [remote 127.0.0.1:18644] Traceback (most recent call last):
[Mon Oct 21 20:13:51.490148 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]   File "/opt/python/current/app/personal_website/wsgi.py", line 16, in <module>
[Mon Oct 21 20:13:51.490153 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]     application = get_wsgi_application()
[Mon Oct 21 20:13:51.490159 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Oct 21 20:13:51.490162 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]     django.setup(set_prefix=False)
[Mon Oct 21 20:13:51.490168 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Mon Oct 21 20:13:51.490171 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:13:51.490177 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
[Mon Oct 21 20:13:51.490189 2019] [:error] [pid 31600] [remote 127.0.0.1:18644]     raise RuntimeError("populate() isn't reentrant")
[Mon Oct 21 20:13:51.490205 2019] [:error] [pid 31600] [remote 127.0.0.1:18644] RuntimeError: populate() isn't reentrant
[Mon Oct 21 20:14:14.607275 2019] [:error] [pid 31600] [remote 172.31.9.41:212] mod_wsgi (pid=31600): Target WSGI script '/opt/python/current/app/personal_website/wsgi.py' cannot be loaded as Python module.
[Mon Oct 21 20:14:14.607342 2019] [:error] [pid 31600] [remote 172.31.9.41:212] mod_wsgi (pid=31600): Exception occurred processing WSGI script '/opt/python/current/app/personal_website/wsgi.py'.
[Mon Oct 21 20:14:14.607446 2019] [:error] [pid 31600] [remote 172.31.9.41:212] Traceback (most recent call last):
[Mon Oct 21 20:14:14.607478 2019] [:error] [pid 31600] [remote 172.31.9.41:212]   File "/opt/python/current/app/personal_website/wsgi.py", line 16, in <module>
[Mon Oct 21 20:14:14.607483 2019] [:error] [pid 31600] [remote 172.31.9.41:212]     application = get_wsgi_application()
[Mon Oct 21 20:14:14.607489 2019] [:error] [pid 31600] [remote 172.31.9.41:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Oct 21 20:14:14.607492 2019] [:error] [pid 31600] [remote 172.31.9.41:212]     django.setup(set_prefix=False)
[Mon Oct 21 20:14:14.607498 2019] [:error] [pid 31600] [remote 172.31.9.41:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Mon Oct 21 20:14:14.607502 2019] [:error] [pid 31600] [remote 172.31.9.41:212]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:14:14.607507 2019] [:error] [pid 31600] [remote 172.31.9.41:212]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
[Mon Oct 21 20:14:14.607510 2019] [:error] [pid 31600] [remote 172.31.9.41:212]     raise RuntimeError("populate() isn't reentrant")
[Mon Oct 21 20:14:14.607524 2019] [:error] [pid 31600] [remote 172.31.9.41:212] RuntimeError: populate() isn't reentrant
[Mon Oct 21 20:14:14.843622 2019] [:error] [pid 31600] [remote 172.31.9.41:18644] mod_wsgi (pid=31600): Target WSGI script '/opt/python/current/app/personal_website/wsgi.py' cannot be loaded as Python module.
[Mon Oct 21 20:14:14.843667 2019] [:error] [pid 31600] [remote 172.31.9.41:18644] mod_wsgi (pid=31600): Exception occurred processing WSGI script '/opt/python/current/app/personal_website/wsgi.py'.
[Mon Oct 21 20:14:14.843772 2019] [:error] [pid 31600] [remote 172.31.9.41:18644] Traceback (most recent call last):
[Mon Oct 21 20:14:14.843804 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]   File "/opt/python/current/app/personal_website/wsgi.py", line 16, in <module>
[Mon Oct 21 20:14:14.843809 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]     application = get_wsgi_application()
[Mon Oct 21 20:14:14.843815 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Mon Oct 21 20:14:14.843818 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]     django.setup(set_prefix=False)
[Mon Oct 21 20:14:14.843823 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Mon Oct 21 20:14:14.843827 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]     apps.populate(settings.INSTALLED_APPS)
[Mon Oct 21 20:14:14.843832 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
[Mon Oct 21 20:14:14.843835 2019] [:error] [pid 31600] [remote 172.31.9.41:18644]     raise RuntimeError("populate() isn't reentrant")
[Mon Oct 21 20:14:14.843850 2019] [:error] [pid 31600] [remote 172.31.9.41:18644] RuntimeError: populate() isn't reentrant

It says it right in the logs: SQLite 3.8.3 or later is required (found 3.7.17) . Did you try updating SQLite in requirements.txt ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM