Skip to content

Warnings about "value should be an integer or Decimal instance" after upgrade to 4.4.7 #20888

@MANT5149

Description

@MANT5149

NetBox Edition

NetBox Community

NetBox Version

4.4.7

Python Version

3.11

Steps to Reproduce

  1. Install NetBox 4.4.7
  2. Use pynetbox scripts to query sites and devices
  3. Run sudo systemctl status netbox and observe the following warnings coinciding with the time that the pynetbox scripts are running
Nov 26 08:20:36 netbox gunicorn[742]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:20:36 netbox gunicorn[742]:   warnings.warn("min_value should be an integer or Decimal instance.")

Nov 26 08:25:07 netbox gunicorn[723]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:990: UserWarning: max_value should be an integer or Decimal instance.
Nov 26 08:25:07 netbox gunicorn[723]:   warnings.warn("max_value should be an integer or Decimal instance.")

Nov 26 08:25:07 netbox gunicorn[723]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:25:07 netbox gunicorn[723]:   warnings.warn("min_value should be an integer or Decimal instance.")

Nov 26 08:40:13 netbox gunicorn[720]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:990: UserWarning: max_value should be an integer or Decimal instance.
Nov 26 08:40:13 netbox gunicorn[720]:   warnings.warn("max_value should be an integer or Decimal instance.")

Nov 26 08:40:13 netbox gunicorn[720]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:40:13 netbox gunicorn[720]:   warnings.warn("min_value should be an integer or Decimal instance.")

I believe this is related to the following issue and PR. My research suggests that the values for MinValueValidator, MaxValueValidator may be interpreted as floats rather than decimals.

#20865
#20872

Expected Behavior

No warnings should appear when using pynetbox to query sites and devices

Observed Behavior

Nov 26 08:20:36 netbox gunicorn[742]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:20:36 netbox gunicorn[742]:   warnings.warn("min_value should be an integer or Decimal instance.")

Nov 26 08:25:07 netbox gunicorn[723]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:990: UserWarning: max_value should be an integer or Decimal instance.
Nov 26 08:25:07 netbox gunicorn[723]:   warnings.warn("max_value should be an integer or Decimal instance.")

Nov 26 08:25:07 netbox gunicorn[723]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:25:07 netbox gunicorn[723]:   warnings.warn("min_value should be an integer or Decimal instance.")

Nov 26 08:40:13 netbox gunicorn[720]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:990: UserWarning: max_value should be an integer or Decimal instance.
Nov 26 08:40:13 netbox gunicorn[720]:   warnings.warn("max_value should be an integer or Decimal instance.")

Nov 26 08:40:13 netbox gunicorn[720]: /opt/netbox/venv/lib/python3.11/site-packages/rest_framework/fields.py:992: UserWarning: min_value should be an integer or Decimal instance.
Nov 26 08:40:13 netbox gunicorn[720]:   warnings.warn("min_value should be an integer or Decimal instance.")

Metadata

Metadata

Assignees

Labels

netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions