"SMB share creation failed" when importing a zfs pool from Arch Linux

johnhamelink

Cadet
Joined
Dec 16, 2022
Messages
6
Hi there,

I'm trying to move a ZFS pool I had in my desktop into a server I just bought (my first server - very exciting!). When I try to import the pool, the OpenZFS successfully mounts the pool to /mnt/run/media/john/pool, but the TrueNAS UI fails with the following error:

Code:
Error: concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last):  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs.py", line 973, in update_zfs_object_props    zfs_object.update_properties(properties)  File "libzfs.pyx", line 3388, in libzfs.ZFSResource.update_properties libzfs.ZFSException: SMB share creation failed During handling of the above exception, another exception occurred: Traceback (most recent call last):  File "/usr/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker    r = call_item.fn(*call_item.args, **call_item.kwargs)  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 114, in main_worker    res = MIDDLEWARE._run(*call_args)  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 45, in _run    return self._call(name, serviceobj, methodobj, args, job=job)  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 39, in _call    return methodobj(*params)  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 39, in _call    return methodobj(*params)  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1146, in nf    res = f(*args, **kwargs)  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1276, in nf    return func(*args, **kwargs)  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs.py", line 947, in do_update    self.update_zfs_object_props(properties, dataset)  File "libzfs.pyx", line 411, in libzfs.ZFS.__exit__  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs.py", line 947, in do_update    self.update_zfs_object_props(properties, dataset)  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs.py", line 975, in update_zfs_object_props    raise CallError(f'Failed to update properties: {e!r}') middlewared.service_exception.CallError: [EFAULT] Failed to update properties: ZFSException('SMB share creation failed') """ The above exception was the direct cause of the following exception: Traceback (most recent call last):  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 411, in run    await self.future  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 446, in __run_body    rv = await self.method(*([self] + args))  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1272, in nf    return await func(*args, **kwargs)  File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1140, in nf    res = await f(*args, **kwargs)  File "/usr/lib/python3/dist-packages/middlewared/plugins/pool.py", line 1429, in import_pool    await self.middleware.call('zfs.dataset.update', pool_name, opts)  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1345, in call    return await self._call(  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1294, in _call    return await methodobj(*prepared_call.args)  File "/usr/lib/python3/dist-packages/middlewared/service.py", line 931, in update    rv = await self.middleware._call(  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1302, in _call    return await self._call_worker(name, *prepared_call.args)  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1308, in _call_worker    return await self.run_in_proc(main_worker, name, args, job)  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1223, in run_in_proc    return await self.run_in_executor(self.__procpool, method, *args, **kwargs)  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1206, in run_in_executor    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs)) middlewared.service_exception.CallError: [EFAULT] Failed to update properties: ZFSException('SMB share creation failed')
Close


The UI does not show the pool as having been imported, and subsequent import attempts will show no pools - that is until you run zpool export from System Settings -> Shell.
 

johnhamelink

Cadet
Joined
Dec 16, 2022
Messages
6
I was able to workaround this by setting zfs set sharesmb=off pool from the shell, then exporting the pool and rebooting. I guess based on this that the TrueNAS Samba integration is not relying on ZFS'? Perhaps this edgecase could be handled by alerting the user to the fact that they'll lose their SMB share configuration if they import, and then turn off the shares before importing as normal?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Bah, somehow your replies weren't visible when I wrote that. We do no support configuring NFS shares via sharenfs property and we do not support configuring SMB shares via sharesmb property. The only supported way of configuring any sort of share is via our middleware/webui.

There is automatic validation / CI for sharenfs property it might be that the error code returned by py-libzfs has changed. I'll check on it tomorrow and add some CI explicitly for this.
 
Joined
Jul 27, 2023
Messages
6
I have this same issue - it possible to import a pool with sharesmb=on so it just ignores it?

I cannot import the original pool into the original system now.
 
Top