Skip to content

Commit aba20a5

Browse files
committed
Add debug logging to saving of user profiles
We have recently observed CI failures such as ``` error: Failed to create sync archive [1]: tar: var/check_mk/web/agent_registrar/automation.secret: file changed as we read it ``` These failures seem to be caused by some other process editing the profile files of non-exisiting users (the `agent_registrar` user doesn't exist anymore when the failure happens). The `save_users` function might be the call site causing the issue. Since we are currently out of other ideas, we add some debug logging to verify this assumption in case the failure re-occurs. Change-Id: Ie42855a4e5aafaf7e6f791e65ca07ad646df8d41
1 parent 26f2a63 commit aba20a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmk/gui/userdb/store.py

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from cmk.gui.hooks import request_memoize
3737
from cmk.gui.htmllib.html import html
3838
from cmk.gui.i18n import _
39+
from cmk.gui.log import logger
3940
from cmk.gui.logged_in import LoggedInUser, save_user_file
4041
from cmk.gui.type_defs import (
4142
SessionInfo,
@@ -359,6 +360,8 @@ def split_dict(d: Mapping[str, Any], keylist: list[str], positive: bool) -> dict
359360

360361

361362
def save_users(profiles: Users, now: datetime) -> None:
363+
logger.debug(f"Saving the profiles of the following users: {', '.join(sorted(profiles))}")
364+
362365
write_contacts_and_users_file(profiles)
363366

364367
# Execute user connector save hooks

0 commit comments

Comments
 (0)