question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZeroDivisionError in render function

See original GitHub issue

Hi

I am having an issue with shynet for only one of my accounts. Is there any way to fix this or put it into a try/except? Maybe have a value this expression defaults to if there is an error?

Thank you

shynet_1  | ERROR Internal Server Error: /dashboard/
shynet_1  | Traceback (most recent call last):
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
shynet_1  |     response = get_response(request)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 202, in _get_response
shynet_1  |     response = response.render()
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render
shynet_1  |     self.content = self.rendered_content
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
shynet_1  |     return template.render(context, self._request)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
shynet_1  |     return self.template.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 170, in render
shynet_1  |     return self._render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
shynet_1  |     return self.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render
shynet_1  |     return compiled_parent._render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
shynet_1  |     return self.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
shynet_1  |     result = block.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
shynet_1  |     result = block.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render
shynet_1  |     nodelist.append(node.render_annotated(context))
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 192, in render
shynet_1  |     return template.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 172, in render
shynet_1  |     return self._render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
shynet_1  |     return self.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 516, in render
shynet_1  |     return self.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/library.py", line 234, in render
shynet_1  |     return t.render(new_context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 172, in render
shynet_1  |     return self._render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
shynet_1  |     return self.nodelist.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
shynet_1  |     bit = node.render_annotated(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
shynet_1  |     return self.render(context)
shynet_1  |   File "/usr/local/lib/python3.9/site-packages/django/template/library.py", line 192, in render
shynet_1  |     output = self.func(*resolved_args, **resolved_kwargs)
shynet_1  |   File "/usr/src/shynet/dashboard/templatetags/helpers.py", line 76, in percent_change_display
shynet_1  |     change = int(round(100 * abs(end - start) / start))
shynet_1  | ZeroDivisionError: division by zero

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
zmiguelcommented, Jan 11, 2021

Same issue here, running on docker

0reactions
milesmcccommented, Jan 11, 2021

Cool, got it. I’m going to reopen this issue now so that it stays on my mind to fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid ZeroDivisionError inside a function - Stack Overflow
How is the computer supposed to know what value you want when you divide by zero? Zero division is undefined in general math....
Read more >
ZeroDivisionError: integer division or modulo by zero #2289
curl -u yyy:xxx-i "http://graphite-server/render?target=summarize( ... Its seems that there is a relation to the summarize function.
Read more >
ZeroDivisionError - qgis - GIS Stack Exchange
The issues seems to be that you can't divide by 0 eg. 3.4/0. This link reference "exception ZeroDivisionError" indicates "Raised when the second ......
Read more >
What's the hell... division by zero! Couldn't render!
The super class of ZeroDivisionError is ArithmeticError. This exception raised when the second argument of a division or modulo operation is ...
Read more >
Python error ZeroDivisionError float division by zero - Edureka
In the above line the denominator becomes zero. A float number cannot be devided by zero. In this case the express is divided...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found