Project

General

Profile

Bug #76864

Fix traceback when mounting a jail path which contains a space

Added by Dan Jacques almost 3 years ago. Updated over 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
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:
ChangeLog Required:
No

Description

I actually encountered this trying to help a user on r/freenas. My previously installation, 11.2U1, had no problem; however, 11.2U2 is now throwing an exception with the following stack trace when trying to mount a NAS folder that has a space in its name. This must be a bug introduced in 11.2U2 :(

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 128, 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 88, 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 81, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 81, 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 684, in fstab
dump, _pass, index=index
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1037, in fstab
index=index
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 68, in init
self.
_fstab_parse__()
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 81, in fstab_parse
self.__validate_fstab__([self.mount])
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 143, in validate_fstab
if jail_root not in self.dest:
TypeError: argument of type 'NoneType' is not iterable
"""

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 165, in call_method
result = await self.middleware.call_method(self, message)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1141, 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 1078, in call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1105, in _call_worker
job,
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1036, 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 1021, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
TypeError: argument of type 'NoneType' is not iterable

mountpoint.png (32.9 KB) mountpoint.png Bonnie Follweiler, 03/08/2019 07:43 AM
space_jail.png (52 KB) space_jail.png Bonnie Follweiler, 03/08/2019 07:43 AM
59979
59988

Related issues

Related to FreeNAS - Bug #76873: "iocage fstab -e" fails if there is a space (\040) in the fstab mount name.Closed
Related to FreeNAS - Bug #68520: Fix bug where removing an fstab entry breaks basejailsDone
Related to FreeNAS - Bug #72203: Have iocage supply some source fstab validation when the filesystem type is nullfsDone
Has duplicate FreeNAS - Bug #78762: PLUGINS - Removing mount points destroy pluginClosed
Has duplicate FreeNAS - Bug #83123: Jail mountpoints are lost on rebootClosed
Copied to FreeNAS - Bug #79797: Fix traceback when mounting a jail path which contains a spaceClosed
Copied to FreeNAS - Bug #79824: Fix traceback when mounting a jail path which contains a spaceClosed

Associated revisions

Revision 04057aaf (diff)
Added by Brandon Schneider over 2 years ago

fix(jail/fstab): Remove replacement of spaces and split on tabs Other side of iocage ticket Ticket: #76864

Revision 1324ea69 (diff)
Added by Brandon Schneider over 2 years ago

fix(jail/fstab): Remove replacement of spaces and split on tabs (#2732) Other side of iocage ticket Ticket: #76864

Revision 9f870796 (diff)
Added by Brandon Schneider over 2 years ago

fix(jail/fstab): Remove replacement of spaces and split on tabs Other side of iocage ticket Ticket: #76864 (cherry picked from commit 04057aafe68fb7f76c92024f30b18ee96731c31b)

History

#2 Updated by Dan Jacques almost 3 years ago

Related when I tried to use `sudo iocage fstab -e` to work around the UI problem: https://redmine.ixsystems.com/issues/76873

:(

#3 Updated by Dru Lavigne almost 3 years ago

  • Related to Bug #76873: "iocage fstab -e" fails if there is a space (\040) in the fstab mount name. added

#4 Updated by Dru Lavigne almost 3 years ago

  • Category changed from GUI (new) to Middleware
  • Assignee changed from Release Council to William Grzybowski

#6 Updated by William Grzybowski almost 3 years ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-U3
  • Severity changed from New to Medium

#7 Updated by Bug Clerk almost 3 years ago

  • Status changed from Unscreened to In Progress

#8 Updated by Bug Clerk almost 3 years ago

  • Status changed from In Progress to Ready for Testing

#9 Updated by Brandon Schneider almost 3 years ago

Test case as noted in other ticket
----

Run "iocage fstab -e <jail>" 
Add a mount path with a space in it. This is done by replacing the space with "\040".
Save fstab file.
Start the jail, everything mounts great!
Run "iocage fstab -e <jail>" 

#10 Updated by Dru Lavigne almost 3 years ago

  • Related to Bug #68520: Fix bug where removing an fstab entry breaks basejails added

#11 Updated by Dru Lavigne almost 3 years ago

  • Related to Bug #72203: Have iocage supply some source fstab validation when the filesystem type is nullfs added

#12 Updated by Dru Lavigne almost 3 years ago

  • Subject changed from Mounting a jail path with a space in it hits "NameError" to Fix traceback when mounting a jail path which contains a space
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#14 Updated by Brandon Schneider over 2 years ago

  • Has duplicate Bug #78762: PLUGINS - Removing mount points destroy plugin added

#15 Updated by Bonnie Follweiler over 2 years ago

59979
59988

Test Failed in FreeNAS-11.2-U2-INTERNAL97
Screenshots provided
It gave me an error message: [EFAULT] Source: /mnt/tank/bonz\040tank does not exist!
and a traceback

Error: concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 712, in fstab
dump, pass, index=index
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1037, in fstab
index=index
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 71, in init
self.
_fstab_parse__()
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 84, in fstab_parse
self.__validate_fstab__([self.mount])
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_fstab.py", line 211, in validate_fstab
exception=iocage_lib.ioc_exceptions.ValidationFailed
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 90, in logit
_callback(content, exception)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 64, in callback
raise callback_exception(message)
iocage_lib.ioc_exceptions.ValidationFailed: ['Source: /mnt/tank/bonz\\040tank does not exist!']

During handling of the above exception, another exception occurred:

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 128, 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 88, 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 81, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 81, 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 724, in fstab
raise CallError(e.message)
middlewared.service_exception.CallError: [EFAULT] Source: /mnt/tank/bonz\040tank does not exist!
"""

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 165, in call_method
result = await self.middleware.call_method(self, message)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1141, 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 1078, in call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1105, in _call_worker
job,
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1036, 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 1021, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
middlewared.service_exception.CallError: [EFAULT] Source: /mnt/tank/bonz\040tank does not exist!

#16 Updated by Brandon Schneider over 2 years ago

  • Status changed from Failed Testing to In Progress

#17 Updated by Bug Clerk over 2 years ago

  • Status changed from In Progress to Ready for Testing

#18 Updated by Bug Clerk over 2 years ago

  • Copied to Bug #79797: Fix traceback when mounting a jail path which contains a space added

#19 Updated by Bug Clerk over 2 years ago

  • Status changed from Ready for Testing to In Progress

#20 Updated by Bug Clerk over 2 years ago

  • Status changed from In Progress to Ready for Testing

#21 Updated by Bug Clerk over 2 years ago

  • Target version changed from 11.2-U3 to 11.3-BETA1

#22 Updated by Bug Clerk over 2 years ago

  • Copied to Bug #79824: Fix traceback when mounting a jail path which contains a space added

#23 Updated by Dru Lavigne over 2 years ago

  • Target version changed from 11.3-BETA1 to 11.2-U3

#26 Updated by Bonnie Follweiler over 2 years ago

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

Test Passed in FreeNAS-11.2-U2-INTERNAL100

#27 Updated by Dru Lavigne over 2 years ago

  • Status changed from Passed Testing to Done

#28 Updated by Dru Lavigne over 2 years ago

  • Has duplicate Bug #83123: Jail mountpoints are lost on reboot added

Also available in: Atom PDF