Skip to content

All database errors are now being treated as if maintenance mode is enabled #12966

@fabi125

Description

@fabi125

NetBox version

v3.5.2

Python version

3.11

Steps to Reproduce

  1. Have a database that is having some sort of issues.
  2. 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:

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:.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions