ouhft / COPE

Project Repository for Work Package 4 of the COPE Transplant Trial
https://cope.nds.ox.ac.uk
1 stars 0 forks source link

ISE: Application won't start on Production #317

Closed marshalc closed 6 years ago

marshalc commented 6 years ago

supervisord keeps showing status of starting as the process survives a second, and then fails. Testing by calling run server results in this error:

python manage.py runserver 0.0.0.0:8000
DEBUG: Loading settings from production
DEBUG: Loading settings from production
Performing system checks...

System check identified no issues (0 silenced).
January 12, 2018 - 16:41:08
Django version 2.0.1, using settings 'config.settings.production'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fafccc22950>
Traceback (most recent call last):
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 141, in inner_run
    handler = self.get_handler(*args, **options)
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
    handler = super().get_handler(*args, **options)
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 66, in get_handler
    return get_internal_wsgi_application()
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 44, in get_internal_wsgi_application
    return import_string(app_path)
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/sites/py3_cope/cope_repo/config/wsgi.py", line 18, in <module>
    application = get_wsgi_application()
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 140, in __init__
    self.load_middleware()
  File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py", line 39, in load_middleware
    mw_instance = middleware(handler)
TypeError: __init__() takes 1 positional argument but 2 were given

Investigating...

marshalc commented 6 years ago

Problem doesn't occur on staging server with the same codebase, so this seems to be unique to the production server... (a bit like the sqlite problem perhaps?)

marshalc commented 6 years ago

Removing some redundant middleware in production has seemingly caused this to disappear. Closing.