Project

General

Profile

Feature #41060

Improve the validation process for source and destination fields when adding storage to jails

Added by Lola Yang about 2 years ago. Updated about 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Estimated time:
Severity:
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:

Related issues

Related to FreeNAS - Feature #42958: Adding storage to jail: help user in creating destination directoryClosed
Related to FreeNAS - Bug #45343: Ensure destination directory exists when adding storage to a jailDone
Blocks FreeNAS - Bug #40744: Update new UI version of Guide to indicate destination directory will be automatically created if it does not exist when adding storage to a jailDone

Associated revisions

Revision d95307d4 (diff)
Added by Waqar Ahmed about 2 years ago

Validation improved for jails fstab This ticket improves the validation process for source and destination fields in jails plugin for fstab call. Ticket: #41060

Revision 83e21ff3 (diff)
Added by Waqar Ahmed about 2 years ago

Validation improved for jails fstab This ticket improves the validation process for source and destination fields in jails plugin for fstab call. Ticket: #41060

Revision d989efaf (diff)
Added by Waqar Ahmed about 2 years ago

Bug fix for validation in jail plugin This commit fixes a bug which prevented valid destination paths to be rejected on validation while updating fstab of a jail. Ticket: #41060

Revision ec12e7a6 (diff)
Added by Waqar Ahmed about 2 years ago

tkt-41060: Bug fix for validation in jail plugin (#1735) Bug fix for validation in jail plugin This commit fixes a bug which prevented valid destination paths to be rejected on validation while updating fstab of a jail. Ticket: #41060

History

#1 Updated by Lola Yang about 2 years ago

  • Blocks Bug #40744: Update new UI version of Guide to indicate destination directory will be automatically created if it does not exist when adding storage to a jail added

#2 Updated by Dru Lavigne about 2 years ago

  • Target version changed from Backlog to 11.2-BETA3

#3 Updated by Brandon Schneider about 2 years ago

  • Status changed from Unscreened to Not Started

#4 Updated by William Grzybowski about 2 years ago

  • Assignee changed from Brandon Schneider to Waqar Ahmed

Load-balancing from Brandon

#5 Updated by Waqar Ahmed about 2 years ago

  • Status changed from Not Started to In Progress
  • Severity changed from New to Medium

#6 Updated by Waqar Ahmed about 2 years ago

  • Status changed from In Progress to Ready for Testing

#7 Updated by Dru Lavigne about 2 years ago

  • Subject changed from if destination directory is not exist, need middleware to handle it to Improve the validation process for source and destination fields when adding storage to jails
  • Needs Merging changed from Yes to No

#8 Updated by Dru Lavigne about 2 years ago

  • Related to Feature #42958: Adding storage to jail: help user in creating destination directory added

#9 Updated by Dru Lavigne about 2 years ago

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

#10 Updated by Timothy Moore II about 2 years ago

  • Needs Doc changed from Yes to No

#11 Updated by Dru Lavigne about 2 years ago

  • Status changed from Passed Testing to Done

#12 Updated by Michael Reynolds about 2 years ago

  • Status changed from Done to Failed Testing

Specifying a destination dir off /mnt in a jail is not allowed and causes a traceback.

Using /mnt should be a valid place to mount an external dataset.

#13 Updated by Brandon Schneider about 2 years ago

Waqar: All the plugin needs to do is strip iocroot/root off the destination, leaving the rest intact.

This allows the mountpoint /mnt/foo inside the jail, and both destination syntaxs of iocroot/destination and just /destination

#14 Updated by Bug Clerk about 2 years ago

  • Status changed from Failed Testing to In Progress

#15 Updated by Bug Clerk about 2 years ago

  • Status changed from In Progress to Ready for Testing

#16 Updated by Dru Lavigne about 2 years ago

  • Needs QA changed from No to Yes

#17 Updated by Michael Reynolds about 2 years ago

  • Status changed from Ready for Testing to Failed Testing

This still does not work correctly.

I have a dataset configured
Went to Jails -> Jail Options (3 vertical dots) -> Mount points -> Add Mount Point
Source: /mnt/poolio/QA-41060-JailStorage
Destination: /mnt/iocage/jails/BUG-41060/root/mnt/external

The storage adds fine, but the jail cannot be started and gives the following traceback;

@[2018/09/07 13:55:56] (WARNING) application.call_method():182 - Exception while calling jail.start(*['41308'])
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 456, in start
iocage.start()
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1621, in start
callback=self.callback
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 65, in init
self.
_start_jail__()
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 391, in start_jail
silent=self.silent)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 80, in logit
_callback(content)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 63, in callback
raise RuntimeError(message)
RuntimeError: jail: mount.fstab: /mnt/iocage/jails/41308/root/mnt/QA-41060-JailStorage: No such file or directory

"""

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/site-packages/middlewared/main.py", line 1033, in call_method
return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 970, in call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 997, in _call_worker
job,
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 928, in run_in_proc
return await self.run_in_executor(self.
_procpool, method, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 913, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
RuntimeError: jail: mount.fstab: /mnt/iocage/jails/41308/root/mnt/QA-41060-JailStorage: No such file or directory

[2018/09/07 13:55:56] (DEBUG) middlewared.logger.CrashReporting.report():102 - Sending a crash report...
[2018/09/07 13:55:56] (DEBUG) raven.base.Client.send_remote():716 - Sending message of length 3164 to https://sentry.ixsystems.com/api/2/store/
@

Added the same external storage to /media using a different jail and the jail started with no issues.

Another side effect, after getting the initial popup error, the jail can be started, and a Shell can be started but only makes it as far as saying "jail: mount.fstab: /mnt/iocage/jails/BUG-41060/root/mnt/external: No such file or directory"

#18 Updated by Michael Reynolds about 2 years ago

this ticket passes, but the destination dir must exist.
Destination dir must exist is an new bug

#19 Updated by Michael Reynolds about 2 years ago

  • Status changed from Failed Testing to Passed Testing
  • Needs QA changed from Yes to No

#20 Updated by Waqar Ahmed about 2 years ago

  • Related to Bug #45343: Ensure destination directory exists when adding storage to a jail added

#21 Updated by Dru Lavigne about 2 years ago

  • Status changed from Passed Testing to Done

The remaining work will occur on the related ticket.

Also available in: Atom PDF