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: TypeError at /en-gb/wp4/compare/adverse-organ-autocomplete/ 'bool' object is not callable #319

Closed marshalc closed 6 years ago

marshalc commented 6 years ago

138 ISE's generated over two minutes for the same problem, sample of which is recorded below:

Internal Server Error: /en-gb/wp4/compare/adverse-organ-autocomplete/

TypeError at /en-gb/wp4/compare/adverse-organ-autocomplete/
'bool' object is not callable

Request Method: GET
Request URL: https://cope.nds.ox.ac.uk/en-gb/wp4/compare/adverse-organ-autocomplete/?q=wp
Django Version: 2.0.1
Python Executable: /sites/.virtualenvs/py3_cope/bin/python3
Python Version: 3.5.2
Python Path: ['/sites/py3_cope/cope_repo', '/sites/.virtualenvs/py3_cope/bin', '/sites/py3_cope/cope_repo/${PYTHONPATH}', '/sites/py3_cope/cope_repo', '/sites/.virtualenvs/py3_cope/lib/python35.zip', '/sites/.virtualenvs/py3_cope/lib/python3.5', '/sites/.virtualenvs/py3_cope/lib/python3.5/plat-x86_64-linux-gnu', '/sites/.virtualenvs/py3_cope/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages']
Server time: Sat, 20 Jan 2018 14:31:42 +0000
Installed Applications:
['dal',
'dal_select2',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.admin',
'django.contrib.admindocs',
'crispy_forms',
'reversion',
'reversion_compare',
'wp4.compare',
'wp4.locations',
'wp4.staff',
'wp4.perfusion_machine',
'wp4.health_economics',
'wp4.samples',
'wp4.adverse_event',
'wp4.followups',
'wp4.administration',
'wp4.theme',
'gunicorn']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'reversion.middleware.RevisionMiddleware',
'config.middleware.activate_timezone.TimezoneMiddleware']

Traceback:

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
 35.             response = get_response(request)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
 128.                 response = self.process_exception_by_middleware(e, request)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
 126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3.5/contextlib.py" in inner
 30.                 return func(*args, **kwds)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/views/generic/base.py" in view
 69.             return self.dispatch(request, *args, **kwargs)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/dal/views.py" in dispatch
 48.         return super(ViewMixin, self).dispatch(request, *args, **kwargs)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/views/generic/base.py" in dispatch
 89.         return handler(request, *args, **kwargs)

File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/views/generic/list.py" in get
 142.         self.object_list = self.get_queryset()

File "/sites/py3_cope/cope_repo/wp4/compare/views.py" in get_queryset
 56.         if not self.request.user.is_authenticated():

Exception Type: TypeError at /en-gb/wp4/compare/adverse-organ-autocomplete/
Exception Value: 'bool' object is not callable
Request information:
USER: Fenna van de Leemkolk

GET:
q = 'wp'

POST: No POST data

FILES: No FILES data

COOKIES:
sessionid = 'm6e85provppd08kmg70k0zponl1o05el'
csrftoken = '0SAiq2vNzrI7Gf48BXnAwl2q5PQxr0x0w0VxcoBEWyrR7FeTlUUDQN6OOglWq43G'

META:
CSRF_COOKIE = '0SAiq2vNzrI7Gf48BXnAwl2q5PQxr0x0w0VxcoBEWyrR7FeTlUUDQN6OOglWq43G'
HTTP_ACCEPT = 'application/json, text/javascript, */*; q=0.01'
HTTP_ACCEPT_ENCODING = 'gzip, deflate'
HTTP_ACCEPT_LANGUAGE = 'en-us'
HTTP_CONNECTION = 'close'
HTTP_COOKIE = 'csrftoken=0SAiq2vNzrI7Gf48BXnAwl2q5PQxr0x0w0VxcoBEWyrR7FeTlUUDQN6OOglWq43G; sessionid=m6e85provppd08kmg70k0zponl1o05el'
HTTP_HOST = 'cope.nds.ox.ac.uk'
HTTP_REFERER = 'https://cope.nds.ox.ac.uk/en-gb/wp4/adverse-event/add/'
HTTP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50'
HTTP_X_FORWARDED_FOR = '92.109.80.212'
HTTP_X_FORWARDED_PROTOCOL = 'https'
HTTP_X_REAL_IP = '92.109.80.212'
HTTP_X_REQUESTED_WITH = 'XMLHttpRequest'
HTTP_X_SCHEME = 'https'
PATH_INFO = '/en-gb/wp4/compare/adverse-organ-autocomplete/'
QUERY_STRING = 'q=wp'
RAW_URI = '/en-gb/wp4/compare/adverse-organ-autocomplete/?q=wp'
REMOTE_ADDR = "b''"
REQUEST_METHOD = 'GET'
SCRIPT_NAME = ''
SERVER_NAME = 'cope.nds.ox.ac.uk'
SERVER_PORT = '80'
SERVER_PROTOCOL = 'HTTP/1.0'
SERVER_SOFTWARE = 'gunicorn/19.7.1'
gunicorn.socket = <socket.socket fd=13, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/sites/py3_cope/var/run/wsgi.socket>
wsgi.errors = <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4ff6a56b38>
wsgi.file_wrapper = ''
wsgi.input = <gunicorn.http.body.Body object at 0x7f4ff807cfd0>
wsgi.multiprocess = True
wsgi.multithread = False
wsgi.run_once = False
wsgi.url_scheme = 'http'
wsgi.version = '(1, 0)'

Need to replicate, investigate, and then fix.

marshalc commented 6 years ago

More errors in today, but now we have an error report via email to help narrow this down. See email from SM@14:04.

Solution needs some ordering applied to the models using the DAL.

marshalc commented 6 years ago

Hot patched in the 9.0.0c partial release...

marshalc commented 6 years ago

Merged down through testing to master, and published now.