Environment
- Yugabyte Anywhere: 2024.2.6.0 and earlier
Issue
Tasks (such as Backup or Upgrade) fail in YugabyteDB Anywhere (YBA) after upgrading YBA to version 2024.2.6.0. The error message observed in the YBA logs indicates an undefined variable systemd_prefix in the yb-server-ctl.yml file.
Error snippet:
- fatal: [172.16.236.116]: FAILED! => - msg: |- - The task includes an option with an undefined variable. The error was: 'systemd_prefix' is undefined - - The error appears to be in '/opt/ybanywhere/software/2024.2.6.0-b94/yba_installer/packages/yugabyte-2024.2.6.0-b94/devops/yb-server-ctl.yml': line 68, column 13, but may - be elsewhere in the file depending on the exact syntax problem.
Cause
This issue is caused by a regression in YBA version 2024.2.6.0. The logic for determining the systemd command prefix mistakenly assumes that all universes use user-level systemd. However, some configurations (especially older universes or specific OS setups) still require running systemctl against global services.
The fix involves modifying the Ansible playbook yb-server-ctl.yml on the YBA node to correctly handle cases where user-level systemd is not present, falling back to sudo systemctl.
This issue is resolved in YBA version 2024.2.7.0. Use the workaround below if you are on 2024.2.6.0.
Solution
Steps
1. SSH into the YBA node.
2. Locate the yb-server-ctl.yml file: Navigate to the directory containing the playbook. Replace <running-yba-version> with your specific version (e.g., 2024.2.6.0-b94).
cd /opt/yugabyte/software/<running-yba-version>/yba_installer/packages/yugabyte-<running-yba-version>/devops/
3. Backup the file: Before making changes, create a backup of the file.
cp yb-server-ctl.yml yb-server-ctl.yml.bak
4. Edit the file: Open yb-server-ctl.yml using a text editor (e.g., vi or nano).
vi yb-server-ctl.yml
5. Locate the problematic block: Find the task named "Set the systemd prefix for user level". It will look similar to this:
- name: Set the systemd prefix for user level
set_fact:
systemd_prefix: "{{ systemd_log_level }}systemctl --user"
when: systemd_user.stat.exists6. Apply the fix: Modify the block to handle the else condition. Change the set_fact logic to:
- name: Set the systemd prefix for user level
set_fact:
systemd_prefix: "{{ systemd_log_level }}{{ 'systemctl --user' if systemd_user.stat.exists else 'sudo systemctl'}}"Note: Ensure that the indentation is correct (YAML is whitespace-sensitive).
7. Save and Exit.
8. Retry the Task.
Reference ID: SUPPORT-851
Comments
0 comments
Article is closed for comments.