Project

General

Profile

Bug #25057

Fix traceback when deleting boot environment

Added by Ingo Brockmann over 1 year ago. Updated 5 months ago.

Status:
Done
Priority:
No priority
Assignee:
Sean Fagan
Category:
OS
Target version:
Seen in:
Severity:
Low
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

I Want to clean up my boot environments. When deleting the oldest one. I got the following error message:

Request Method: POST
Request URL: http://192.168.178.21/system/bootenv/delete/ FreeNas-9.10.1-STABLE-DEFAULT/
Software Version: FreeNAS-11.0-U1 (aa82cc58d)
Exception Type: InvalidBootEnvironmentNameException
Exception Value:
Exception Location: /usr/local/lib/freenasOS/Update.py in _CheckBEName, line 523
Server time: Sat, 8 Jul 2017 22:08:54 +0200
Traceback

Environment:

Software Version: FreeNAS-11.0-U1 (aa82cc58d)
Request Method: POST
Request URL: http://192.168.178.21/system/bootenv/delete/ FreeNas-9.10.1-STABLE-DEFAULT/

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/system/views.py" in bootenv_delete
351. delete = DeleteClone(name)
File "/usr/local/lib/freenasOS/Update.py" in DeleteClone
722. _CheckBEName(name)
File "/usr/local/lib/freenasOS/Update.py" in _CheckBEName
523. raise InvalidBootEnvironmentNameException

Exception Type: InvalidBootEnvironmentNameException at /system/bootenv/delete/ FreeNas-9.10.1-STABLE-DEFAULT/
Exception Value:

Request information
GET
No GET data

POST
Variable Value
__form_id 'form_str'
FILES
No FILES data

COOKIES
Variable Value
sessionid '96k81vaw5n31oivxudzd9d57t3oufnrn'
csrftoken 'syypDHWve2pOBc6DH0D2zonC7CfFKYKFDa1cPR4UXQJcGqgKNRGxwaKjKAMdZCtT'
fntreeSaveStateCookie 'root'

Freenas_boot.JPG (72.8 KB) Freenas_boot.JPG Ingo Brockmann, 07/09/2017 01:26 AM
11718

Associated revisions

Revision 9dd2d713 (diff)
Added by Sean Fagan over 1 year ago

When deleting a clone, we may be given the real name, or a nickname.
Fortunately, FindClone() already handles that same case, so we'll use
that to find the clone first. If it doesn't exist, we fail anyway.

Ticket: #25057

History

#1 Updated by Dru Lavigne over 1 year ago

  • Assignee changed from Release Council to Sean Fagan

#2 Updated by Sean Fagan over 1 year ago

  • Status changed from Unscreened to 15

This appears to be a UI issue, but we need debug log information to start with.

#3 Updated by Ingo Brockmann over 1 year ago

  • File debug-freenas-20170710232140.tgz added

Debug log added.

#4 Updated by Sean Fagan over 1 year ago

  • Status changed from 15 to Investigation

The BE FreeNas-9.10.1-STABLE-DEFAULT is actually a nickname for 9.10.1, so that is probably the issue. I'll have to go through the *Clone code to see what should happen and what does happen.

#5 Updated by Sean Fagan over 1 year ago

  • Status changed from Investigation to 19
  • Assignee changed from Sean Fagan to Vaibhav Chauhan

commit:9dd2d713fe773a5dfc8fc08055acaad4d400a66f, also in FIX-25057, should be cherry-picked into stable.

VB, is that something I should do, or you?

#6 Updated by Dru Lavigne over 1 year ago

  • Assignee changed from Vaibhav Chauhan to Sean Fagan

Sean, has this passed build testing? Is it ready for Developer Review? Also, please set a target version.

#7 Updated by Sean Fagan over 1 year ago

  • Status changed from 19 to Needs Developer Review
  • Target version set to 11.1

#8 Updated by Dru Lavigne over 1 year ago

  • Assignee changed from Sean Fagan to William Grzybowski

William: are you able to review this code? If not, please pass to someone who can.

#9 Updated by William Grzybowski over 1 year ago

  • Status changed from Needs Developer Review to Reviewed by Developer
  • Assignee changed from William Grzybowski to Sean Fagan

#10 Updated by Sean Fagan over 1 year ago

  • Assignee changed from Sean Fagan to Vaibhav Chauhan

#11 Updated by Vaibhav Chauhan over 1 year ago

  • Assignee changed from Vaibhav Chauhan to Sean Fagan

please create a PR against freenas/11.0-stable branch for this change, as we have migrated from FIX branch to PR to bring in changes.

#12 Updated by Sean Fagan over 1 year ago

done

#13 Updated by Vaibhav Chauhan over 1 year ago

  • Status changed from Reviewed by Developer to 47
  • Assignee changed from Sean Fagan to James Nixon

#14 Updated by Vaibhav Chauhan over 1 year ago

  • Assignee changed from James Nixon to Joe Maloney

#15 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Deleting old boot environment fails to Fix traceback when deleting boot environment

#16 Updated by Dru Lavigne over 1 year ago

  • Assignee changed from Joe Maloney to Sean Fagan

#17 Updated by Dru Lavigne about 1 year ago

  • Assignee changed from Sean Fagan to Bonnie Follweiler
  • Target version changed from 11.1 to 11.1-BETA1

#18 Updated by Bonnie Follweiler about 1 year ago

  • Status changed from 47 to Ready For Release
  • Assignee changed from Bonnie Follweiler to Sean Fagan
  • Needs QA changed from Yes to No
  • QA Status Test Passes FreeNAS added

Test Passed in the FreeNAS Nightlies

#19 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready For Release to Resolved

#20 Updated by Dru Lavigne about 1 year ago

  • File deleted (debug-freenas-20170710232140.tgz)

#21 Updated by Ingo Brockmann 12 months ago

Hi, I updated my system to 11.1-Release today. The bugfix is not working for me.

Request Method: POST
Request URL: http://freenas.local/system/bootenv/delete/%20FreeNas-9.10.1-STABLE-DEFAULT/
Software Version: FreeNAS-11.1-RELEASE (dc7d195f4)
Exception Type: ClientException
Exception Value:
Exception Location: /usr/local/lib/python3.6/site-packages/middlewared/client/client.py in call, line 394
Server time: Sun, 17 Dec 2017 19:25:02 +0100

Environment:

Software Version: FreeNAS-11.1-RELEASE (dc7d195f4)
Request Method: POST
Request URL: http://freenas.local/system/bootenv/delete/%20FreeNas-9.10.1-STABLE-DEFAULT/

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
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/system/views.py" in bootenv_delete
354. delete = c.call('bootenv.delete', name, timeout=120)
File "./freenasUI/system/views.py" in bootenv_delete
354. delete = c.call('bootenv.delete', name, timeout=120)
File "/usr/local/lib/python3.6/site-packages/middlewared/client/client.py" in call
394. raise ClientException(c.error, c.errno, c.trace, c.extra)

Exception Type: ClientException at /system/bootenv/delete/ FreeNas-9.10.1-STABLE-DEFAULT/
Exception Value:

#22 Updated by Dru Lavigne 12 months ago

  • Status changed from Resolved to Unscreened
  • Target version changed from 11.1-BETA1 to 11.1-U1
  • Seen in changed from 11.0-U1 to 11.1

#23 Updated by Sean Fagan 12 months ago

  • Assignee changed from Sean Fagan to Release Council

I'm not sure this is the same exception. The traceback is certainly different, but it's going through the middleware.

This is going to need debug logs, and screening by someone familiar with the middleware code in question. Or pointers to me to know what log messages to look for.

#24 Updated by Dru Lavigne 12 months ago

  • Status changed from Unscreened to 15

Ingo: can you please attach a debug (System -> Advanced -> Save Debug)?

#25 Updated by Dru Lavigne 12 months ago

  • Status changed from 15 to Closed: Insufficient Info
  • Target version changed from 11.1-U1 to N/A

#26 Updated by Ingo Brockmann 12 months ago

  • File debug-freenas-20171222224132.tgz added

Hello,

as requested, please find enclosed the debug.

Regards, Ingo

#27 Updated by Dru Lavigne 11 months ago

  • Status changed from Closed: Insufficient Info to Closed: Duplicate

#28 Updated by Dru Lavigne 11 months ago

  • Is duplicate of Bug #24139: Increase timeout to delete boot environment added

#29 Updated by Dru Lavigne 11 months ago

  • Status changed from Closed: Duplicate to Unscreened
  • Assignee changed from Release Council to William Grzybowski
  • Private changed from No to Yes

William: can you do a quick sanity check to see if the dupe ticket did indeed fix this scenario?

#30 Updated by William Grzybowski 11 months ago

  • Assignee changed from William Grzybowski to Sean Fagan
  • Target version deleted (N/A)
  File "/usr/local/lib/freenasOS/Update.py", line 723, in DeleteClone
    _CheckBEName(name)
  File "/usr/local/lib/freenasOS/Update.py", line 523, in _CheckBEName
    raise InvalidBootEnvironmentNameException
freenasOS.Exceptions.InvalidBootEnvironmentNameException

It seems you are checking for a valid BE name even on delete. Which prevents user from deleting a boot environment which previously was created with an invalid name.

it seems that check should be removed from DeleteClone?

#31 Updated by William Grzybowski 11 months ago

  • Is duplicate of deleted (Bug #24139: Increase timeout to delete boot environment)

#32 Updated by Dru Lavigne 11 months ago

  • Target version set to 11.2-BETA1

#33 Updated by Dru Lavigne 11 months ago

  • Status changed from Unscreened to Not Started

#34 Avatar?id=13649&size=24x24 Updated by Ben Gadd 10 months ago

  • Due date set to 03/09/2018

#35 Updated by Dru Lavigne 9 months ago

  • Target version changed from 11.2-BETA1 to 11.2-RC2

#36 Updated by Nick Wolff 8 months ago

  • Severity set to Low

#37 Updated by Dru Lavigne 5 months ago

  • Target version changed from 11.2-RC2 to 11.2-BETA3

#39 Updated by Sean Fagan 5 months ago

  • Status changed from Not Started to Blocked
  • Reason for Blocked set to Waiting for feedback

#40 Updated by Sean Fagan 5 months ago

  • Status changed from Blocked to Ready for Testing
  • Reason for Blocked deleted (Waiting for feedback)

Thanks WIlliam!

commit: a0509d3b4516f6c1ea99c19297647a3cc05ef0ad

#41 Updated by Dru Lavigne 5 months ago

  • Target version changed from 11.2-BETA3 to 11.2-BETA2
  • Needs QA changed from No to Yes
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#42 Updated by Dru Lavigne 5 months ago

  • File deleted (debug-freenas-20171222224132.tgz)

#43 Updated by Dru Lavigne 5 months ago

  • Private changed from Yes to No

#44 Updated by Dru Lavigne 5 months ago

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

Bonnie indicates this has passed testing.

Also available in: Atom PDF