ClusterLabs / crmsh

Command-line interface for High-Availability cluster management on GNU/Linux systems.
GNU General Public License v2.0
131 stars 94 forks source link

`crm node list` sometimes fails with TypeError: '<' not supported between instances of 'NoneType' and 'str' #764

Closed lourot closed 1 year ago

lourot commented 3 years ago

After removing and re-adding nodes to the cluster, in rare cases crm node list fails with

  File "/usr/sbin/crm", line 46, in <module>
    rc = main.run()
  File "/usr/lib/python3/dist-packages/crmsh/main.py", line 369, in run
    return main_input_loop(context, user_args)
  File "/usr/lib/python3/dist-packages/crmsh/main.py", line 249, in main_input_loop
    rc = handle_noninteractive_use(context, user_args)
  File "/usr/lib/python3/dist-packages/crmsh/main.py", line 205, in handle_noninteractive_use
    if context.run(' '.join(l)):
  File "/usr/lib/python3/dist-packages/crmsh/ui_context.py", line 86, in run
    rv = self.execute_command() is not False
  File "/usr/lib/python3/dist-packages/crmsh/ui_context.py", line 276, in execute_command
    rv = self.command_info.function(*arglist)
  File "/usr/lib/python3/dist-packages/crmsh/ui_node.py", line 288, in do_show
    for uname in sorted(all_nodes):
TypeError: '<' not supported between instances of 'NoneType' and 'str'

I'm not sure what's wrong but I suspect we could just catch this special case and let the script move on?

liangxin1300 commented 3 years ago

Hi @AurelienLourot Which version do you use?

lourot commented 3 years ago

Thanks for the quick reply! We are apt-installing crmsh on Ubuntu 20.10 and this ends up installing version 4.2.0-3ubuntu1 of that package.

liangxin1300 commented 3 years ago

@AurelienLourot I highly doubt this has related with this pacemaker issue https://github.com/ClusterLabs/pacemaker/pull/2291 Let me try to reproduce and prove it