Smb user account creation

i have set up a smb share and I am trying to flag “SMB User” on my account in order to access the share.
when I try to save the account this error pops up and blocks me from flagging “SMB User”:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py”, line 323, in process_method_call
result = await method.call(app, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py”, line 52, in call
result = await self.middleware.call_with_audit(self.name, self.serviceobj, methodobj, params, app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 911, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 720, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/service/crud_service.py”, line 266, in update
return await self.middleware.call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 731, in call
return await self.run_in_executor(prepared_call.executor, methodobj, *prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 624, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/service/crud_service.py”, line 294, in nf
rv = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/api/base/decorator.py”, line 101, in wrapped
result = func(*args)
^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/plugins/account.py”, line 976, in do_update
self.middleware.call_sync(‘smb.update_passdb_user’, user)
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1041, in call_sync
return methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/plugins/smb
/passdb.py", line 45, in update_passdb_user
update_passdb_entry(passdb_entry)
File “/usr/lib/python3/dist-packages/middlewared/plugins/smb/util_passdb.py”, line 431, in update_passdb_entry
add_version_info()
File "/usr/lib/python3/dist-packages/middlewared/plugins/smb
/util_passdb.py", line 135, in _add_version_info
with get_tdb_handle(PASSDB_PATH, PASSDB_TDB_OPTIONS) as hdl:
File “/usr/lib/python3.11/contextlib.py”, line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/utils/tdb.py”, line 345, in get_tdb_handle
entry = TDBHandle(name, tdb_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/utils/tdb.py”, line 327, in init
self.hdl = tdb.Tdb(self.full_path, 0, tdb_flags, open_flags, open_mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory

I dont have any clue on how to resolve this issue.

Interesting. What version is this? Depending on version this may mean that system dataset was not properly mounted. It may also mean that some other defect / misconfiguration has prevented our normal setup routines from creating some paths required by the account plugin.

Check your email for the introductory email from the forum. Do the TrueNAS Bot tutorial so you can post images, etc.

What version of TrueNAS? Did you set up a new user called “SMB User”? Where are you getting stuck in the documentation for the version of TrueNAS you are on?

version is 25.04.2.6

i set up an account in my name which is not an admin. i tried to add it to different groups but it still does not work

i am following the turotial “SMB Share Creation” of the TrueNAS Documentation HUB

i get stuck at the user creation, as I get the Validation Error i posted before

Passdb path is /var/run/samba-cache/private. The error means the directory wasn’t created. This is happening because of probably an earlier failure in smb.configure method. Should be in your job history in in top-right of screen.

Alternatively you can run midclt call smb.configure -j from shell and see what error is produced. This can give some deeper clue on what’s going wrong here. (25.04.2.6 specific private API)

1 Like

this is the output:

truenas_admin@truenas[~]$ midclt call smb.configure -j
Status: Setting up server SID.
Total Progress: [############____________________________] 30.00%
[EFAULT] setlocalsid failed: Unable to initialize messaging context!

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/job.py”, line 515, in run
await self.future
File “/usr/lib/python3/dist-packages/middlewared/job.py”, line 560, in __run_body
rv = await self.method(*args)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/plugins/smb.py”, line 364, in configure
await self.middleware.call(‘smb.set_system_sid’)
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1005, in call
return await self._call(
^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 731, in call
return await self.run_in_executor(prepared_call.executor, methodobj, *prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 624, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/plugins/smb
/sid.py", line 36, in set_system_sid
raise CallError(f’setlocalsid failed: {setsid.stderr.decode()}')
middlewared.service_exception.CallError: [EFAULT] setlocalsid failed: Unable to initialize messaging context!

Have you populated auxiliary parameters in either the global SMB configuration or SMB share configuration? Failure to initialize a messaging context usually means that we can’t generate a functional smb configuration.

No, I don’t think I have. I have not read any of these in the documentation.