Closed TimonZ98 closed 3 months ago
@TimonZ98 Can you please re-check if there is something else going on here, I'm not able to reproduce this. I log out and go to the dashboard and it works fine for me.
@arthanson I've just updated a completely different NetBox instance on another server from version 4.0.10 to version 4.1.0 too (as a test) and the exact same problem occurs there as well. Both NetBox instances were updated from version 4.0.9 to 4.0.10 about 3 days ago. So it shouldn't be a problem with my specific instance or server. As soon as I'm no longer logged in, I get the server error message as descibed. This only affects the start page, because if I open "/dcim/devices/" when I'm not logged in, for example, I'll get correctly redirected to "/login/?next=/dcim/devices/" and see the login form. When I'm logged in, eversthing is fine too, but when the startpage isn't working, every user that is not logged in would have to manually enter the path "/login" to get to the login form and that's not good.
During the update from version 4.0.10 to 4.1.0 using the "upgrade.sh" script (after pulling the new files from Github), everything looked fine so far. There was no exception or anything similar. If I can check any specific files, please let me know. This second NetBox instance, which I've now also updated as a test, is now back on version 4.0.10 (with this version, there is no problem accessing the startpage when not logged in), because I restored a VM snapshot that I've created before the update. So I could run this upgrade again and test something, if that helps
I updated my second NetBox from version 4.0.10 to 4.1.0 again to be able to give you some more information.
Here you can see that the dashboard can be opened without being logged in (of course, no information is actually displayed there because only logged in users should be able to see it):
Now I connected to the server (running Debian 12) and went to the directory "/opt/netbox". There I executed the command "git pull origin master" and then "./upgrade.sh". This was the output of the upgrade script:
After that, I restarted the NetBox services using the command "systemctl restart netbox netbox-rq". This update process is always the same and I've installed every update so far (I'm using both NetBox instances for about 2 years now), e.g. the update from version 4.0.7 to 4.0.8, then from 4.0.8. to 4.0.9, from 4.0.9. to 4.0.10 and now from 4.0.10 to 4.1.0. But after updating to version 4.1.0 the problem occured, so something must have been deleted by the upgrade script or so. Everything works when I'm logged in:
But when I log out or open the NetBox start page in incognito mode (so without any sessions/cookies), the server error is displayed:
During this test, I also noticed that I can still open the start page when I'm not logged in after the update script has run, but I've not yet restarted the services. It looked like this:
And that's exactly how it should look. However, after I have restarted the services, which is necessary, the error occurs as described and shown above. Maybe this information will help
I've now been able to find the cause of this issue through my own further analysis and solve it. It was due to the default dashboard, which I had defined in the configuration file under "/opt/netbox/netbox/netbox/configuration.py":
DEFAULT_DASHBOARD = [
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 4,
'title': 'DCIM',
'color': '',
'config': {
'models': [
'dcim.cable',
'dcim.device',
'dcim.devicetype',
'dcim.location',
'dcim.rack',
'dcim.site'
]
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 4,
'title': 'IPAM',
'color': '',
'config': {
'models': [
'ipam.aggregate',
'ipam.ipaddress',
'ipam.iprange',
'ipam.prefix',
'ipam.vlan',
'ipam.vrf'
]
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 2,
'title': 'Virtualization',
'color': '',
'config': {
'models': [
'virtualization.cluster',
'virtualization.virtualmachine'
]
}
},
{
'widget': 'extras.ObjectListWidget',
'width': 12,
'height': 5,
'title': 'Change Log',
'color': '',
'config': {
'model': 'extras.objectchange',
'page_size': 25
}
}
]
The model "extras.objectchange" was moved from "extras" to "core". So I had to update the line 'model': 'extras.objectchange',
to 'model': 'core.objectchange',
and now everything works.
So it affected both NetBox instances, because I use the same change log widget in the default dashboard defined in the configuration file.
I understand that the upgrade script doesn't take this into account, but it would of course have been practical if such references to the old model, which was moved, were recognized and automatically changed. At least in the configuration file.
In the user specific dashboards (saved in the database table "extras_dashboard"), this seems to have been automatically adjusted by the upgrade script, I suspect, because I didn't change anything manually there and everything worked immediately (including the changelog part)
Short addition: Now I know what was meant by "All UI views & API endpoints associated with change records have been moved from /extras to /core" under "breaking changes". However, when I read this before the update, I didn't realize that the default dashboard in the configuration file would have to be adjusted manually while the dashboard settings in the database are updated automatically
Deployment Type
Self-hosted
NetBox Version
v4.1.0
Python Version
3.11
Steps to Reproduce
Open the NetBox start page/dashboard (NetBox URL without any specific path) when not logged in
Expected Behavior
If only logged-in users should have access (like in my case), the NetBox dashboard should be displayed with the message "No permission to view this content" and lock icons next to the respective menu items
Observed Behavior
A server error is displayed (since upgrading from version 4.0.10 to 4.1.0):
"Server Error
There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'core.models.contenttypes.ObjectType.DoesNotExist'>
ObjectType matching query does not exist.
Python version: 3.11.2 NetBox version: 4.1.0 Plugins: None installed"
The login page under the path "/login" is accessible and a login is still possible. After logging in, the dashboard is displayed correctly.