Thanks for using the TrueNAS Community Edition issue tracker! TrueNAS Enterprise users receive direct support for their reports from our support portal.

Give a descriptive message instead of a traceback when offlining the last disk in a pool

Description

Seen in TrueNAS TrueNAS-11.2-INTERNAL-17

I accidentally tried to offline the last disk in a pool. It didn't let me (working as expected) but, instead of a descriptive message, I got the following traceback

Request Method:
POST

Request URL:
http://tn13.lab.ixsystems.com/legacy/storage/zpool-QE_Test/disk/offline/gptid/139ee7a3-91d0-11e9-8f69-00e0ec4efa26/

Software Version:
TrueNAS-11.2-INTERNAL-17 (27284ba9f)

Exception Type:
MiddlewareError

Exception Value:
[MiddlewareError: Disk offline failed: "cannot offline gptid/139ee7a3-91d0-11e9-8f69-00e0ec4efa26: no valid replicas, "]

Exception Location:
./freenasUI/middleware/notifier.py in zfs_offline_disk, line 1074

Server time:
Wed, 19 Jun 2019 10:52:14 -0400

Traceback

Environment:

Software Version: TrueNAS-11.2-INTERNAL-17 (27284ba9f)
Request Method: POST
Request URL: http://tn13.lab.ixsystems.com/legacy/storage/zpool-QE_Test/disk/offline/gptid/139ee7a3-91d0-11e9-8f69-00e0ec4efa26/

Traceback:
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
42. response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
178. response = middleware_method(request, callback, callback_args, callback_kwargs)
File "./freenasUI/freeadmin/middleware.py" in process_view
163. return login_required(view_func)(request, *view_args, **view_kwargs)
File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "./freenasUI/storage/views.py" in disk_offline
656. notifier().zfs_offline_disk(volume, label)
File "./freenasUI/middleware/notifier.py" in zfs_offline_disk
1074. raise MiddlewareError('Disk offline failed: "%s"' % error)

Exception Type: MiddlewareError at /legacy/storage/zpool-QE_Test/disk/offline/gptid/139ee7a3-91d0-11e9-8f69-00e0ec4efa26/
Exception Value: [MiddlewareError: Disk offline failed: "cannot offline gptid/139ee7a3-91d0-11e9-8f69-00e0ec4efa26: no valid replicas, "]

Request information
GET

No GET data
POST

Variable
Value

__form_id
'form_str'

FILES

No FILES data
COOKIES

Variable
Value

fntreeSaveStateCookie
'root'

csrftoken
'********'

sessionid
'lbfrc9meqgpg9x3yta9vt4amw6bo6ia1'

META

Variable
Value

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk June 25, 2019 at 5:47 PM

Complete
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

More fields

Katalon Platform

Created June 19, 2019 at 2:57 PM
Updated July 1, 2022 at 4:35 PM
Resolved November 11, 2019 at 10:12 PM