[EFAULT] Failed to set NT password for XXX: Username not found! (smb.synchronize_passdb)

YuriiV

Cadet
Joined
Jan 7, 2022
Messages
9
Hello, cant create new user smb, its created in system without problem, but when start smb.synchronize_passdb process I have error

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 367, in run
await self.future
File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 403, in __run_body
rv = await self.method(*([self] + args))
File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/smb_/passdb.py", line 194, in synchronize_passdb
await self.middleware.call('smb.update_passdb_user', u['username'], passdb_backend)
File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1256, in call
return await self._call(
File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1213, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/smb_/passdb.py", line 112, in update_passdb_user
raise CallError(f'Failed to set NT password for {username}: {setntpass.stderr.decode()}')
middlewared.service_exception.CallError: [EFAULT] Failed to set NT password for XXX: Username not found!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Okay. This was an issue in how RID values were generated. Will be fixed in 13 release (and is fixed in SCALE). Simple workaround if you get in this state:

rm /var/db/system/samba4/private/passdb.tdb
midclt call smb.synchronize_passdb -job
 

YuriiV

Cadet
Joined
Jan 7, 2022
Messages
9
Thanks, it helped, the only thing to correctly re-create the file, I had to disable the SMB service
 

ncmarc

Cadet
Joined
Apr 22, 2022
Messages
3
I have this same issue happening. Is this still the best way to handle it. Is there something we can do to avoid it when adding users?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I have this same issue happening. Is this still the best way to handle it. Is there something we can do to avoid it when adding users?
If you're experiencing the issue you can fix it that way. 12.0-stable branch is basically security fixes only. 13-stable should have the issue addressed.
 
Top