Project

General

Profile

Bug #25246

Use middleware to wipe disks on volume creation

Added by Andrew . almost 2 years ago. Updated 11 months ago.

Status:
Done
Priority:
Nice to have
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Seen in:
Severity:
New
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

After rebooting FreeNAS I tried again to create a volume and got a pop-up window within the GUI.

Window Title: Volume Manager
Window Body:

Request Method: POST
Request URL: http://topolhnas01mg.local./storage/volumemanager/
Software Version: FreeNAS-11.0-U1 (aa82cc58d)
Exception Type: MiddlewareError
Exception Value:

[MiddlewareError: b'Unable to GPT format the disk "da3": gpart: geom \'da3\': Operation not permitted\n']

Exception Location: ./freenasUI/middleware/notifier.py in __gpt_labeldisk, line 409
Server time: Thu, 20 Jul 2017 16:39:41 0400
Traceback
----

Environment:

Software Version: FreeNAS-11.0-U1 (aa82cc58d)
Request Method: POST
Request URL: http://topolhnas01mg.local./storage/volumemanager/

Traceback:
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
39. 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
162. 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 volumemanager
157. if form.is_valid() and form.save():
File "./freenasUI/storage/forms.py" in save
290. init_rand=init_rand,
File "./freenasUI/middleware/notifier.py" in init
238. f(objectid, *args, **kwargs)
File "./freenasUI/middleware/notifier.py" in _init_volume
1057. self.
_create_zfs_volume(volume, swapsize, kwargs.pop('groups', False), kwargs.pop('path', None), init_rand=kwargs.pop('init_rand', False))
File "./freenasUI/middleware/notifier.py" in _create_zfs_volume
802. vdevs = self.
_prepare_zfs_vdev(vgrp['disks'], vdev_swapsize, encrypt, volume)
File "./freenasUI/middleware/notifier.py" in __prepare_zfs_vdev
738. swapsize=swapsize)
File "./freenasUI/middleware/notifier.py" in __gpt_labeldisk
409. raise MiddlewareError(f'Unable to GPT format the disk "{devname}": {error}')

Exception Type: MiddlewareError at /storage/volumemanager/
Exception Value: [MiddlewareError: b'Unable to GPT format the disk "da3": gpart: geom \'da3\': Operation not permitted\n']
-----

Request information
GET

No GET data
POST
Variable Value
all ''
volume_name 'iSCSI_Volume02'
layout-__all__ ''
layout-TOTAL_FORMS '1'
layout-INITIAL_FORMS '0'
layout-0-vdevtype 'stripe'
layout-0-disks 'da3'
__form_id 'dijit_form_Form_1'
FILES

No FILES data
COOKIES
Variable Value
csrftoken '7VTOnl5Rwpm6ko2TQHga8Tp90b9fTlrqu7JzXc9SSVz4WgZBIjCjxJiF8Os30HSy'
fntreeSaveStateCookie 'root'
sessionid 'zb7zz1c9uyah575p7qnliw19bbd4152v'
META
Variable Value


Related issues

Related to FreeNAS - Bug #25245: Unable to create volumeClosed: User Config Issue2017-07-20
Related to FreeNAS - Bug #31203: Unable to wipe diskClosed2018-04-03
Related to FreeNAS - Bug #31275: "Error deleting pool" when attempting to wipe the lot in new UI (fails)Closed2018-04-03
Related to FreeNAS - Bug #29617: Unable to wipe disksClosed2018-03-12
Has duplicate FreeNAS - Bug #28096: Unable to GPT format the disk "nvd0": gpart: geom 'nvd0': File existsClosed

Associated revisions

Revision 163bb68d (diff)
Added by William Grzybowski about 1 year ago

fix(gui): use middleware to wipe disks on volume creation

Also do not blow up an exception to user face if a disk format fails.

Ticket: #25246

Revision 47d554d3 (diff)
Added by William Grzybowski about 1 year ago

fix(gui): use middleware to wipe disks on volume creation

Also do not blow up an exception to user face if a disk format fails.

Ticket: #25246

History

#1 Updated by Andrew . almost 2 years ago

  • File debug-topolhnas01mg-20170720170845.txz added

#2 Updated by Andrew . almost 2 years ago

  • File 2017-07-20_bug_after_reboot.txt added

#3 Updated by Andrew . almost 2 years ago

After removing and recreating the HDD (this is on a virtual machine on ESXi 6.5) I was able to successfully create a volume.

#4 Updated by Dru Lavigne almost 2 years ago

  • Related to Bug #25245: Unable to create volume added

#5 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Unscreened to Closed: User Config Issue

#6 Updated by Andrew . almost 2 years ago

I should have been more clear about the problem (my bad). The issue was about the seemingly ungraceful manor in which the GUI handled the error condition and that the disk wipe feature didn't make the symptom go away. There was no data on the device(s) at the time.

The pop-up window seemed to include a lot of extraneous information rather than simply giving the error message to the command executed and forego the HTML bits which lead me to think that I was encountering a browser issue.

It was only after removing and replacing the device that I was able to make the symptom go away. Having encountered the same issue with another device I fixed with the following:

topolhnas01mg# diskdevice=da8
topolhnas01mg# disksizeblocks=$( dmesg | grep -i "byte sectors" | grep -i "^$diskdevice[:].*" | head -1 | cut -d"(" -f 2 | cut -d" " -f 1 )
topolhnas01mg# partitionsizeblocks=34
topolhnas01mg# seekblocks=$( echo $disksizeblocks - $partitionsizeblocks | bc )
topolhnas01mg# sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
topolhnas01mg# dd if=/dev/zero of=/dev/$diskdevice bs=512 count=$partitionsizeblocks
34+0 records in
34+0 records out
17408 bytes transferred in 0.002115 secs (8232582 bytes/sec)
topolhnas01mg# dd if=/dev/zero of=/dev/$diskdevice bs=512 seek=$seekblocks
dd: /dev/da8: end of device
35+0 records in
34+0 records out
17408 bytes transferred in 0.002137 secs (8145309 bytes/sec)
topolhnas01mg#

... followed by a reboot after which the error did not appear. This indicates that the wipe function was not effective.

#7 Updated by Dru Lavigne almost 2 years ago

  • Subject changed from Unable to create volume (possiblely related to #25245) to Volume create fails if disk needs wipe
  • Status changed from Closed: User Config Issue to Unscreened
  • Assignee changed from Release Council to William Grzybowski
  • Seen in changed from Unspecified to 11.0-U1

#8 Updated by William Grzybowski almost 2 years ago

  • Subject changed from Volume create fails if disk needs wipe to Ungraceful error if volume create fails if disk needs wipe
  • Category changed from GUI (new) to 2
  • Status changed from Unscreened to Screened
  • Priority changed from No priority to Nice to have
  • Target version set to 11.2-BETA1

#10 Updated by Dru Lavigne over 1 year ago

  • Status changed from Screened to 15

Andrew: does this issue persist in 11.1? If so, please attach a new debug from the 11.1 system.

#11 Updated by William Grzybowski over 1 year ago

  • Status changed from 15 to Screened

Nothing has changed, pretty sure problem still exists.

#12 Updated by Dru Lavigne about 1 year ago

  • Status changed from Screened to Not Started

#13 Avatar?id=13649&size=24x24 Updated by Ben Gadd about 1 year ago

  • Due date set to 03/09/2018

#14 Updated by William Grzybowski about 1 year ago

  • Category changed from GUI (new) to Middleware

#15 Updated by William Grzybowski about 1 year ago

  • Status changed from Not Started to In Progress

#16 Updated by William Grzybowski about 1 year ago

  • Status changed from In Progress to Done
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#17 Updated by Dru Lavigne about 1 year ago

  • Subject changed from Ungraceful error if volume create fails if disk needs wipe to Use middleware to wipe disks on volume creation

#18 Updated by Dru Lavigne about 1 year ago

  • File deleted (debug-topolhnas01mg-20170720170845.txz)

#19 Updated by Dru Lavigne about 1 year ago

  • File deleted (2017-07-20_bug_after_reboot.txt)

#20 Updated by Dru Lavigne about 1 year ago

  • Private changed from Yes to No

#21 Updated by Dru Lavigne about 1 year ago

  • Related to Bug #31203: Unable to wipe disk added

#22 Updated by William Grzybowski about 1 year ago

  • Related to Bug #31275: "Error deleting pool" when attempting to wipe the lot in new UI (fails) added

#23 Updated by William Grzybowski about 1 year ago

  • Related to Bug #29617: Unable to wipe disks added

#24 Updated by Dru Lavigne 12 months ago

  • Status changed from Done to Ready for Testing

#25 Updated by Vladimir Vinogradenko 11 months ago

  • Has duplicate Bug #28096: Unable to GPT format the disk "nvd0": gpart: geom 'nvd0': File exists added

#26 Updated by Timothy Moore II 11 months ago

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

Testing with two different FreeNAS systems (physical hardware):

Multiple pool creation and detach/wipe data attempts. No errors/visible issues with this process.

#27 Updated by Dru Lavigne 11 months ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF