openspug / spug

开源运维平台:面向中小型企业设计的轻量级无Agent的自动化运维平台,整合了主机管理、主机批量执行、主机在线终端、文件在线上传下载、应用发布部署、在线任务计划、配置中心、监控、报警等一系列功能。
https://spug.cc
GNU Affero General Public License v3.0
10.23k stars 2.06k forks source link

Bug: 新版zsh支持问题 #386

Open czy opened 3 years ago

czy commented 3 years ago

Spug 版本: >= v3.0.1-beta.8

问题重现步骤

  1. 使用v3.0.1-beta.7版本发布正常
  2. 使用>=v3.0.1-beta.8版本发布报错

报错/问题截图

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/python/3.9.5/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/python/3.9.5/lib/python3.9/threading.py", line 892, in run self._target(*self._args, *self._kwargs) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 54, in dispatch raise e File "/home/git/spug/spug_api/apps/deploy/utils.py", line 48, in dispatch _ext1_deploy(req, helper, env) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 94, in _ext1_deploy raise latest_exception File "/usr/local/python/3.9.5/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 237, in _deploy_ext1_host helper.remote(host.id, ssh, command) File "/home/git/spug/spug_api/apps/deploy/helper.py", line 203, in remote for code, out in ssh.exec_command_with_stream(command, environment=env): File "/home/git/spug/spug_api/libs/ssh.py", line 101, in exec_command_with_stream channel = self._get_channel() File "/home/git/spug/spug_api/libs/ssh.py", line 152, in _get_channel raise Exception('Wait spug response timeout') Exception: Wait spug response timeout

期望的结果

望修复ssh.py以支持zsh

vapao commented 3 years ago

你现在的版本是多少呢? 最新的已经优化过这个问题了。

vapao commented 3 years ago

目前最新版本 v3.0.1-beta.12

czy commented 3 years ago

目前最新版本 v3.0.1-beta.12

image

我用的就是这个版本有问题,报错的信息能对上该版本的源码。

vapao commented 2 years ago

已发布 v3.0.1-beta.13 可以测试验证下。

czy commented 2 years ago

image 发布后任务是执行一个shell脚本,手动登录zsh执行是没问题的。

版本:v3.0.1-beta.14 还是同一个错误,只是出错行变了。 Traceback (most recent call last): File "/usr/local/python/3.9.5/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/python/3.9.5/lib/python3.9/threading.py", line 892, in run self._target(*self._args, *self._kwargs) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 54, in dispatch raise e File "/home/git/spug/spug_api/apps/deploy/utils.py", line 48, in dispatch _ext1_deploy(req, helper, env) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 101, in _ext1_deploy raise latest_exception File "/usr/local/python/3.9.5/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "/home/git/spug/spug_api/apps/deploy/utils.py", line 244, in _deploy_ext1_host helper.remote(host.id, ssh, command) File "/home/git/spug/spug_api/apps/deploy/helper.py", line 250, in remote for code, out in ssh.exec_command_with_stream(command, environment=env): File "/home/git/spug/spug_api/libs/ssh.py", line 99, in exec_command_with_stream channel = self._get_channel() File "/home/git/spug/spug_api/libs/ssh.py", line 154, in _get_channel raise Exception('Wait spug response timeout') Exception: Wait spug response timeout

vapao commented 2 years ago

这个问题能复现吗, 每次执行都会出现? 目标主机是什么操作系统 哪个版本?

czy commented 2 years ago

这个问题能复现吗, 每次执行都会出现? 目标主机是什么操作系统 哪个版本?

每次必复现,目标主机是阿里云的CentOS系统: CentOS Linux release 7.9.2009 (Core) 3.10.0-1160.45.1.el7.x86_64

zsh版本:zsh 5.8 (x86_64-pc-linux-gnu)

不过影响不大,生产环境用不用zsh都行