Environment
- YugabyteDB Anywhere - All Versions where Manual Provisioning is Used
Issue
Running a task fails with an error on task [Reload daemon]
Caused by: java.lang.RuntimeException: Error occurred. Code: 1. Output: ybops.common.exceptions.YBOpsRuntimeError: Runtime error: Playbook run of yb-server-ctl.yml against XXXXXXXX, failed with return code 2
TASK [Reload daemon] ***********************************************************
Wednesday 04 July 2025 00:00:00 -0400 (0:00:00.000) 0:00:00.000 *******
fatal: [XXXXXXXX]: FAILED! => changed=false
module_stderr: ''
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
This could mean that systemctl --user daemon-reload failed, causing the Ansible Task to fail.
Resolution
Overview
This issue can occur if the the XDG_RUNTIME_DIR variable has not been set in the .bashrc, which should be set to /run/user/{USER_ID}, where USER_ID is the numerical userid from /etc/passwd.
XDG_RUNTIME_DIR is one of the variables setup when you install the pam utility for logging in with systemd.
This can cause systemctl --user daemon-reload to fail (which causes the Ansible runbook to fail when performing a task)
Steps (on each DB node)
1. Ensure that systemd-logind is enabled
systemctl status systemd-logind
Example output if this is enabled:
systemctl status systemd-logind
● systemd-logind.service - User Login Management
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Drop-In: /usr/lib/systemd/system/systemd-logind.service.d
└─10-grub2-logind-service.conf
Active: active (running) since Tue 2025-05-13 15:09:44 UTC; 1 week 6 days ago
Docs: man:sd-login(3)
man:systemd-logind.service(8)
man:logind.conf(5)
man:org.freedesktop.login1(5)
Main PID: 1444 (systemd-logind)
Status: "Processing requests..."
Tasks: 1 (limit: 100413)
Memory: 2.9M
CPU: 3.485s
CGroup: /system.slice/systemd-logind.service
└─1444 /usr/lib/systemd/systemd-logind
2. Ensure that pam_systemd is enabled in /etc/pam.d/system-auth
-session optional pam_systemd.so
3. In your .bashrc for the yugabyte user, set the XDG_RUNTIME_DIR environment variable
export XDG_RUNTIME_DIR=/run/user/$(id -u yugabyte)Additional Information
See documentation on legacy provisioning:
For information on XDG variables, see:
https://specifications.freedesktop.org/basedir-spec/latest/
For information on pam_systemd, see:
https://manpages.ubuntu.com/manpages/xenial/en/man8/pam_systemd.8.html
Comments
0 comments
Please sign in to leave a comment.