New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.4 跳板机一段时间无操作会卡死 #744

Closed
cnflyne opened this Issue Sep 30, 2017 · 17 comments

Comments

Projects
None yet
3 participants
@cnflyne

cnflyne commented Sep 30, 2017

[简述你的问题]

使用版本

0.4.0

问题复现步骤
  1. 登陆跳板机
  2. 去做其他事【中间无交互】
  3. 回来再看看,跳板机卡死
具体表现[截图可能会更好些,最好能截全]

客户端卡死后,过一会儿会自动断开,控制台输出如下

Opt> packet_write_wait: Connection to 182.61.38.179 port 2222: Broken pipe

服务端coco控制台输出如下【日志级别为WARN】:

2017-10-01 00:19:42 [app WARNING] No ssh channel get.
2017-10-01 00:19:58 [app WARNING] No ssh channel get.  ## 注:这儿输出两次是因为我开了两个控制台
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/py3/lib/python3.6/site-packages/jms/tasks.py", line 38, in handler
    self.action(data)
  File "/opt/py3/lib/python3.6/site-packages/jms/service.py", line 353, in send_command_log
    d['output'] = base64.b64encode(d['output']).decode("utf-8")
  File "/usr/local/lib/python3.6/base64.py", line 58, in b64encode
    encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/py3/lib/python3.6/site-packages/jms/tasks.py", line 38, in handler
    self.action(data)
  File "/opt/py3/lib/python3.6/site-packages/jms/service.py", line 353, in send_command_log
    d['output'] = base64.b64encode(d['output']).decode("utf-8")
  File "/usr/local/lib/python3.6/base64.py", line 58, in b64encode
    encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'
其他

如上所示

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Sep 30, 2017

之前类似问题的issue我也看了,但个人觉得问题并没有真正解决。

cnflyne commented Sep 30, 2017

之前类似问题的issue我也看了,但个人觉得问题并没有真正解决。

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 1, 2017

此外,卡死后异常断开,COCO信息中的在线session数不会变少!如下图(当前无ssh连接):

image

cnflyne commented Oct 1, 2017

此外,卡死后异常断开,COCO信息中的在线session数不会变少!如下图(当前无ssh连接):

image

@ibuler ibuler added the bug label Oct 8, 2017

@ibuler ibuler added this to the 0.4.0-stable milestone Oct 8, 2017

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 9, 2017

@ibuler 另外感觉jumpserver有一个问题没解决:

使用sshd登陆服务器时可以配置 sshd_config文件: ClientAliveInterval 60,使sshd服务端每60秒和客户端通信一次,从而保证长时间没操作也能一直保持连接。jumpserver有这样的配置么?

cnflyne commented Oct 9, 2017

@ibuler 另外感觉jumpserver有一个问题没解决:

使用sshd登陆服务器时可以配置 sshd_config文件: ClientAliveInterval 60,使sshd服务端每60秒和客户端通信一次,从而保证长时间没操作也能一直保持连接。jumpserver有这样的配置么?

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 9, 2017

@hellorocky

Paramiko: A Python implementation of SSHv2.

jumpserver底层是用这玩意儿实现的?还有那个 set_keepalive 是在哪配置哟?

cnflyne commented Oct 9, 2017

@hellorocky

Paramiko: A Python implementation of SSHv2.

jumpserver底层是用这玩意儿实现的?还有那个 set_keepalive 是在哪配置哟?

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 10, 2017

@hellorocky

我把 coco/app.py 那一行改成 gss_kex=True 之后,ssh客户端就连不上coco了(一直卡在那)。。coco的日志也没报错。

希望后面这个参数能做成coco的配置。就像sshd_config那样

cnflyne commented Oct 10, 2017

@hellorocky

我把 coco/app.py 那一行改成 gss_kex=True 之后,ssh客户端就连不上coco了(一直卡在那)。。coco的日志也没报错。

希望后面这个参数能做成coco的配置。就像sshd_config那样

@hellorocky

This comment has been minimized.

Show comment
Hide comment
@hellorocky

hellorocky Oct 10, 2017

Contributor

@cnflyne 不知道你想干嘛, 该说的我已经说了

Contributor

hellorocky commented Oct 10, 2017

@cnflyne 不知道你想干嘛, 该说的我已经说了

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 10, 2017

辛苦,可能你回复的有点多忘记上下文了。

我只是想实现 sshd_config 中 ClientAliveInterval 60 这样的功能,但是按照你给的链接,把 coco/app.py 那一行改成 gss_kex=True 之后,ssh客户端就连不上coco了(一直卡在那)。coco的日志也没报错。

所以希望后面COCO后面也能把这个功能放在 config.py 中配置。而不是像现在这样修改app.py的代码。

cnflyne commented Oct 10, 2017

辛苦,可能你回复的有点多忘记上下文了。

我只是想实现 sshd_config 中 ClientAliveInterval 60 这样的功能,但是按照你给的链接,把 coco/app.py 那一行改成 gss_kex=True 之后,ssh客户端就连不上coco了(一直卡在那)。coco的日志也没报错。

所以希望后面COCO后面也能把这个功能放在 config.py 中配置。而不是像现在这样修改app.py的代码。

@hellorocky

This comment has been minimized.

Show comment
Hide comment
@hellorocky

hellorocky Oct 10, 2017

Contributor

我没有说改成True
8c9a3aa9-f2b9-48eb-a31e-f28441a1fd77

Contributor

hellorocky commented Oct 10, 2017

我没有说改成True
8c9a3aa9-f2b9-48eb-a31e-f28441a1fd77

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 10, 2017

好吧,已经设置了,期待OK。 👍

cnflyne commented Oct 10, 2017

好吧,已经设置了,期待OK。 👍

@ibuler

This comment has been minimized.

Show comment
Hide comment
@ibuler

ibuler Oct 11, 2017

Member

期间更新过一次 报异常的bug,升级一下 sdk

pip install --upgrade jumpserver-python-sdk

#738

Member

ibuler commented Oct 11, 2017

期间更新过一次 报异常的bug,升级一下 sdk

pip install --upgrade jumpserver-python-sdk

#738

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 11, 2017

@ibuler 好的,已更新。

cnflyne commented Oct 11, 2017

@ibuler 好的,已更新。

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 11, 2017

@ibuler

上面那个命令修复了啥?为啥执行之后,jumpserver coco 挂掉了,而且重启不了了?线上,非常紧急

cnflyne commented Oct 11, 2017

@ibuler

上面那个命令修复了啥?为啥执行之后,jumpserver coco 挂掉了,而且重启不了了?线上,非常紧急

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 11, 2017

好奇心害死猫,大家不要随便升级,特别是线上!!!

cnflyne commented Oct 11, 2017

好奇心害死猫,大家不要随便升级,特别是线上!!!

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 11, 2017

把v0.4安装wiki上的那些命令重新跑了一遍,终于可以启动了。。。吓尿了

cnflyne commented Oct 11, 2017

把v0.4安装wiki上的那些命令重新跑了一遍,终于可以启动了。。。吓尿了

@ibuler

This comment has been minimized.

Show comment
Hide comment
@ibuler

ibuler Mar 8, 2018

Member

fixed

Member

ibuler commented Mar 8, 2018

fixed

@ibuler ibuler closed this Mar 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment