ocp4.0.3添加主机失败

【 使用环境 】生产环境
【 OB or 其他组件 】
社区版
ob4.1.0
ocp4.0.3
系统Anolis 8.8
【 使用版本 】
【问题描述】ocp4.0.3添加主机失败
提示信息:"/usr/bin/python 被 t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64 需要"

详情如下:

2023-04-27 18:31:42.825 ERROR 11 --- [pool-manual-subtask-executor12,f649e7b43a074377,0572a41ebd6d] c.o.ocp.executor.executor.SshExecutor    : failed to execute ssh command, errMsg:command failed, args:/tmp/a9ebcd14fc4745e3/pos.py install_package /tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm, return code:1, output:failed to call pos: func=install_package, args=['/tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm'], code=1, output=错误:依赖检测失败:
	/usr/bin/python 被 t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64 需要, extOut:null. cause:null

2023-04-27 18:31:42.829  WARN 11 --- [pool-manual-subtask-executor12,f649e7b43a074377,0572a41ebd6d] c.o.o.c.t.engine.runner.RunnerFactory    : Execute task failed, subtask=SubtaskInstanceOverview{id=155, name=Install ocp agent, state=FAILED, operation=RETRY, className=com.oceanbase.ocp.service.task.business.host.InstallOcpAgentTask, seriesId=0, startTime=2023-04-27T18:28:36.649+08:00, endTime=null}

com.oceanbase.ocp.executor.exception.SshCommandFailedException: failed to execute ssh command, errMsg:command failed, args:/tmp/a9ebcd14fc4745e3/pos.py install_package /tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm, return code:1, output:failed to call pos: func=install_package, args=['/tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm'], code=1, output=错误:依赖检测失败:
	/usr/bin/python 被 t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64 需要, extOut:null. cause:null
	at com.oceanbase.ocp.executor.executor.SshExecutor.execute(SshExecutor.java:410) ~[command-executor-4.0.3-20230301.jar!/:4.0.3-20230301]
	at com.oceanbase.ocp.executor.executor.SshExecutor.callPosMethod(SshExecutor.java:390) ~[command-executor-4.0.3-20230301.jar!/:4.0.3-20230301]
	at com.oceanbase.ocp.executor.executor.SshExecutor.installPackage(SshExecutor.java:335) ~[command-executor-4.0.3-20230301.jar!/:4.0.3-20230301]
	at com.oceanbase.ocp.executor.executor.SshExecutor.installPackage(SshExecutor.java:215) ~[command-executor-4.0.3-20230301.jar!/:4.0.3-20230301]
	at com.oceanbase.ocp.service.task.business.host.OcpAgentInstallationTaskService.installOcpAgentRpm(OcpAgentInstallationTaskService.java:204) ~[ocp-service-4.0.3-20230301.jar!/:4.0.3-20230301]
	at com.oceanbase.ocp.service.task.business.host.OcpAgentInstallationTaskService$$FastClassBySpringCGLIB$$c5ca7463.invoke(<generated>) ~[ocp-service-4.0.3-20230301.jar!/:4.0.3-20230301]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.23.jar!/:5.3.23]
	at org.springframework.aop.framework.CglibAopPr
oxy.invokeMethod(CglibAopProxy.java:386) ~[spring-aop-5.3.23.jar!/:5.3.23]
	at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.23.jar!/:5.3.23]

python2环境也已经安装

# /usr/bin/python --version
Python 2.7.18

【复现路径】问题出现前后相关操作
【问题现象及影响】

【附件】

检查脚本,执行安装命令均正常,测试执行上述命令,问题复现,程序中执行安装未调用python命令,需要查看下代码确认。

root@sc1ob01 ~]# /tmp/e4e5385f66a546b2/pos.py install_package /tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm
failed to call pos: func=install_package, args=[’/tmp//t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm’], code=1, output=错误:依赖检测失败:
/usr/bin/python 被 t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64 需要

python2是我手动安装的,而且默认没有/usr/bin/python是我做的软连接

ln -s /usr/bin/python2 /usr/bin/python

软连接是没问题的。

应该是软连接python依赖的问题,只要执行路径有python2就没问题

路径有python2,不知道这个缺失/usr/bin/python逻辑是怎么判断的

问题已确认,龙蜥系统使用这个包t-oceanbase-ocp-agent-4.0.3-20230412103152.alios7.x86_64.rpm会有这个问题,具体原因还在排查中。

这个问题解决了吗?有临时的解决方案吗?
安装了Python27 ,创建了 /usr/bin/python 软连接,问题依旧。

换版本完事…

对换个版本就好了,这个版本的ocp-agent有问题