You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set the value in the days input to a big number (e.g. 123123123) then you will get a 500 error.
You will get different errors based on how big the number is. 123123123 gives an OverflowError with the message date value out of range. while 123123123123 gives an error with the message Python int too large to convert to C int
If there is a logical limit to how big the number should be, then either the form shouldnt allow you to
click Recheck activity until you enter a valid number, or an error should be shown saying something along the lines of Days must be between X and Y after you click the button.
If there shouldnt be a limit on how big the number can be, then it should work the same as it does with a smaller number.
Tracebacks
Environment:
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/source/python/nav/web/ipdevinfo/views.py", line 429, in get_port_view
'activity_interval_start': dt.datetime.now()
Exception Type: OverflowError at /ipdevinfo/uninett-tor-sw1.uninett.no/modules/swportactive/
Exception Value: date value out of range
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/source/python/nav/web/ipdevinfo/views.py", line 430, in get_port_view
- dt.timedelta(days=activity_interval),
Exception Type: OverflowError at /ipdevinfo/uninett-tor-sw1.uninett.no/modules/swportactive/
Exception Value: Python int too large to convert to C int
The text was updated successfully, but these errors were encountered:
stveit
changed the title
[BUG] Giving big number as input for ActivityIntervalForm causes a 500 error
[BUG] Giving big number as input for ActivityIntervalForm causes a 500 error
Nov 25, 2024
Describe the bug
If you set the value in the
days
input to a big number (e.g.123123123
) then you will get a500
error.You will get different errors based on how big the number is.
123123123
gives anOverflowError
with the messagedate value out of range
. while123123123123
gives an error with the messagePython int too large to convert to C int
To Reproduce
Steps to reproduce the behavior
ActivityIntervalForm
, e.g. http://localhost/ipdevinfo/uninett-tor-sw1.uninett.no/modules/swportactive/123123123
into theDays
input boxRecheck activity
Expected behavior
If there is a logical limit to how big the number should be, then either the form shouldnt allow you to
click
Recheck activity
until you enter a valid number, or an error should be shown saying something along the lines ofDays must be between X and Y
after you click the button.If there shouldnt be a limit on how big the number can be, then it should work the same as it does with a smaller number.
Tracebacks
Environment:
The text was updated successfully, but these errors were encountered: