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

Closed
opened 2025-12-29 21:51:06 +01:00 by adam · 1 comment
Owner

Originally created by @MANT5149 on GitHub (Nov 26, 2025).

Originally assigned to: @jeremystretch on GitHub.

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.

https://github.com/netbox-community/netbox/issues/20865
https://github.com/netbox-community/netbox/pull/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.")
Originally created by @MANT5149 on GitHub (Nov 26, 2025). Originally assigned to: @jeremystretch on GitHub. ### 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. https://github.com/netbox-community/netbox/issues/20865 https://github.com/netbox-community/netbox/pull/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.") ```
adam added the type: bugstatus: acceptednetboxseverity: low labels 2025-12-29 21:51:06 +01:00
adam closed this issue 2025-12-29 21:51:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 26, 2025):

I only observe these warnings when running tests.

@jeremystretch commented on GitHub (Nov 26, 2025): I only observe these warnings when running tests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11875