-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Maintenance mode prevents login #14166
Comments
New logins are not allowed while in maintenance mode because all transactions on the DB level are set to READ-ONLY mode. We can set the login path in |
That makes some sense, but it a) sort of defeats the purpose of maintenance mode showing a banner if login is forced and b) becomes impossible to turn it off again without a whole lot of faff if maintenance mode was enabled through a config revision which is stored in the database! Can I put forward the following thinking for discussion and an agreement on the right way to solve this: A) Maintenance mode does not prevent login - it's helpful for users to have RO access during periods of maintenance (ie while admins are migrating the DB to another VM prior to switching over as I was) -or- B) The option to enable maintenance mode is removed from the config revision code so it can only be enabled/disabled via configuration.py and a server restart. -or- C1) If login remains blocked, then this is reflected on the login page with a suitable message. That didn't happen and I just got redirected back to the login page every time I tried to login. C2) Super users remain able to log in so they can disable maintenance mode by deleting the config revision (assuming this isn't RO). Perhaps super users in this context be limited to locally defined super users and not LDAP defined users i.e true low down admins? As it stands, it's too easy (as I've found) to lock yourself out of NetBox and leave yourself no clue as to why you can't log in. It's difficult to solve without observing a subtle error message while running NetBox in its own (not supposed to be used) development server. Most users, I'd suggest, won't ever use the built in server and I only did as I thought it might be nginx redirecting me. I was preparing myself to rollback the upgrade and even that may not have worked because I'd moved the maintenance mode option from a really old configuration.py to a config revision. I'd have ended up trying to restore the VM from backup! There's definitely an issue here that needs fixing somehow. |
NetBox version
v3.6.4
Python version
3.9
Steps to Reproduce
This issue occurred this morning while I was attempting to upgrade my NetBox database from v3.2.8 to v3.6.4. Having fixed the issue, I'm reluctant to try and reproduce it but believe the following set of conditions led to an inability for ANY user, even super users, to log in.
As part of my upgrade plan, I needed to upgrade the underlying OS so I built a whole new VM and installed NetBox v3.6.4.
It appears that enabling maintenance mode in the config revision, prevented any user from logging in.
Expected Behavior
Users should be able to log in even when maintenance mode is enabled.
Observed Behavior
With maintenance mode enabled via a config revision, I was unable to log in at all.
The text was updated successfully, but these errors were encountered: