Bug 2547 - [Anolis 23 Preview][x86_64]yum安装sysak模块需要输入包全名并缺少相关python依赖,使用部分命令会报错
Summary: [Anolis 23 Preview][x86_64]yum安装sysak模块需要输入包全名并缺少相关python依赖,使用部分命令会报错
Status: RESOLVED FIXED
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 23.0
Hardware: aarch64 Linux
: P2-High S2-major
Target Milestone: beta
Assignee: zhaohang
QA Contact:
URL:
Whiteboard:
Keywords:
: 2538 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-25 15:10 UTC by Banana
Modified: 2023-05-04 14:53 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Banana alibaba_cloud_group 2022-10-25 15:10:36 UTC
[问题描述]:
1、yum安装sysak缺少相关python依赖,无法正常安装;
2、解决安装依赖问题,使用部分命令会报错和提示缺少相关依赖。
3、yum安装不能直接输入yum install sysak,需要将sysak包名补全,见安装时报错问题描述。

1、安装时报错:
[root@iZbp14ub0x084rkaiux0ktZ ~]# yum install sysak
Last metadata expiration check: 0:05:52 ago on Tue Oct 25 14:03:43 2022.
No match for argument: sysak
Error: Unable to find a match: sysak
[root@iZbp14ub0x084rkaiux0ktZ ~]# yum list | grep sysak
Failed to set locale, defaulting to C.UTF-8
sysak-5.19.0-1.1.x86_64                                  1.3.0-1.an23                       Plus
[root@iZbp14ub0x084rkaiux0ktZ ~]# yum install sysak-5.19.0-1.1.x86_64
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 1:39:12 ago on Tue Oct 25 11:46:48 2022.
Error:
 Problem: conflicting requests
  - nothing provides /usr/bin/python2 needed by sysak-5.19.0-1.1-1.3.0-1.an23.x86_64
  - nothing provides /usr/bin/python2.7 needed by sysak-5.19.0-1.1-1.3.0-1.an23.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

2、命令执行报错:
[root@VM20190228-125 logs]# sysak list
sysak tools for user self-help analysis
    ossre_client        一键快速诊断当前系统可能存在的已知风险
    sysconf             用于比较2个不同系统或机器的配置差异(sysctl、模块列表、系统启动参数等)
    appscan             扫描运行进程可能存在的性能瓶颈点
    iosdiag             IO存储诊断工具,目前包括IO延迟自动诊断功能以及IO夯诊断或其他功能等等
    loadtask            自动诊断当前或历史系统负载高的原因

If you want to known the detail about the system, please use 'sysak list -a'.
[root@VM20190228-125 logs]# sysak ossre_client
  File "/usr/local/sysak/.sysak_components/tools/ossre_set/ossre.py", line 724
    await = float(line[await_index])
          ^
SyntaxError: invalid syntax
[root@VM20190228-125 logs]# sysak memleak -t
sysak_modules has not been installed, do you want to auto download and install ? Enter Y/N:y
no sysak server config file
sysak_modules not installed, exit ...
[root@VM20190228-125 logs]#


[环境信息]:
内核信息:
# uname -r
5.10.134-12.1.an23.x86_64

操作系统信息:
# cat /etc/os-release
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"


[问题发生概率]:必现

[复现步骤]:
1、yum安装sysak缺少相关python依赖,无法正常安装;
yum list | grep sysak
yum install -y sysak + 版本号
2、解决安装依赖问题,使用部分命令会报错和提示缺少相关依赖。
解决安装依赖问题为前提,安装成功后执行:
sysak ossre_client
sysak memleak -t
3、yum安装不能直接输入yum install sysak,需要将sysak包名补全
yum install -y sysak
yum list | grep sysak
yum install -y sysak + 版本号
Comment 1 bolong_tbl alibaba_cloud_group 2022-10-25 15:32:17 UTC
*** Bug 2538 has been marked as a duplicate of this bug. ***
Comment 2 xuchunmei alibaba_cloud_group 2022-10-27 14:13:06 UTC
sysak与内核版本相关联,所以需要输入内核相关的版本号。

sysak当前还有部分脚本依赖了python2,而Anolis OS 23确定不会再支持python2,当前sysak在整改中。
Comment 3 zhaohang alibaba_cloud_group 2022-10-27 15:56:35 UTC
sysak-5.19.0-1.1.x86_64是适配内核5.19.0-1.1的版本,在5.10.134-12.1.an23.x86_64上不适用。
Comment 4 zhaohang alibaba_cloud_group 2022-10-27 16:30:18 UTC
sysak memleak -t这个命令报错是因为sysak涉及内核模块,sysak-5.19.0-1.1.x86_64只包含了5.19.0的ko,在5.10上会找不到5.10的ko,所以会提示没有找到sysak_modules。
Comment 5 bolong_tbl alibaba_cloud_group 2022-10-27 16:46:03 UTC
Anolis23默认内核采用5.10,也需要支持5.10内核
Comment 6 xuchunmei alibaba_cloud_group 2022-11-02 09:56:42 UTC
已提供针对5.10内核的sysak版本:	sysak-5.10.134-12.1-1.3.0-1.an23.x86_64.rpm
Comment 7 Banana alibaba_cloud_group 2022-11-03 14:32:58 UTC
最新版本里面已经新增5.10内核sysak版本,正常安装没问题。

简单测试几个命令发现如下问题(sysak版本:sysak-5.10.134-12.1.x86_64):
1、no sysak server config file
[root@localhost anuser]# sysak -help
-help has not been installed, do you want to auto download and install ? Enter Y/N:y
no sysak server config file
no components, you should get first

[root@localhost anuser]# sysak ossre_client -p
ossre_client has not been installed, do you want to auto download and install ? Enter Y/N:Y
no sysak server config file
no components, you should get first

2、执行:sysak memleak -t slab,强制停止,再次执行
[root@localhost anuser]# sysak memleak -t slab
type 1
wait for 300 seconds
^Crmmod: ERROR: Module sysak is in use     # 强制结束掉了命令

[root@localhost anuser]# sysak memleak -t slab
type 1
ioctl error

疑似泄漏函数: 未知
rmmod: ERROR: Module sysak is in use

3、
[root@localhost anuser]# sysak sysmonitor -c 2
/usr/local/sysak/.sysak_components/tools/sysmonitor: line 30: perf: command not found

4、
[root@localhost anuser]# sysak loadtask -s
/usr/local/sysak/.sysak_components/tools/loadtask: line 241: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 241: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 246: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 246: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 249: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 249: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 259: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 259: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 266: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 266: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 271: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 271: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 289: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 289: [: -eq: unary operator expected
/usr/local/sysak/.sysak_components/tools/loadtask: line 292: bc: command not found
/usr/local/sysak/.sysak_components/tools/loadtask: line 292: [: -eq: unary operator expected
load reason: mixed press by high  and  wait
top load tasks:
      1 taskstate
Comment 8 happy_orange alibaba_cloud_group 2022-11-03 15:25:52 UTC
1. help 的使用方式:
Usage: sysak [cmd] [subcmd [cmdargs]]
       cmd:
              list [-a], show subcmds
              help, help information for specify subcmd
       subcmd: see the result of list

2. 执行:sysak memleak -t slab,强制停止,再次执行
这个本身会执行监控系统 300s 的动作,强行停止只是停止了用户态的动作,内核态的仍在运行。

3、sysak sysmonitor -c 2

sysak 运行依赖需要添加上 sysstat 和 perf, 同时我们会去排查其他的运行依赖是否没写入。

这个运行提示:
expr: syntax error: unexpected argument ‘20’
/usr/local/sysak/.sysak_components/tools/sysmonitor: line 29: [: -eq: unary operator expected

需要 zhaohang 继续定位,这里 /usr/local/sysak/.sysak_components/tools/sysmonitor 中 sys_util 未读取出来

4、[root@localhost anuser]# sysak loadtask -s 缺少bc 软件,正在引入
https://gitee.com/src-anolis-os/bc/pulls/4
Comment 9 happy_orange alibaba_cloud_group 2022-11-03 15:27:33 UTC
[root@iZbp11aoixmc85tz24lj8dZ ~]# sysak help
Usage: sysak [cmd] [subcmd [cmdargs]]
       cmd:
              list [-a], show subcmds
              help, help information for specify subcmd
       subcmd: see the result of list
Comment 10 happy_orange alibaba_cloud_group 2022-11-03 15:29:25 UTC
其他子模块使用 help:
[root@iZbp11aoixmc85tz24lj8dZ ~]# sysak nosched -h
  Usage: sysak nosched [OPTIONS]
  Options:
  -t THRESH_TIME       specify the threshold time(ms), default=10ms
  -f result.log        result file, default is /var/log/sysak/nosched.log
  -s TIME              specify how long to run
  -S shmkey            record the result as summary mod
Comment 11 Banana alibaba_cloud_group 2022-11-03 17:56:30 UTC
1、help命令问题,规范为sysak help,子模块的帮助命令规范为sysak [module] -h,按照常用规范一般为 -h -help,不过这个不影响。
但是希望输入错误命令的时候提示当前层级的help信息,这样更为合理,或者提示错误,请输入sysak help or Usage查看详细信息。如:
A:sysak -b
返回以下帮助信息:
Usage: sysak [cmd] [subcmd [cmdargs]]
       cmd:
              list [-a], show subcmds
              help, help information for specify subcmd
       subcmd: see the result of list

A:sysak sysconf -a
返回以下帮助信息:
usage: sys_conf <option> [<args>]
sysak sys_conf: compare the differences between the old and new kernel version
all config file in /var/log/sysak/sysconf
options: -h             help information
         -c <version>   check old version system config
         -g             collect current verion system config
         -d             diff specify config with present system config
         -p             diff specify configs

2、sysak sysconf模块输入不支持的参数命令,无输出,建议保持与第一条一致。
如:sysak sysconf -a,无返回结果。

3、sysak sysconf -h 命令最后几行有点问题。
usage: sys_conf <option> [<args>]
sysak sys_conf: compare the differences between the old and new kernel version
all config file in /var/log/sysak/sysconf
options: -h             help information
         -c <version>   check old version system config
         -g             collect current verion system config
         -d             diff specify config with present system config
         -p             diff specify configs
example: check old version config and output config different
./sys_config -c 4.19.91-24.al7.x86_64 -d
./sys_config -p 4.19.91-24.al7.x86_64 4.19.91-23.al7.x86_64
Comment 12 zhaohang alibaba_cloud_group 2022-11-07 11:52:13 UTC
"2. 执行:sysak memleak -t slab,强制停止,再次执行
这个本身会执行监控系统 300s 的动作,强行停止只是停止了用户态的动作,内核态的仍在运行。"
这个是符合预期的,memleak触发了诊断,涉及内核模块的操作,诊断需要5分钟,即使用户态工具退出后,在诊断期间内,再次触发会有这个提示。
Comment 13 zhaohang alibaba_cloud_group 2022-11-11 11:03:38 UTC
已添加sysstat和perf运行依赖。
Comment 14 happy_orange alibaba_cloud_group 2023-05-04 14:53:12 UTC
在 sysak 的 2.0.0 版本中已经实现去除对 kernel 版本的依赖,并且支持通过 yum install sysak 来安装 sysak,并且去除了 python2 的运行依赖。
构建地址:http://build.openanolis.cn/koji/taskinfo?taskID=609301