[Bug]: obdiag gather all 命令报错 ,AttributeError: 'SshHelper' object has no attribute '_sftp_client'
Describe the bug
版本: [root@ob02 ~]# obdiag --version OceanBase Diagnostic Tool: 2.1.0 BUILD_TIME: Mon May 13 14:48:28 UTC 2024 Copyright (C) 2022 OceanBase License Mulan PSL v2: http://license.coscl.org.cn/MulanPSL2. You can use this software according to the terms and conditions of the Mulan PSL v2. There is NO WARRANTY, to the extent permitted by law.
服务器: [root@ob02 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) x86_64架构
错误信息:
[root@ob02 ~]# obdiag gather all gather_all start ... Download :/tmp/sysstat_20240517022256.zip Downloading [====================] 100.0% [64.41 KB ] Download ***:/tmp/sysstat***_20240517022259.zip Downloading [====================] 100.0% [66.00 KB ]
Gather Sysstat Summary: +---------------+-----------+---------+--------+-----------------------------------------------------------------------+ | Node | Status | Size | Time | PackPath | +===============+===========+=========+========+=======================================================================+ | | Completed | 64.409K | 2 s | ./gather_pack_20240517022256/sysstat_20240517022256.zip | +---------------+-----------+---------+--------+-----------------------------------------------------------------------+ | ***| Completed | 66.002K | 4 s | ./gather_pack_20240517022256/sysstat***_20240517022259.zip | +---------------+-----------+---------+--------+-----------------------------------------------------------------------+ [ERROR] Running Error: expected str, bytes or os.PathLike object, not dict Trace ID: 5f6be6d2-13f4-11ef-ad0f-02000aba3893 If you want to view detailed obdiag logs, please run: obdiag display-trace 5f6be6d2-13f4-11ef-ad0f-02000aba3893 Exception ignored in: <function SshHelper.del at 0x7fcc26a91ca0> Traceback (most recent call last): File "common/ssh.py", line 1061, in del AttributeError: 'SshHelper' object has no attribute '_sftp_client'
具体的run trace :run: obdiag display-trace 5f6be6d2-13f4-11ef-ad0f-02000aba3893 ... [2024-05-17 02:23:05.216] [DEBUG] root [2024-05-17 02:23:05.216] [DEBUG] ] [2024-05-17 02:23:05.216] [DEBUG] - get observer execute user, run cmd = [ps -o ruser=userForLongName -e -o pid,ppid,c,stime,tty,time,cmd | grep observer | grep 3393 | awk '{print $1}'], result:admin [2024-05-17 02:23:05.217] [ERROR] Running Error: expected str, bytes or os.PathLike object, not dict [2024-05-17 02:23:05.217] [ERROR] Traceback (most recent call last): [2024-05-17 02:23:05.217] [ERROR] File "cmd.py", line 235, in do_command [2024-05-17 02:23:05.217] [ERROR] File "cmd.py", line 357, in _do_command [2024-05-17 02:23:05.217] [ERROR] File "core.py", line 240, in gather_function [2024-05-17 02:23:05.217] [ERROR] File "handler/gather/gather_obstack2.py", line 106, in handle [2024-05-17 02:23:05.217] [ERROR] File "handler/gather/gather_obstack2.py", line 95, in handle_from_node [2024-05-17 02:23:05.217] [ERROR] File "handler/gather/gather_obstack2.py", line 181, in __handle_from_node [2024-05-17 02:23:05.217] [ERROR] File "handler/gather/gather_obstack2.py", line 259, in __gather_obstack2_info [2024-05-17 02:23:05.217] [ERROR] File "common/ssh.py", line 835, in init [2024-05-17 02:23:05.217] [ERROR] File "posixpath.py", line 231, in expanduser [2024-05-17 02:23:05.217] [ERROR] TypeError: expected str, bytes or os.PathLike object, not dict [2024-05-17 02:23:05.217] [ERROR] [2024-05-17 02:23:05.217] [INFO] Trace ID: 5f6be6d2-13f4-11ef-ad0f-02000aba3893 [2024-05-17 02:23:05.217] [INFO] If you want to view detailed obdiag logs, please run: obdiag display-trace 5f6be6d2-13f4-11ef-ad0f-02000aba3893
Environment
Test
Fast reproduce steps
see above commnets
Expected behavior
fixe the issue
Actual behavior
No response
Additional context
No response
收集obstack的时候切换用户导致ssh信息丢失而报错