Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. #11170

Closed
opened 2025-12-29 21:41:18 +01:00 by adam · 5 comments
Owner

Originally created by @suphapongB on GitHub (May 14, 2025).

Originally assigned to: @jnovinger on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.3.0

Python Version

3.12

Steps to Reproduce

  1. Click on "Circuits"
  2. Click on circuit-terminations or via link http://host/circuits/circuit-terminations/
  3. Face error page

Expected Behavior

When navigating to the /circuits/circuit-terminations/ page as any user, the page should load successfully and display the list of circuit terminations without error — regardless of which user is logged in.

Observed Behavior

Image

"Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation."

When I navigate to /circuits/circuit-terminations/, the page throws a server error only for one specific user. If I login using another account, the page works normally without error.

What I Tried

  • Cleared browser cache and session cookies
  • Compared access permissions – both users are staff users with similar roles
  • Reproduced consistently on Docker restart
  • Upgraded to NetBox 4.3.0 – issue still exists
Originally created by @suphapongB on GitHub (May 14, 2025). Originally assigned to: @jnovinger on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.3.0 ### Python Version 3.12 ### Steps to Reproduce 1. Click on "Circuits" 2. Click on circuit-terminations or via link http://host/circuits/circuit-terminations/ 3. Face error page ### Expected Behavior When navigating to the /circuits/circuit-terminations/ page as any user, the page should load successfully and display the list of circuit terminations without error — regardless of which user is logged in. ### Observed Behavior ![Image](https://github.com/user-attachments/assets/c1749422-ad77-49ec-8ac7-5e2c70e67c1d) "Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation." When I navigate to /circuits/circuit-terminations/, the page throws a server error only for one specific user. If I login using another account, the page works normally without error. What I Tried - Cleared browser cache and session cookies - Compared access permissions – both users are staff users with similar roles - Reproduced consistently on Docker restart - Upgraded to NetBox 4.3.0 – issue still exists
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:41:18 +01:00
adam closed this issue 2025-12-29 21:41:18 +01:00
Author
Owner

@jnovinger commented on GitHub (May 14, 2025):

Thank you for opening a bug report. The information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

This certainly feels like the data in your instance got into an unexpected state. However, if we can't come up with clear reproduction steps, I'd suggest we convert this to a Discussion and see if anyone else in the community has any insight.

@jnovinger commented on GitHub (May 14, 2025): Thank you for opening a bug report. The information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports. This certainly feels like the data in your instance got into an unexpected state. However, if we can't come up with clear reproduction steps, I'd suggest we convert this to a Discussion and see if anyone else in the community has any insight.
Author
Owner

@github-actions[bot] commented on GitHub (May 22, 2025):

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 (May 22, 2025): 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.
Author
Owner

@Denis-themenace commented on GitHub (May 28, 2025):

Hi @suphapongB and @jnovinger,
I just ran into the same error but for the "Tunnel Terminations" section.

Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.

Python version: 3.12.3
NetBox version: 4.1.1
Plugins: None installed

Solution:

  • User preferences > Table Configurations > Clear table preferences for the problematic section.

Steps to reproduce (in my case):

  1. Go to > VPN > Tunnel Terminations > Configure table
  2. Add "Tunnel Interface" column > Save
  3. Try to sort table by clicking "Tunnel Interface" column header. ("Try", because it won't work)
  4. Refresh the page

Image

@Denis-themenace commented on GitHub (May 28, 2025): Hi @suphapongB and @jnovinger, I just ran into the same error but for the "Tunnel Terminations" section. `Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.` Python version: 3.12.3 NetBox version: 4.1.1 Plugins: None installed Solution: - User preferences > Table Configurations > Clear table preferences for the problematic section. Steps to reproduce (in my case): 1. Go to > VPN > Tunnel Terminations > Configure table 2. Add "Tunnel Interface" column > Save 3. Try to sort table by clicking "Tunnel Interface" column header. ("Try", because it won't work) 4. Refresh the page ![Image](https://github.com/user-attachments/assets/ebe8f977-8cdf-43b3-9059-322df992fc39)
Author
Owner

@jnovinger commented on GitHub (May 28, 2025):

Thanks for the pointer @Denis-themenace ! It seems like the original is much the same thing, when sorting Circuit Terminations on the 'termination point' field.

STR for the original issue:

  1. Navigate to circuits/circuit-terminations/
  2. Click on the 'Termination Point' column header to sort by that field

Expected behavior:
Data is returned in the table, sorted by the 'Termination Point' column

Actual behavior:
A FieldError is thrown and the view crashes

Exception Type: FieldError at /circuits/circuit-terminations/
Exception Value: Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
@jnovinger commented on GitHub (May 28, 2025): Thanks for the pointer @Denis-themenace ! It seems like the original is much the same thing, when sorting Circuit Terminations on the 'termination point' field. **STR for the original issue:** 1. Navigate to `circuits/circuit-terminations/` 2. Click on the 'Termination Point' column header to sort by that field **Expected behavior:** Data is returned in the table, sorted by the 'Termination Point' column **Actual behavior:** A `FieldError` is thrown and the view crashes ``` Exception Type: FieldError at /circuits/circuit-terminations/ Exception Value: Field 'termination' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation. ```
Author
Owner

@jnovinger commented on GitHub (May 28, 2025):

We should also fix the VPN Termination issue that @Denis-themenace pointed out above and elsewhere.

@jnovinger commented on GitHub (May 28, 2025): We should also fix the VPN Termination issue that @Denis-themenace pointed out above and elsewhere.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11170