【 使用环境 】测试环境
【 OCP 】
【 使用版本 】社区版4.0
【问题描述】ocp平台正常安装并无报错,在安装完成登入平台后,不管是添加主机还是接管集群任务时,在Uninstall legacy ocp agent步骤都会出现以下报错
ERROR 43 — [pool-manual-subtask-executor16,f6b3aff2fce94a60,4357804cb100] c.o.ocp.executor.executor.SshExecutor : failed to execute ssh command, errMsg:command failed, args:/tmp/32a7fae0de194d4b/pos.py uninstall_package ^t-oceanbase-ocp-agent, return code:2, output:failed to call pos: func=uninstall_package, args=[’^t-oceanbase-ocp-agent’], code=2, output=/tmp/a67e956c-d8f7-11ed-9067-fefcfe54350b: line 1: unexpected EOF while looking for matching `’’
以下为某次任务的task日志:
log_task_1359.zip (6.7 KB)
稍等,我找相关同学看下
操作系统是什么呢,可以在对应主机上调用一下这个命令看看,输出是什么
操作系统是Centos7.9,执行命令如下
[root@oceandb1 ~]# /tmp/32a7fae0de194d4b/pos.py uninstall_package ^t-oceanbase-ocp-agent
failed to call pos: func=uninstall_package, args=[’^t-oceanbase-ocp-agent’], code=2, output=/tmp/13d8362e-d905-11ed-8a2a-fefcfe54350b: line 1: unexpected EOF while looking for matching `’’
/tmp/13d8362e-d905-11ed-8a2a-fefcfe54350b: line 2: syntax error: unexpected end of file
cp /tmp/13d8362e-d905-11ed-8a2a-fefcfe54350b ./pos.py
python2 -c ‘import pos; print pos.get_os_type()’
这样执行一下,看下输出的结果呢,有可能os判断会出错
python命令有正常值返回
[root@oceandb1 32a7fae0de194d4b]# python2 -c ‘import pos; print pos.get_os_type()’
debian
是不是执行命令时输出了中文
返回了debian
感谢老哥提供问题解决思路,问题已解决,在python里调试一下脚本,在执行packages = filter(lambda p: len(p) > 0, find_package(keyword).strip().split("\n")),packages 返回的值为"dpkg: can’t open ‘/var/lib/dpkg/status’: No such file or directory",因此定位到dpkg没有安装,在yum安装dpkg后,已经正常接管