Rebuilding Directory Service Cache fails

I’m experiencing an issue with the directory server cache, which first occurred in version 23 and is now also happening in version 24.

Every time I manually try to refresh the cache, I encounter the following error:

 Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 469, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 511, in __run_body
    rv = await self.method(*args)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 187, in nf
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/directoryservices.py", line 221, in cache_refresh
    return await job.wrap(await self.middleware.call('dscache.refresh'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 650, in wrap
    return await subjob.wait(raise_error=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 417, in wait
    raise self.exc_info[1]
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 469, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 511, in __run_body
    rv = await self.method(*args)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/cache.py", line 391, in refresh
    await job.wrap(await self.middleware.call(f'{ds}.fill_cache', True))
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 650, in wrap
    return await subjob.wait(raise_error=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 419, in wait
    raise CallError(self.error)
middlewared.service_exception.CallError: [EFAULT] 'S-1-5-21-908885402-2246502048-2873782898'

Since the cache cannot be built, I’m unable to select groups or users to set up SMB ACLs. I frequently have to leave and rejoin the domain, which is inconvenient. As soon as I click the button to rebuild the cache, all the users and groups disappear again.

Does anyone have advice on how to correct this behavior?

Can you PM me a system debug please.

Thanks for your help. Unfortunately, my profile doesn’t have the “Messages” option under Discourse to send a DM.

@nutrient2314 try again please :slight_smile:

The error with building cache was due to non-default AD parameter being set use_default_domain in combination with local users that had the same name as AD users. I’ll try to get additional error handling for this into the product (but maybe not for 24.04.2).

It’s important for users who decide to strip off the domain component of AD users and groups to ensure that they do not have identically-named local users and groups.

1 Like