Models from plugin not showing up for custom field selection #10355

Closed
opened 2025-12-29 21:30:24 +01:00 by adam · 6 comments
Owner

Originally created by @mraerino on GitHub (Oct 11, 2024).

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.0.11

Python Version

3.11

Steps to Reproduce

First up, i want to say that i'm sadly not able to reproduce this on a fresh installation of Netbox. I'm looking for debugging advice since I'm not able to diagnose why this is happening on our production instance.

  • Install the netbox BGP plugin
  • Open the form to create a new custom field: /extras/custom-fields/add/

Expected Behavior

I expect the models from the BGP plugin to show up in the dropdown for the object types selection. They do on a fresh install.

Observed Behavior

The models from the BGP plugin are missing while I see other models and also models from other plugins. I have opened an issue with them, but i'm not sure anything is wrong with the plugin.

What I'm looking for is advice for how to debug this situation so that it becomes reproducible. Or could this be a configuration problem?

What I've done so far:
I've used the nbshell to dig into the data the object types widget uses.

>>> list(ObjectType.objects.with_feature("custom_fields"))
[ ...
<ObjectType: BGP | routing policy>, <ObjectType: BGP | bgp peer group>, <ObjectType: BGP | community>, <ObjectType: BGP | community list>, <ObjectType: BGP | community list rule>, <ObjectType: BGP | prefix list>, <ObjectType: BGP | prefix list rule>, <ObjectType: BGP | bgp session>, <ObjectType: BGP | routing policy rule>]

Here's a screenshot showing that the BGP models are missing at the place where they should be:
Screenshot 2024-10-11 at 21 45 23

Originally created by @mraerino on GitHub (Oct 11, 2024). ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.0.11 ### Python Version 3.11 ### Steps to Reproduce _First up, i want to say that i'm sadly not able to reproduce this on a fresh installation of Netbox. I'm looking for debugging advice since I'm not able to diagnose why this is happening on our production instance._ - Install the [netbox BGP plugin](https://github.com/netbox-community/netbox-bgp) - Open the form to create a new custom field: `/extras/custom-fields/add/` ### Expected Behavior I expect the models from the BGP plugin to show up in the dropdown for the object types selection. They do on a fresh install. ### Observed Behavior The models from the BGP plugin are missing while I see other models and also models from other plugins. I have opened an [issue with them](https://github.com/netbox-community/netbox-bgp/issues/212), but i'm not sure anything is wrong with the plugin. **What I'm looking for is advice for how to debug this situation so that it becomes reproducible. Or could this be a configuration problem?** What I've done so far: I've used the `nbshell` to dig into the data the object types widget uses. ``` >>> list(ObjectType.objects.with_feature("custom_fields")) [ ... <ObjectType: BGP | routing policy>, <ObjectType: BGP | bgp peer group>, <ObjectType: BGP | community>, <ObjectType: BGP | community list>, <ObjectType: BGP | community list rule>, <ObjectType: BGP | prefix list>, <ObjectType: BGP | prefix list rule>, <ObjectType: BGP | bgp session>, <ObjectType: BGP | routing policy rule>] ``` Here's a screenshot showing that the BGP models are missing at the place where they should be: <img width="813" alt="Screenshot 2024-10-11 at 21 45 23" src="https://github.com/user-attachments/assets/538076d1-0a42-4145-9f28-36edde3fbfd9">
adam added the netbox label 2025-12-29 21:30:24 +01:00
adam closed this issue 2025-12-29 21:30:25 +01:00
Author
Owner

@AliMickey commented on GitHub (Oct 14, 2024):

Just dropping in to say check your permission roles if you have that setup, may need to allow scopes added by the plugin.

@AliMickey commented on GitHub (Oct 14, 2024): Just dropping in to say check your permission roles if you have that setup, may need to allow scopes added by the plugin.
Author
Owner

@mraerino commented on GitHub (Oct 14, 2024):

thanks for the tip. does this also apply to superusers? i haven't set any explicit permissions, just using it as superuser

@mraerino commented on GitHub (Oct 14, 2024): thanks for the tip. does this also apply to superusers? i haven't set any explicit permissions, just using it as superuser
Author
Owner

@AliMickey commented on GitHub (Oct 15, 2024):

It should not apply if you're a superuser I imagine, so most likely a bug then :). Good luck!

@AliMickey commented on GitHub (Oct 15, 2024): It should not apply if you're a superuser I imagine, so most likely a bug then :). Good luck!
Author
Owner

@arthanson commented on GitHub (Oct 15, 2024):

@mraerino can you please open this as a discussion and close this ticket? You will probably get more response as a discussion.

@arthanson commented on GitHub (Oct 15, 2024): @mraerino can you please open this as a discussion and close this ticket? You will probably get more response as a discussion.
Author
Owner

@phlpr commented on GitHub (Oct 15, 2024):

@mraerino I had exactly the same issue with a custom-developed plugin. So, I searched for the error in the source code of our plugin.
After some testing, I noticed that no custom fields from plugins that are loaded after the 'netbox_attachments' plugin are being loaded.
I haven't pinpointed the exact error yet, but if you move 'netbox_attachments' to the last position, the other plugins work fine. Are you also using 'netbox_attachments'?

Netbox: 4.1.3

image

@phlpr commented on GitHub (Oct 15, 2024): @mraerino I had exactly the same issue with a custom-developed plugin. So, I searched for the error in the source code of our plugin. After some testing, I noticed that no custom fields from plugins that are loaded after the 'netbox_attachments' plugin are being loaded. I haven't pinpointed the exact error yet, but if you move 'netbox_attachments' to the last position, the other plugins work fine. Are you also using 'netbox_attachments'? Netbox: 4.1.3 ![image](https://github.com/user-attachments/assets/5c187bc9-4f2e-4a98-bf27-abf2f789d74c)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 23, 2024):

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

@github-actions[bot] commented on GitHub (Oct 23, 2024): This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10355