Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError (utils.py:159) #369

Open
alanbchristie opened this issue Jan 11, 2023 · 0 comments
Open

ZeroDivisionError (utils.py:159) #369

alanbchristie opened this issue Jan 11, 2023 · 0 comments
Assignees

Comments

@alanbchristie
Copy link
Collaborator

Stumbled on this exception in the backend.log of the Production stack today...

2023-01-11T16:16:34 django.request.log_response():230 ERROR # Internal Server Error: /api/molimg/40925/
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 181, 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 "/usr/local/lib/python3.7/dist-packages/rest_framework/mixins.py", line 56, in retrieve
    return Response(serializer.data)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 562, in data
    ret = super().data
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 260, in data
    self._data = self.to_representation(self.instance)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/serializers.py", line 529, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/usr/local/lib/python3.7/dist-packages/rest_framework/fields.py", line 1905, in to_representation
    return method(value)
  File "/code/viewer/serializers.py", line 304, in get_mol_image
    width=int(float(params["width"])),
  File "/code/api/utils.py", line 159, in draw_mol
    scale_x = width / dim_x
ZeroDivisionError: division by zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant