Tenant object is not iterable #2073

Closed
opened 2025-12-29 17:22:01 +01:00 by adam · 5 comments
Owner

Originally created by @ntengler on GitHub (Oct 18, 2018).

Environment

  • Python version: 3.6.6
  • NetBox version: 2.4.4

Steps to Reproduce

  1. Post to /api/ipam/ip-addresses/
  2. JSON:
{
	"family":4,
	"address":"10.16.0.15/21",
	"tenant": 1
}

Expected Behavior

I expected the IP to be created assigning the tenant correctly.

Observed Behavior

I received a server error:

The complete exception is provided below:
<class 'TypeError'>
'Tenant' object is not iterable
Originally created by @ntengler on GitHub (Oct 18, 2018). ### Environment * Python version: 3.6.6 * NetBox version: 2.4.4 ### Steps to Reproduce 1. Post to /api/ipam/ip-addresses/ 2. JSON: ``` { "family":4, "address":"10.16.0.15/21", "tenant": 1 } ``` ### Expected Behavior I expected the IP to be created assigning the tenant correctly. ### Observed Behavior I received a server error: ``` The complete exception is provided below: <class 'TypeError'> 'Tenant' object is not iterable ```
adam closed this issue 2025-12-29 17:22:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 22, 2018):

I'm not able to reproduce this behavior on v2.4.6; the IP address is created with the tenant assignment as expected. Please upgrade to v2.4.6 and try again.

@jeremystretch commented on GitHub (Oct 22, 2018): I'm not able to reproduce this behavior on v2.4.6; the IP address is created with the tenant assignment as expected. Please upgrade to v2.4.6 and try again.
Author
Owner

@ntengler commented on GitHub (Oct 31, 2018):

I tried the POST again after updating to 2.4.6 and same behavior. Am I submitting the right JSON to associate our Tenant to this IP?

@ntengler commented on GitHub (Oct 31, 2018): I tried the POST again after updating to 2.4.6 and same behavior. Am I submitting the right JSON to associate our Tenant to this IP?
Author
Owner

@jeremystretch commented on GitHub (Nov 2, 2018):

It sounds like you might have an incorrect version of Django REST Framework installed. You can check by running pip freeze | grep djangorestframework; it should be 3.8.1.

You can install the supported versions of all dependencies by running pip install -r requirements.txt.

@jeremystretch commented on GitHub (Nov 2, 2018): It sounds like you might have an incorrect version of Django REST Framework installed. You can check by running `pip freeze | grep djangorestframework`; it should be 3.8.1. You can install the supported versions of all dependencies by running `pip install -r requirements.txt`.
Author
Owner

@ntengler commented on GitHub (Nov 5, 2018):

That update worked! Thanks for helping out. I can now add the tenant to an IP.

Nate

From: Jeremy Stretch notifications@github.com
Sent: Friday, November 2, 2018 3:09 PM
To: digitalocean/netbox netbox@noreply.github.com
Cc: ntengler nate@tenglerdesigns.com; Author author@noreply.github.com
Subject: Re: [digitalocean/netbox] Tenant object is not iterable (#2527)

It sounds like you might have an incorrect version of Django REST Framework installed. You can check by running pip freeze | grep djangorestframework; it should be 3.8.1.

You can install the supported versions of all dependencies by running pip install -r requirements.txt.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/digitalocean/netbox/issues/2527#issuecomment-435482731 , or mute the thread https://github.com/notifications/unsubscribe-auth/AqObrMI8Z7UWU-tNrpeK6b3CrO3rSjXTks5urKZogaJpZM4XvPSY . https://github.com/notifications/beacon/AqObrG-rlmLXe6pTB75dHGmLOtU5DX96ks5urKZogaJpZM4XvPSY.gif

@ntengler commented on GitHub (Nov 5, 2018): That update worked! Thanks for helping out. I can now add the tenant to an IP. Nate From: Jeremy Stretch <notifications@github.com> Sent: Friday, November 2, 2018 3:09 PM To: digitalocean/netbox <netbox@noreply.github.com> Cc: ntengler <nate@tenglerdesigns.com>; Author <author@noreply.github.com> Subject: Re: [digitalocean/netbox] Tenant object is not iterable (#2527) It sounds like you might have an incorrect version of Django REST Framework installed. You can check by running pip freeze | grep djangorestframework; it should be 3.8.1. You can install the supported versions of all dependencies by running pip install -r requirements.txt. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/digitalocean/netbox/issues/2527#issuecomment-435482731> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AqObrMI8Z7UWU-tNrpeK6b3CrO3rSjXTks5urKZogaJpZM4XvPSY> . <https://github.com/notifications/beacon/AqObrG-rlmLXe6pTB75dHGmLOtU5DX96ks5urKZogaJpZM4XvPSY.gif>
Author
Owner

@SesquipedalianDefenestrator commented on GitHub (Nov 21, 2018):

Just hit this as well, but with TypeError: 'Interface' object is not iterable

This comment is mostly for future searchers: if you get any sort of "not iterable" error, there's a good chance you have the wrong djangorestframework, and it has to be precisely 3.8.1. If you install 3.8.2, everything breaks.

@SesquipedalianDefenestrator commented on GitHub (Nov 21, 2018): Just hit this as well, but with TypeError: 'Interface' object is not iterable This comment is mostly for future searchers: if you get any sort of "not iterable" error, there's a good chance you have the wrong djangorestframework, and it has to be precisely 3.8.1. If you install 3.8.2, everything breaks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2073