TypeError with 3-Phase PDU #11003
Replies: 4 comments 9 replies
-
so what is setting "x" on this line and you work backward through the traceback to find out where that data is coming from? "1" (the letter) and 1 (the number) are two different things, it's getting a string of letters where it expects a number and is trying to divide by it, figuring out what the value it's erroring on and where that's introduced will lead you to the solution, probably.
File "/opt/netbox/netbox/utilities/templatetags/helpers.py", line 131, in divide return round(x / y) TypeError: unsupported operand type(s) for /: 'str' and 'int'
so I would start working your way up the traceback and also just look at the record you were displaying using the API browser /api/ and see if anything looks off, esp around the tags data
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: Ian Underwood ***@***.***>
Sent: Tuesday, November 22, 2022 12:15 PM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] TypeError with one kind of PDU (Discussion #11003)
Here's an odd one that i ran across today.
`<class 'TypeError'>
unsupported operand type(s) for /: 'str' and 'int'
Python version: 3.8.10
NetBox version: 3.3.8`
I am having a problem accessing one particular kind of RPDU that I have defined in my environment. The error that NetBox throws is this:
The trace from the log is this:
Internal Server Error: /dcim/devices/3244/ Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 84, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 90, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 119, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 68, in get return render(request, self.get_template_name(), { File "/opt/netbox/venv/lib/python3.8/site-packages/django/shortcuts.py", line 24, in render content = loader.render_to_string(template_name, context, request, using=using) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 62, in render return self.template.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 175, in render return self._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 322, in render return nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 238, in render nodelist.append(node.render_annotated(context)) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 542, in render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 238, in render nodelist.append(node.render_annotated(context)) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1059, in render output = self.filter_expression.resolve(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 739, in resolve new_obj = func(obj, *arg_vals) File "/opt/netbox/netbox/utilities/templatetags/helpers.py", line 131, in divide return round(x / y) TypeError: unsupported operand type(s) for /: 'str' and 'int'
The problem was originally observed in 3.3.7, and for grins, I upgraded the development environment to 3.3.8. If I create a new PDU with the same device type, I have no problem accessing it.
There were no problems in the upgrade to 3.3.7, or 3.3.4 and 3.3.1 before that.
Where should I look next or grab information from?
—
Reply to this email directly, view it on GitHub<#11003>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM7EWJV2KHYXDOPLE6DWJUET3ANCNFSM6AAAAAASIDS6RU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Secondary note. |
Beta Was this translation helpful? Give feedback.
-
Fixed in 3.3.8 Edit: It is fixed but in the upcomming 3.3.9. |
Beta Was this translation helpful? Give feedback.
-
I'll write this up in the official format tomorrow if that is preferred, but for this thread: To recreate:
Workaround.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's an odd one that i ran across today.
`<class 'TypeError'>
unsupported operand type(s) for /: 'str' and 'int'
Python version: 3.8.10
NetBox version: 3.3.8`
I am having a problem accessing one particular kind of RPDU that I have defined in my environment. The error that NetBox throws is this:
The trace from the log is this:
Internal Server Error: /dcim/devices/3244/ Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 84, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 90, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 119, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 68, in get return render(request, self.get_template_name(), { File "/opt/netbox/venv/lib/python3.8/site-packages/django/shortcuts.py", line 24, in render content = loader.render_to_string(template_name, context, request, using=using) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 62, in render return self.template.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 175, in render return self._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 322, in render return nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 238, in render nodelist.append(node.render_annotated(context)) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 542, in render return self.nodelist.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1000, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 238, in render nodelist.append(node.render_annotated(context)) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 958, in render_annotated return self.render(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 1059, in render output = self.filter_expression.resolve(context) File "/opt/netbox/venv/lib/python3.8/site-packages/django/template/base.py", line 739, in resolve new_obj = func(obj, *arg_vals) File "/opt/netbox/netbox/utilities/templatetags/helpers.py", line 131, in divide return round(x / y) TypeError: unsupported operand type(s) for /: 'str' and 'int'
The problem was originally observed in 3.3.7, and for grins, I upgraded the development environment to 3.3.8. If I create a new PDU with the same device type, I have no problem accessing it.
There were no problems in the upgrade to 3.3.7, or 3.3.4 and 3.3.1 before that.
Where should I look next or grab information from?
Beta Was this translation helpful? Give feedback.
All reactions