-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Closed
Copy link
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.5.2
Python version
3.11
Steps to Reproduce
- Have a database that is having some sort of issues.
- Try to update e.g. a device in netbox
Expected Behavior
Error message that contains the db error.
Observed Behavior
Popup saying "NetBox is currently operating in maintenance mode and is unable to perform write operations. Please try again later".
This was introduced as part of #11233, more specifically #12490, which treats all errors as maintenance mode:
netbox/netbox/netbox/middleware.py
Lines 202 to 214 in 70c2b35
| def process_exception(self, request, exception): | |
| """ | |
| Prevent any write-related database operations if an exception is raised. | |
| """ | |
| if isinstance(exception, InternalError): | |
| error_message = 'NetBox is currently operating in maintenance mode and is unable to perform write ' \ | |
| 'operations. Please try again later.' | |
| if is_api_request(request): | |
| return rest_api_server_error(request, error=error_message) | |
| messages.error(request, error_message) | |
| return HttpResponseRedirect(request.path_info) |
I think this should be guarded behind if get_config().MAINTENANCE_MODE:.
stavr666
Metadata
Metadata
Assignees
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application