Project

General

Profile

Bug #41568

Fix ESERVICESTARTFAILURE traceback

Added by William Grzybowski over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Vladimir Vinogradenko
Category:
Middleware
Target version:
Seen in:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Providing errno to ServiceFailed is unhelpful, user has no clue what 202 means.

First argument should be service name and the second the message.

Also for CIFS specifically it seems the code path is different from generic freeadmin, we should handle that exception more gracefully (JsonResp?).

Aug 14 14:15:52 home uwsgi: [freeadmin.views:210] UI crash exception
Traceback (most recent call last):
  File "./freenasUI/middleware/form.py", line 109, in __save
    return c.call(f"{self.middleware_plugin}.{self._middleware_action}", *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py", line 437, in call
    raise ClientException(c.error, c.errno, c.trace, c.extra)
middlewared.client.client.ClientException: [ESERVICESTARTFAILURE] The cifs service failed to start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/
Aug 14 14:15:52 home uwsgi: base.py", line 178, in _get_response
    response = middleware_method(request, callback, callback_args, callback_kwargs)
  File "./freenasUI/freeadmin/middleware.py", line 163, in process_view
    return login_required(view_func)(request, *view_args, **view_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "./freenasUI/services/views.py", line 212, in services_cifs
    form.save()
  File "./freenasUI/middleware/form.py", line 55, in save
    result = self.__save()
  File "./freenasUI/middleware/form.py", line 114, in __save
    raise
  File "./freenasUI/middleware/form.py", line 112, in __save
    raise ServiceFailed(e.error, e.errno)
freenasUI.services.exceptions.ServiceFailed: 202

https://sentry.ixsystems.com/ixsystems/freenas-middleware/issues/10392/

Acceptance Criteria
Once this is done if a service is running (SMB) and after changing some setting (we can put bugus extra options in it to test) it should gracefully show error message that cifs/smb failed to start.

Associated revisions

Revision b81c36a4 (diff)
Added by Vladimir Vinogradenko over 1 year ago

Pass service name in extra for ESERVICESTARTFAILURE Ticket: #41568

Revision 43364a5f (diff)
Added by Vladimir Vinogradenko over 1 year ago

Properly raise ServiceFailed in MiddlewareModelForm Ticket: #41568

Revision 89b1ee75 (diff)
Added by Vladimir Vinogradenko over 1 year ago

Properly catch ServiceFailed Ticket: #41568

History

#1 Updated by Bug Clerk over 1 year ago

  • Status changed from Unscreened to In Progress

#2 Updated by Bug Clerk over 1 year ago

  • Status changed from In Progress to Ready for Testing

#3 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Unhelpful ServiceFailed exception raised to Fix ESERVICESTARTFAILURE traceback
  • Needs Merging changed from Yes to No

#4 Updated by Dru Lavigne over 1 year ago

  • Needs Doc changed from Yes to No

#5 Updated by Bonnie Follweiler over 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Test Passed in FreeNAS-11.2-MASTER-201809060900

#6 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF