Bug 2210855

Summary: 'pcs resource move' does not work
Product: Red Hat Enterprise Linux 9 Reporter: Nina Hostakova <nhostako>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 9.3CC: cluster-maint, idevat, jrehova, mlisik, mmazoure, mpospisi, omular, tojeline
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.11.5-2.el9 Doc Type: No Doc Update
Doc Text:
The affected packages have not been released.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:23:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nina Hostakova 2023-05-29 18:36:16 UTC
Description of problem:
Moving a resource (in constraint autodelete mode)ends up with the traceback shown below 

Version-Release number of selected component (if applicable):
pcs-0.11.5-1.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1.# pcs resource
  * d	(ocf:pacemaker:Dummy):	 Started virt-281
2.# pcs resource move d
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 33, in <module>
    sys.exit(load_entry_point('pcs==0.11.5+3e479bdb', 'console_scripts', 'pcs')())
  File "/usr/lib/python3.9/site-packages/pcs/app.py", line 271, in main
    routing.create_router(cmd_map, [])(
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/routing.py", line 33, in _router
    return cmd_map[sub_cmd](lib, argv_next, modifiers)
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/routing.py", line 33, in _router
    return cmd_map[sub_cmd](lib, argv_next, modifiers)
  File "/usr/lib/python3.9/site-packages/pcs/resource.py", line 849, in resource_move
    lib.resource.move_autoclean(
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/lib_wrapper.py", line 89, in decorated_run
    return run_with_middleware(run, cli_env, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/middleware.py", line 14, in run
    return next_in_line(env, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/middleware.py", line 42, in apply
    result_of_next = next_in_line(env, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/middleware.py", line 80, in apply
    result_of_next = next_in_line(env, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pcs/cli/common/lib_wrapper.py", line 80, in run
    lib_call_result = run_library_command(lib_env, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pcs/lib/commands/resource.py", line 1823, in move_autoclean
    _, move_transitions, after_move_simulated_cib = simulate_cib(
  File "/usr/lib/python3.9/site-packages/pcs/lib/pacemaker/live.py", line 426, in simulate_cib
    plaintext_result, transitions_xml, new_cib_xml = simulate_cib_xml(
  File "/usr/lib/python3.9/site-packages/pcs/lib/pacemaker/live.py", line 387, in simulate_cib_xml
    with tools.get_tmp_file() as new_cib_file, tools.get_tmp_file() as transitions_file:
  File "/usr/lib64/python3.9/contextlib.py", line 263, in helper
    return _GeneratorContextManager(func, args, kwds)
  File "/usr/lib64/python3.9/contextlib.py", line 87, in __init__
    self.gen = func(*args, **kwds)
TypeError: get_tmp_file() missing 1 required positional argument: 'data'

Comment 2 Tomas Jelinek 2023-05-30 14:27:23 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/2ab9e9c4fd1f26e5320c7585a83ba5d1857d4042

Test:
# pcs resource
  * d1  (ocf:pacemaker:Dummy):   Started rh92-node1
# pcs resource move d1
Location constraint to move resource 'd1' has been created
Waiting for the cluster to apply configuration changes...
Location constraint created to move resource 'd1' has been removed
Waiting for the cluster to apply configuration changes...
resource 'd1' is running on node 'rh92-node2'
# echo $?
0
# pcs resource
  * d1  (ocf:pacemaker:Dummy):   Started rh92-node2

Comment 3 Michal Pospisil 2023-05-31 14:16:32 UTC
DevTestResults:

[root@r09-03-b ~]# pcs resource move r1 r09-03-b.vm
Location constraint to move resource 'r1' has been created
Waiting for the cluster to apply configuration changes...
Location constraint created to move resource 'r1' has been removed
Waiting for the cluster to apply configuration changes...
resource 'r1' is running on node 'r09-03-b.vm'

Comment 10 errata-xmlrpc 2023-11-07 08:23:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: pcs security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6316