Skip to content

TOOLS: noisy debug messages when config.ldb does not exist#8513

Closed
scabrero wants to merge 1 commit intoSSSD:masterfrom
scabrero:scabrero-less-noisy-no-config-db
Closed

TOOLS: noisy debug messages when config.ldb does not exist#8513
scabrero wants to merge 1 commit intoSSSD:masterfrom
scabrero:scabrero-less-noisy-no-config-db

Conversation

@scabrero
Copy link
Contributor

If sss_tool_confdb_init() fails because config.ldb does not exist yet, it will print at level 0:

[sss_cache] [sss_tool_confdb_init] (0x0010): Can't access '/var/lib/sss/db/config.ldb', probably SSSD isn't configured
Can't find configuration db, was SSSD configured and run?

This is too noisy. For example, if shadow is built with sssd support, adding a new user will output these messages because useradd will call sss_cache to invalidate the user cache.

Log with SSSDBG_OP_FAILURE instead of SSSDBG_CRIT_FAILURE.

If sss_tool_confdb_init() fails because config.ldb does not exist yet, it
will print at level 0:

  [sss_cache] [sss_tool_confdb_init] (0x0010): Can't access '/var/lib/sss/db/config.ldb', probably SSSD isn't configured
  Can't find configuration db, was SSSD configured and run?

This is too noisy. For example, if shadow is built with sssd support, adding
a new user will output these messages because useradd will call
sss_cache to invalidate the user cache.

Log with SSSDBG_OP_FAILURE instead of SSSDBG_CRIT_FAILURE.

Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses noisy debug messages that occur when config.ldb does not exist. The changes involve lowering the log level for this condition in src/tools/common/sss_tools.c from SSSDBG_FATAL_FAILURE to SSSDBG_OP_FAILURE, and in src/tools/sss_cache.c from an unconditional ERROR to a conditional DEBUG message with SSSDBG_OP_FAILURE. These modifications will prevent messages from being printed to stderr by default when tools like sss_cache are run on a system where SSSD is not yet configured, which is the intended behavior.

@alexey-tikhonov
Copy link
Member

Hi @scabrero,

if shadow is built with sssd support

This shouldn't be a case on any reasonably modern system.

Since SSSD dropped "files provider" there is no point to build SSSD support in shadow-utils. Moreover, if this support is built, it causes much more harm than spam in logs...

@scabrero
Copy link
Contributor Author

Hi @scabrero,

if shadow is built with sssd support

This shouldn't be a case on any reasonably modern system.

Since SSSD dropped "files provider" there is no point to build SSSD support in shadow-utils. Moreover, if this support is built, it causes much more harm than spam in logs...

right, should I target sssd-2-10 branch? It is deprecated but still available under --with-files-provider.

@alexey-tikhonov
Copy link
Member

right, should I target sssd-2-10 branch? It is deprecated but still available under --with-files-provider.

Would this have a practical value for you?
No upstream release is planned of sssd-2-10 branch.

@scabrero
Copy link
Contributor Author

Would this have a practical value for you?
No upstream release is planned of sssd-2-10 branch.

Mainly to avoid downstream patches but if no new 2.10.x release is planned it doesn't make much sense.

@scabrero scabrero closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants