Project

General

Profile

Bug #35395

Apply handleWSError to the websocket of the storage section in new UI

Added by Waqar Ahmed over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Erin Clark
Category:
GUI (new)
Target version:
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

When a validation exception is raised from Middlewared, new UI does not display that exception on the respective field, rather it displays a popup and the relevant traceback. For an example we can have a look at the old UI, if there's a form and middlewared raised an exception for some field in the form, that error will only be shown above the respective field. I think this approach is more user friendly and displays a neat overview of the validation errors raised for fields involved.

einvalidation.png (120 KB) einvalidation.png Waqar Ahmed, 06/20/2018 09:08 AM
Jail-Destination-Path-Screenshot-2018-08-29.png (22.3 KB) Jail-Destination-Path-Screenshot-2018-08-29.png Michael Reynolds, 08/29/2018 08:50 AM
IncorrectUsernameOrPass-2018-08-29.png (45.4 KB) IncorrectUsernameOrPass-2018-08-29.png Michael Reynolds, 08/29/2018 11:55 AM
JailWithSameName-2018-08-30.png (7 KB) JailWithSameName-2018-08-30.png Michael Reynolds, 08/30/2018 06:33 AM
19060
26640
26816
27289

Related issues

Related to FreeNAS - Bug #43745: Apply handleWSError to the websocket of the Jails section in new UIDone

Associated revisions

Revision 00687d65 (diff)
Added by Erin Clark over 1 year ago

Apply handleWSError to the websocket using forms of the storage section Ticket: #35395

Revision 8b8c1327 (diff)
Added by Erin Clark over 1 year ago

handleWSError should not reassign the dialog service (this might do weird things) Ticket: #35395

Revision aef088df (diff)
Added by Erin Clark over 1 year ago

Apply handleWSError throughout jails section Ticket: #35395

History

#1 Updated by Waqar Ahmed over 1 year ago

19060

#2 Updated by Erin Clark over 1 year ago

  • Status changed from Unscreened to Screened

#3 Updated by Dru Lavigne over 1 year ago

  • Target version changed from Backlog to 11.2-RC2

#4 Updated by Dru Lavigne over 1 year ago

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

#6 Updated by Erin Clark over 1 year ago

  • Status changed from Screened to In Progress

This should be fixed in most websocket using forms using EntityUtils.handleWSError() now but it was not fixed for zvols as mentioned in the ticket and a couple other pages in the storage section so this PR should apply it to those pages:

https://github.com/freenas/webui/pull/1101

#7 Updated by Erin Clark over 1 year ago

  • Status changed from In Progress to Ready for Testing

#8 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Tracebacks on validation errors to Apply handleWSError to the websocket of the storage section in new UI
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#10 Updated by Michael Reynolds over 1 year ago

26640

Jails -> On an existing jail -> Options (3 verticla dots) -> Mountpoints -> Add Mount Point

Choose Source dataset
Choose Destination

Get a traceback popup
see Jail-Destination-Path-Screenshot-2018-08-29.png

[EINVAL] destination: Destination should not include the jail path. e.g "/mnt/iocage/jails/btsync/root/" Path should be specifiedafter /

Traceback text
Error: concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 122, in main_worker
res = loop.run_until_complete(coro)
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 82, in _run
return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 668, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 550, in fstab
raise verrors
middlewared.service_exception.ValidationErrors: [EINVAL] destination: Destination should not include the jail path. e.g "/mnt/iocage/jails/btsync/root/" Path should be specifiedafter /

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 155, in call_method
result = await self.middleware.call_method(self, message)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1023, in call_method
return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 960, in _call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 987, in _call_worker
job,
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 918, in run_in_proc
return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 912, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
middlewared.service_exception.ValidationErrors: [EINVAL] destination: Destination should not include the jail path. e.g "/mnt/iocage/jails/btsync/root/" Path should be specifiedafter /

I've tried multiple ways to specify the destination path and cannot get a path that works. The tooltip/docs state if the destination dir does not exist it will be created, so I should be able to specify bug-42485 under mnt and have that dir created.

Using the file browser gives a path of /mnt/iocage/jails/jail33/root/mnt/

This will be a good one to see how this new error handling works, plus I'll be able to verify another bug.

#11 Updated by Michael Reynolds over 1 year ago

  • Status changed from Ready for Testing to Failed Testing

#13 Updated by Michael Reynolds over 1 year ago

26816

System:Support -> enter an invalid username or password
See IncorrectUsernameOrPass-2018-08-29.png

Was able to confirm we know this is a username or password error as once you leave the Password field with an invalid username or password specified, the error dialog given pops up. The user hasn't even made it to other fields at that point, so it has to be the username or password.

#14 Updated by Michael Reynolds over 1 year ago

  • File VM-DatasetDoesNotExist-2018-08-29.png added

#15 Updated by Michael Reynolds over 1 year ago

  • File deleted (VM-DatasetDoesNotExist-2018-08-29.png)

#16 Updated by Michael Reynolds over 1 year ago

The incorrect username/password error doesn't get this fix per Erin.

Split off to new ticket https://redmine.ixsystems.com/issues/43624

#18 Updated by Erin Clark over 1 year ago

https://github.com/freenas/webui/pull/1210 this should hopefully handle websocket errors in the jails section a little better

#19 Updated by Michael Reynolds over 1 year ago

Checked out the fix in branch

Except for the bad wording and missing space on the error message, this looks great.

See DestPathError-Fixed-2018-08-29-21-05-47.png

There are more areas that need to be fixed.
Marking as In Progress for now.

#20 Updated by Dru Lavigne over 1 year ago

  • Status changed from Failed Testing to In Progress

#21 Updated by Michael Reynolds over 1 year ago

27289

Creating a jail with the same name as an existing jail gives the EINVAL popup still
see: JailWithSameName-2018-08-30.png

#24 Updated by Dru Lavigne over 1 year ago

  • Related to Bug #43745: Apply handleWSError to the websocket of the Jails section in new UI added

#25 Updated by Erin Clark over 1 year ago

  • Status changed from In Progress to Ready for Testing

#26 Updated by Michael Reynolds over 1 year ago

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

The only issue left to test in this one is adding an invalid path and that was fixed. Everything else has split off to other tickets.

#27 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF