Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Error after adding an Object Count Widget #303

Closed
maxzapp opened this issue May 15, 2023 · 8 comments · Fixed by #476
Closed

Server Error after adding an Object Count Widget #303

maxzapp opened this issue May 15, 2023 · 8 comments · Fixed by #476
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@maxzapp
Copy link

maxzapp commented May 15, 2023

NetBox version

3.5.1

Topology Views version

3.5.0

Steps to Reproduce

1 create new widget object count
2 add a topology view model

Expected Behavior

A new widget will be generated

Observed Behavior

Server Error occours:
Server Error
There was a problem with your request. Please contact an administrator.

The complete exception is provided below:
<class 'AttributeError'>
'Manager' object has no attribute 'restrict'

Python version: 3.8.10
NetBox version: 3.5.1
If further assistance is required, please post to the NetBox discussion forum on GitHub.

@maxzapp maxzapp added the type: bug A confirmed report of unexpected behavior in the application label May 15, 2023
@dreng
Copy link
Collaborator

dreng commented May 15, 2023

Hi @maxzapp,

I am not able to reproduce this bug as there's no "topology view object". What I see is this:

image

Both of these models do anything, just because it makes no sense at all to expect an object list for this models. But both of them don't give me a server error.

@dreng dreng added the status: revisions needed This issue requires additional information to be actionable label May 15, 2023
@maxzapp
Copy link
Author

maxzapp commented May 15, 2023

Hi, i corrected my description . These modes maybe make no sense but while exploring the new dasboard i added them an run into this error.

@maxzapp
Copy link
Author

maxzapp commented May 16, 2023 via email

@dreng
Copy link
Collaborator

dreng commented May 16, 2023

I can reproduce it now. You could have added to your observed behaviour that you lock yourself out of NetBox when you reproduce the error. For all those who have locked themselves out:

  • Start your venv: source /opt/netbox/venv/bin/activate
  • Start DB Shell: python3 /opt/netbox/netbox/manage.py dbshell
  • Find User IDs with problematic data: select user_id from extras_dashboard where config::text like '%topology%';
  • Delete entry: delete from extras_dashboard where user_id=<USER_ID>;

But the question is what we can do about it. These models are not intended to be listed nor counted. I think it is a stupid solution to add more view classes just to catch an error that should not occur. There should be an option that can be added to models so that the model will not be listed in the dashboard config. If that's the case already, please provide relevant information. If not, the bug should be addressed upstream in my opinion.

@maxzapp
Copy link
Author

maxzapp commented May 16, 2023

Hi,
sorry for not mentioning the workaround i got from netbox team
Open this link worked for me:
http://netbox/extras/dashboard/reset/

I hope no one was testing on production systems, as i did

@dreng
Copy link
Collaborator

dreng commented May 16, 2023

Never mind, nothing bad happened. Your solution is shorter and better of course.

@dreng
Copy link
Collaborator

dreng commented Jun 1, 2023

I asked at netbox-community/netbox#12520 (reply in thread) two weeks ago about adding a parameter to the model in order to tell NetBox to not list NTV in the dashboard config. Unfortunately there hasn't been any reply. I mark this as 'pending closure' since there's nothing we can do about the current behavior, especially not without help from the NetBox Team.

@dreng dreng added pending closure Requires immediate attention to avoid being closed for inactivity and removed status: revisions needed This issue requires additional information to be actionable labels Jun 1, 2023
@dreng
Copy link
Collaborator

dreng commented Jun 4, 2023

As a last resort I opened a feature request in order to be able to hide the problematic models from the widget configuration. See netbox-community/netbox#12810

@dreng dreng added status: blocked Another issue or external requirement is preventing implementation and removed pending closure Requires immediate attention to avoid being closed for inactivity labels Jun 4, 2023
@dreng dreng changed the title Server Error Server Error after adding an Object Count Widget Jun 15, 2023
@dreng dreng added status: accepted This issue has been accepted for implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Apr 1, 2024
@dreng dreng self-assigned this Apr 1, 2024
@dreng dreng closed this as completed in #476 Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants