Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: bootstrapping a single node cluster in a stopped cluster results in a "UserNotFoundError" #1634

Open
zzhou1 opened this issue Dec 17, 2024 · 1 comment

Comments

@zzhou1
Copy link
Contributor

zzhou1 commented Dec 17, 2024

Reproducer:

adm@tws-corosync3-1:~> sudo -E crm cluster stop --all
adm@tws-corosync3-1:~> sudo rm /var/lib/pacemaker/cib/cib.xml
adm@tws-corosync3-1:~> sudo -E crm cluster init --use-ssh-agent -ys /dev/disk/by-partlabel/sbd-tws-c3 -N adm@tws-corosync3-2

adm@tws-corosync3-1:~> sudo -E crm cluster stop --all
adm@tws-corosync3-1:~> sudo crm cluster init -ys /dev/disk/by-partlabel/sbd-tws-c3

INFO: Already synced /etc/sysconfig/sbd to all nodes
ERROR: cluster.init:                                       
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/crmsh/ui_context.py", line 93, in run
    rv = self.execute_command() is not False
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/ui_context.py", line 278, in execute_command
    rv = self.command_info.function(*arglist)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/ui_cluster.py", line 472, in do_init
    bootstrap.bootstrap_init(boot_context)
  File "/usr/local/lib/python3.11/site-packages/crmsh/bootstrap.py", line 2209, in bootstrap_init
    init_sbd()                                             
  File "/usr/local/lib/python3.11/site-packages/crmsh/bootstrap.py", line 1409, in init_sbd
    _context.sbd_manager.init_and_deploy_sbd()
  File "/usr/local/lib/python3.11/site-packages/crmsh/sbd.py", line 686, in init_and_deploy_sbd
    SBDManager.enable_sbd_service()
  File "/usr/local/lib/python3.11/site-packages/crmsh/sbd.py", line 539, in enable_sbd_service
    if not service_manager.service_is_enabled(constants.SBD_SERVICE, node):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/service_manager.py", line 25, in service_is_enabled
    return 0 == self._run_on_single_host("systemctl is-enabled '{}'".format(name), remote_addr)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/service_manager.py", line 60, in _run_on_single_host
    rc, _, _ = self._shell.get_rc_stdout_stderr_without_input(host, cmd)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/sh.py", line 384, in get_rc_stdout_stderr_without_input
    rc, stdout, stderr = self.get_rc_stdout_stderr_raw_without_input(host, cmd)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/sh.py", line 376, in get_rc_stdout_stderr_raw_without_input
    result = self.subprocess_run_without_input(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/sh.py", line 341, in subprocess_run_without_input
    local_user, remote_user = self.user_of_host.user_pair_for_ssh(host)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/crmsh/user_of_host.py", line 67, in user_pair_for_ssh
    raise UserNotFoundError from None
crmsh.user_of_host.UserNotFoundError

@zzhou1 zzhou1 changed the title Regression: to bootstrap a single node cluster in a stopped cluster with "UserNotFoundError" Regression: bootstrapping a single node cluster in a stopped cluster results in a "UserNotFoundError" Dec 18, 2024
@liangxin1300
Copy link
Collaborator

liangxin1300 commented Jan 1, 2025

Can't reproduce for me:

adm@alp-1:~> rpm -q crmsh
crmsh-5.0.0+20241209.20981523-1.1.noarch
adm@alp-1:~> history 
    4  sudo -E crm cluster init --use-ssh-agent -ys /dev/sda5 -N adm@alp-2
    5  sudo -E crm cluster stop --all
    6  sudo crm cluster init -ys /dev/sda6

Not raise UserNotFoundError

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

No branches or pull requests

2 participants