Open boriskovar-m2ms opened 2 years ago
@boriskovar-m2ms what did you do in the frontend to trigger this bug?
I did this:
Basically the GUI got also stuck so I fixed it in a way the error message in big red is displayed in the dialog header and GUI is no longer frozen. This fix was already deployed together with #742 to staging.
@tdudgeon said in Slack:
I looked at the code and it's probably that this is a coding problem as combined_sdf_file is defined in an if statement and then used later with different if criteria (see https://github.com/xchem/fragalysis-backend/blob/master/viewer/views.py#L2902-L2913)
Indeed, selecting "SDF" breaks this. (I think so does "all ligands in single SDF".)
Agreed - will fix.
when using this data: {"target_name":"PHIPA","proteins":"PHIPA-x10036_0A","pdb_info":false,"bound_info":true,"cif_info":true,"mtz_info":false,"diff_info":false,"event_info":false,"sigmaa_info":false,"sdf_info":true,"single_sdf_file":false,"trans_matrix_info":false,"metadata_info":true,"smiles_info":true,"static_link":false,"file_url":""}
API fails:
Traceback: Environment:
Request Method: POST Request URL: http://fragalysis.xchem.diamond.ac.uk/api/download_structures/
Django Version: 3.1 Python Version: 3.7.3 Installed Applications: ['django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'scoring', 'network', 'viewer', 'api', 'hypothesis', 'hotspots', 'media_serve', 'xchem_db', 'bootstrap3', 'guardian', 'graphene_django', 'django_filters', 'mozilla_django_oidc', 'django_extensions', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_swagger', 'webpack_loader', 'django_cleanup', 'simple_history'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'mozilla_django_oidc.middleware.SessionRefresh']
Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, *kwargs) File "/usr/local/lib/python3.7/dist-packages/rest_framework/viewsets.py", line 114, in view return self.dispatch(request, args, kwargs) File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 505, in dispatch response = self.handle_exception(exc) File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 465, in handle_exception self.raise_uncaught_exception(exc) File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 476, in raise_uncaught_exception raise exc File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 502, in dispatch response = handler(request, *args, **kwargs) File "/code/viewer/views.py", line 3352, in create proteins) File "/code/viewer/views.py", line 3137, in _check_download_links file_url) File "/code/viewer/views.py", line 2913, in _create_structures_zip combined_sdf_file, error_file)
Exception Type: UnboundLocalError at /api/download_structures/ Exception Value: local variable 'combined_sdf_file' referenced before assignment