Circuit termination API error: Cannot assign "<Provider: IGN>": "CircuitTermination.provider_network" must be a "ProviderNetwork" instance. #4881

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

Originally created by @ghost on GitHub (May 5, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

2.12.2

Python version

3.8

Steps to Reproduce

Via API only POST to /circuits/circuit-terminations/ when using a ProviderNetwork, example:

{
  "circuit": 2,
  "term_side": "Z",
  "provider_network": 1
}

Expected Behavior

HTTP response 201 and the new termination created

Observed Behavior

HTTP response 500

{
    "error": "Cannot assign \"<Provider: IGN>\": \"CircuitTermination.provider_network\" must be a \"ProviderNetwork\" instance.",
    "exception": "ValueError",
    "netbox_version": "2.11.2",
    "python_version": "3.8.8"
}
Originally created by @ghost on GitHub (May 5, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version 2.12.2 ### Python version 3.8 ### Steps to Reproduce Via API only POST to `/circuits/circuit-terminations/` when using a `ProviderNetwork`, example: ```json { "circuit": 2, "term_side": "Z", "provider_network": 1 } ``` ### Expected Behavior HTTP response 201 and the new termination created ### Observed Behavior HTTP response 500 ```json { "error": "Cannot assign \"<Provider: IGN>\": \"CircuitTermination.provider_network\" must be a \"ProviderNetwork\" instance.", "exception": "ValueError", "netbox_version": "2.11.2", "python_version": "3.8.8" } ```
adam added the type: bugstatus: accepted labels 2025-12-29 19:21:37 +01:00
adam closed this issue 2025-12-29 19:21:37 +01:00
Author
Owner

@ghost commented on GitHub (May 5, 2021):

I managed to solve it internally by modifying 9e5d41c48a/netbox/circuits/api/nested_serializers.py (L23)
to

model = ProviderNetwork
@ghost commented on GitHub (May 5, 2021): I managed to solve it internally by modifying https://github.com/netbox-community/netbox/blob/9e5d41c48af5d5b93e1c23973300e524a6e46f2b/netbox/circuits/api/nested_serializers.py#L23 to ```python model = ProviderNetwork ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4881