Interface allows creation of child dataset on read-only dataset

Description

Cause

Unknown.

Solution

Unset read-only on parent dataset, or do not create a child dataset on read-only parent.

Reproduce

Mark a dataset as read-only
Create a dataset under it
Complete the form
Error will appear but child dataset will still appear.

E.g. Trying to use the child dataset in SMB will show an error that the path does not exist

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk September 28, 2021 at 12:42 PM

Bug Clerk September 21, 2021 at 10:01 PM

Bonnie Follweiler May 7, 2021 at 1:06 PM
Edited

Recreated the issue in TrueNAS-12.0-U3. I have included screenshots and a debug. When I click Save it gives the error provided below. When I close the error window  the UI has stayed on the window where I was creating the child_dataset. I go to Storage -> Pools and the child dataset has been created.

The error is:

CallError

[EFAULT] Failed to mount dataset: failed to create mountpoint: Read-only file system
Error: concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/zfs.py", line 875, in mount
dataset.mount()
File "libzfs.pyx", line 391, in libzfs.ZFS._exit_
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/zfs.py", line 875, in mount
dataset.mount()
File "libzfs.pyx", line 3534, in libzfs.ZFSDataset.mount
libzfs.ZFSException: failed to create mountpoint: Read-only file system

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/concurrent/futures/process.py", line 239, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/worker.py", line 94, in main_worker
res = MIDDLEWARE._run(*call_args)
File "/usr/local/lib/python3.8/site-packages/middlewared/worker.py", line 45, in _run
return self._call(name, serviceobj, methodobj, args, job=job)
File "/usr/local/lib/python3.8/site-packages/middlewared/worker.py", line 39, in _call
return methodobj(*params)
File "/usr/local/lib/python3.8/site-packages/middlewared/worker.py", line 39, in _call
return methodobj(*params)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 977, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/zfs.py", line 878, in mount
raise CallError(f'Failed to mount dataset: {e}')
middlewared.service_exception.CallError: [EFAULT] Failed to mount dataset: failed to create mountpoint: Read-only file system
"""

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

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 137, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/service.py", line 465, in create
rv = await self.middleware._call(
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 973, in nf
return await f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/pool.py", line 3036, in do_create
await self.middleware.call('zfs.dataset.mount', data['name'])
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1238, in call
return await self._call(
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1203, in _call
return await self._call_worker(name, *prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1209, in _call_worker
return await self.run_in_proc(main_worker, name, args, job)
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1136, in run_in_proc
return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1110, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
middlewared.service_exception.CallError: [EFAULT] Failed to mount dataset: failed to create mountpoint: Read-only file system

Bonnie Follweiler May 3, 2021 at 1:38 PM

Thank you for the report, .

Can you please attach a debug file to this ticket? To generate a debug file on TrueNAS CORE, log in to the TrueNAS web interface, go to System > Advanced, then click Save Debug and wait for the file to download to your local system. In TrueNAS SCALE, this option is in System Settings > Advanced.

Tyler Montney May 2, 2021 at 8:48 PM

Expected Behavior

Do not allow creation of a dataset (and any other items) by disabling the option or displaying a dialog (instead of opening the form).

Complete

Details

Assignee

Reporter

Labels

Impact

Low

Time remaining

0m

Components

Affects versions

Priority

Katalon Platform

Created May 2, 2021 at 1:10 AM
Updated July 6, 2022 at 8:58 PM
Resolved October 5, 2021 at 8:49 PM