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

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

Closed
fabi125 opened this issue Jun 22, 2023 · 0 comments · Fixed by #12980
Closed

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

fabi125 opened this issue Jun 22, 2023 · 0 comments · Fixed by #12980
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@fabi125
Copy link
Contributor

fabi125 commented Jun 22, 2023

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

@fabi125 fabi125 added the type: bug A confirmed report of unexpected behavior in the application label Jun 22, 2023
@abhi1693 abhi1693 self-assigned this Jun 22, 2023
@abhi1693 abhi1693 added the status: accepted This issue has been accepted for implementation label Jun 22, 2023
@jeremystretch jeremystretch added the severity: medium Results in substantial degraded or broken functionality for specfic workflows label Jun 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows 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.

3 participants