AttributeError on API - 'OrderedDict' object has no attribute 'register' #3386

Closed
opened 2025-12-29 18:28:37 +01:00 by adam · 2 comments
Owner

Originally created by @sjhloco on GitHub (Feb 24, 2020).

Environment

  • ESX 6.5.0 Update1 (Build 5969303)
  • 1 CPU, 2048 Mem, 32 Gig hdd
  • Ubuntu-18.04.2-desktop
  • Netbox v2.7.7
  • Python 3.7.6

Steps to Reproduce

  1. Build netbox as per attached steps (netbox_build)
  2. Go to root API page http://192.168.10.201/api/ or any other sections API page http://192.168.10.201/api/dcim/

I have done the build several times as per the attached steps and am able to replicate the problem each time. Once installed everything works fine and you can use pynetbox to call the APIs to create objects. It is just when trying to access the API by URL in a browser you have this issue.

error_requirements.txt is the requirements after the fresh build whilst the issue is happening. If I downgrade it to djangorestframework==3.9.4 and restart netbox.service (sudo systemctl restart netbox.service) the problem goes away. See work_requirements.txt for what is changed after downgrading djangorestframework, it is only djangorestframework version. I can flip back and forward between the 2 versions of djangorestframework, it always works with 3.9.4 and does not work with 3.10.3.

Expected Behavior

See API page

Observed Behavior

image
netbox_build.txt
error_requirements.txt
work_requirements.txt

Originally created by @sjhloco on GitHub (Feb 24, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * ESX 6.5.0 Update1 (Build 5969303) * 1 CPU, 2048 Mem, 32 Gig hdd * Ubuntu-18.04.2-desktop * Netbox v2.7.7 * Python 3.7.6 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Build netbox as per attached steps (*netbox_build*) 2. Go to root API page http://192.168.10.201/api/ or any other sections API page http://192.168.10.201/api/dcim/ I have done the build several times as per the attached steps and am able to replicate the problem each time. Once installed everything works fine and you can use pynetbox to call the APIs to create objects. It is just when trying to access the API by URL in a browser you have this issue. *error_requirements.txt* is the requirements after the fresh build whilst the issue is happening. If I downgrade it to *djangorestframework==3.9.4* and restart *netbox.service* (*sudo systemctl restart netbox.service*) the problem goes away. See *work_requirements.txt* for what is changed after downgrading djangorestframework, it is only djangorestframework version. I can flip back and forward between the 2 versions of djangorestframework, it always works with 3.9.4 and does not work with 3.10.3. <!-- What did you expect to happen? --> ### Expected Behavior See API page <!-- What happened instead? --> ### Observed Behavior ![image](https://user-images.githubusercontent.com/33333983/75121587-5c788080-568d-11ea-9256-c76738c8ae51.png) [netbox_build.txt](https://github.com/netbox-community/netbox/files/4242632/netbox_build.txt) [error_requirements.txt](https://github.com/netbox-community/netbox/files/4242663/error_requirements.txt) [work_requirements.txt](https://github.com/netbox-community/netbox/files/4242664/work_requirements.txt)
adam closed this issue 2025-12-29 18:28:38 +01:00
Author
Owner

@hSaria commented on GitHub (Feb 24, 2020):

I couldn't replicate this issue. I'm running djangorestframework v3.10.3.

@hSaria commented on GitHub (Feb 24, 2020): I couldn't replicate this issue. I'm running `djangorestframework` v3.10.3.
Author
Owner

@jeremystretch commented on GitHub (Feb 24, 2020):

We have CI tests in place for these views, and given that the tests are not failing this is likely something related to your specific installation. I suggest deleting your current virtual environment and completely rebuilding it with only the packages from requirements.txt. You can compare the state of your virtual environment to a CI build such as this one to look for any deviations. (Expand the line which reads pip install -r requirements.txt and look for the line beginning with "Successfully installed" to see the list of packages installed by pip for the test.)

I'm going to close this issue as it's not currently replicable, but if you discover something that you believe needs to be changed in NetBox please feel free to comment.

@jeremystretch commented on GitHub (Feb 24, 2020): We have CI tests in place for these views, and given that the tests are not failing this is likely something related to your specific installation. I suggest deleting your current virtual environment and completely rebuilding it with **only** the packages from `requirements.txt`. You can compare the state of your virtual environment to a CI build [such as this one](https://travis-ci.com/netbox-community/netbox/builds/150124650) to look for any deviations. (Expand the line which reads `pip install -r requirements.txt` and look for the line beginning with "Successfully installed" to see the list of packages installed by pip for the test.) I'm going to close this issue as it's not currently replicable, but if you discover something that you believe needs to be changed in NetBox please feel free to comment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3386