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

coco在用一段时间后会卡住 #698

Closed
lyjason opened this Issue Sep 13, 2017 · 17 comments

Comments

Projects
None yet
8 participants
@lyjason

lyjason commented Sep 13, 2017

版本0.4.0,ssh软件使用的xshell,有时候在资产里的终端卡住不动,只能新建一个coco的连接。

@ibuler ibuler added the bug label Sep 13, 2017

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 14, 2017

Contributor

jumpserver 和 coco 有日志吗?

Contributor

choldrim commented Sep 14, 2017

jumpserver 和 coco 有日志吗?

@eli261

This comment has been minimized.

Show comment
Hide comment
@eli261

eli261 Sep 14, 2017

Contributor

我也遇到了这个问题:
我使用的0.4.0版本,jumpserver和coco都是使用docker部署,coco容器对外开发2222端口,然后我使用xshell去连接这个2222端口。我昨天xshell连接coco成功了。今天早上想开个新的xshell窗口再连接到coco,可是xshell连接过程卡住了。昨天连接的xshell窗口仍然可正常使用。于是关闭昨天的xshell窗口,重新来连接coco,又正常了,可以同时开两个窗口去连接。可是开到第三个窗口时又连不上了。
在宿主机上查看coco容器日志(docker logs -f coco),发现这样的日志:

[transport ERROR] AttributeError: '_AppCtxGlobals' object has no attribute 'user_service'

2017-09-14 02:47:25 [connectionpool DEBUG] Starting new HTTP connection (1): jumpserver
2017-09-14 02:47:25 [connectionpool DEBUG] http://jumpserver:8080 "POST /api/applications/v1/terminal/heatbeat/ HTTP/1.1" 201 28
2017-09-14 02:47:28 [app DEBUG] Get request from 172.18.0.254:33872
2017-09-14 02:47:28 [app INFO] Get ssh request from 172.18.0.254
2017-09-14 02:47:28 [interface DEBUG] Get ssh server host key
2017-09-14 02:47:28 [transport DEBUG] starting thread (server mode): 0x1424ad68
2017-09-14 02:47:28 [transport DEBUG] Local version/idstring: SSH-2.0-paramiko_2.2.1
2017-09-14 02:47:28 [transport DEBUG] Remote version/idstring: SSH-2.0-nsssh2_5.0.0036 NetSarang Computer, Inc.
2017-09-14 02:47:28 [transport INFO] Connected (version 2.0, client nsssh2_5.0.0036)
2017-09-14 02:47:28 [transport DEBUG] kex algos:['diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group-exchange-sha256'] server key:['ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256'] client encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael128-cbc', 'rijndael192-cbc', 'rijndael256-cbc', 'aes256-ctr', 'aes192-ctr', 'aes128-ctr', 'rijndael-cbc@lysator.liu.se'] server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael128-cbc', 'rijndael192-cbc', 'rijndael256-cbc', 'aes256-ctr', 'aes192-ctr', 'aes128-ctr', 'rijndael-cbc@lysator.liu.se'] client mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96', 'hmac-ripemd160', 'hmac-ripemd160@openssh.com', 'none'] server mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96', 'hmac-ripemd160', 'hmac-ripemd160@openssh.com', 'none'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False
2017-09-14 02:47:28 [transport DEBUG] Kex agreed: diffie-hellman-group14-sha1
2017-09-14 02:47:28 [transport DEBUG] HostKey agreed: ssh-rsa
2017-09-14 02:47:28 [transport DEBUG] Cipher agreed: aes128-cbc
2017-09-14 02:47:28 [transport DEBUG] MAC agreed: hmac-sha1
2017-09-14 02:47:28 [transport DEBUG] Compression agreed: none
2017-09-14 02:47:28 [transport DEBUG] kex engine KexGroup14 specified hash_algo
2017-09-14 02:47:28 [transport DEBUG] Switch to new keys ...
2017-09-14 02:47:28 [transport DEBUG] Auth request (type=none) service=ssh-connection, username=zzw
2017-09-14 02:47:28 [transport INFO] Auth rejected (none).
2017-09-14 02:47:28 [transport DEBUG] Auth request (type=password) service=ssh-connection, username=zzw
2017-09-14 02:47:28 [interface DEBUG] Start check auth
2017-09-14 02:47:28 [transport ERROR] Unknown exception: '_AppCtxGlobals' object has no attribute 'user_service'
2017-09-14 02:47:28 [transport ERROR] Traceback (most recent call last):
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/paramiko/transport.py", line 1860, in run
2017-09-14 02:47:28 [transport ERROR] handler(self.auth_handler, m)
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/paramiko/auth_handler.py", line 439, in _parse_userauth_request
2017-09-14 02:47:28 [transport ERROR] username, password)
2017-09-14 02:47:28 [transport ERROR] File "/opt/coco/coco/interface.py", line 73, in check_auth_password
2017-09-14 02:47:28 [transport ERROR] if self.check_auth(username, password=password):
2017-09-14 02:47:28 [transport ERROR] File "/opt/coco/coco/interface.py", line 63, in check_auth
2017-09-14 02:47:28 [transport ERROR] user, token = g.user_service.login(data)
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/werkzeug/local.py", line 347, in getattr
2017-09-14 02:47:28 [transport ERROR] return getattr(self._get_current_object(), name)
2017-09-14 02:47:28 [transport ERROR] AttributeError: '_AppCtxGlobals' object has no attribute 'user_service'
2017-09-14 02:47:28 [transport ERROR]
2017-09-14 02:47:28 [app WARNING] No ssh channel get.
2017-09-14 02:47:30 [connectionpool DEBUG] Starting new HTTP connection (1): jumpserver
2017-09-14 02:47:30 [connectionpool DEBUG] http://jumpserver:8080 "POST /api/applications/v1/terminal/heatbeat/ HTTP/1.1" 201 28

Contributor

eli261 commented Sep 14, 2017

我也遇到了这个问题:
我使用的0.4.0版本,jumpserver和coco都是使用docker部署,coco容器对外开发2222端口,然后我使用xshell去连接这个2222端口。我昨天xshell连接coco成功了。今天早上想开个新的xshell窗口再连接到coco,可是xshell连接过程卡住了。昨天连接的xshell窗口仍然可正常使用。于是关闭昨天的xshell窗口,重新来连接coco,又正常了,可以同时开两个窗口去连接。可是开到第三个窗口时又连不上了。
在宿主机上查看coco容器日志(docker logs -f coco),发现这样的日志:

[transport ERROR] AttributeError: '_AppCtxGlobals' object has no attribute 'user_service'

2017-09-14 02:47:25 [connectionpool DEBUG] Starting new HTTP connection (1): jumpserver
2017-09-14 02:47:25 [connectionpool DEBUG] http://jumpserver:8080 "POST /api/applications/v1/terminal/heatbeat/ HTTP/1.1" 201 28
2017-09-14 02:47:28 [app DEBUG] Get request from 172.18.0.254:33872
2017-09-14 02:47:28 [app INFO] Get ssh request from 172.18.0.254
2017-09-14 02:47:28 [interface DEBUG] Get ssh server host key
2017-09-14 02:47:28 [transport DEBUG] starting thread (server mode): 0x1424ad68
2017-09-14 02:47:28 [transport DEBUG] Local version/idstring: SSH-2.0-paramiko_2.2.1
2017-09-14 02:47:28 [transport DEBUG] Remote version/idstring: SSH-2.0-nsssh2_5.0.0036 NetSarang Computer, Inc.
2017-09-14 02:47:28 [transport INFO] Connected (version 2.0, client nsssh2_5.0.0036)
2017-09-14 02:47:28 [transport DEBUG] kex algos:['diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group-exchange-sha256'] server key:['ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256'] client encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael128-cbc', 'rijndael192-cbc', 'rijndael256-cbc', 'aes256-ctr', 'aes192-ctr', 'aes128-ctr', 'rijndael-cbc@lysator.liu.se'] server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael128-cbc', 'rijndael192-cbc', 'rijndael256-cbc', 'aes256-ctr', 'aes192-ctr', 'aes128-ctr', 'rijndael-cbc@lysator.liu.se'] client mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96', 'hmac-ripemd160', 'hmac-ripemd160@openssh.com', 'none'] server mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96', 'hmac-ripemd160', 'hmac-ripemd160@openssh.com', 'none'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False
2017-09-14 02:47:28 [transport DEBUG] Kex agreed: diffie-hellman-group14-sha1
2017-09-14 02:47:28 [transport DEBUG] HostKey agreed: ssh-rsa
2017-09-14 02:47:28 [transport DEBUG] Cipher agreed: aes128-cbc
2017-09-14 02:47:28 [transport DEBUG] MAC agreed: hmac-sha1
2017-09-14 02:47:28 [transport DEBUG] Compression agreed: none
2017-09-14 02:47:28 [transport DEBUG] kex engine KexGroup14 specified hash_algo
2017-09-14 02:47:28 [transport DEBUG] Switch to new keys ...
2017-09-14 02:47:28 [transport DEBUG] Auth request (type=none) service=ssh-connection, username=zzw
2017-09-14 02:47:28 [transport INFO] Auth rejected (none).
2017-09-14 02:47:28 [transport DEBUG] Auth request (type=password) service=ssh-connection, username=zzw
2017-09-14 02:47:28 [interface DEBUG] Start check auth
2017-09-14 02:47:28 [transport ERROR] Unknown exception: '_AppCtxGlobals' object has no attribute 'user_service'
2017-09-14 02:47:28 [transport ERROR] Traceback (most recent call last):
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/paramiko/transport.py", line 1860, in run
2017-09-14 02:47:28 [transport ERROR] handler(self.auth_handler, m)
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/paramiko/auth_handler.py", line 439, in _parse_userauth_request
2017-09-14 02:47:28 [transport ERROR] username, password)
2017-09-14 02:47:28 [transport ERROR] File "/opt/coco/coco/interface.py", line 73, in check_auth_password
2017-09-14 02:47:28 [transport ERROR] if self.check_auth(username, password=password):
2017-09-14 02:47:28 [transport ERROR] File "/opt/coco/coco/interface.py", line 63, in check_auth
2017-09-14 02:47:28 [transport ERROR] user, token = g.user_service.login(data)
2017-09-14 02:47:28 [transport ERROR] File "/usr/local/lib/python3.6/site-packages/werkzeug/local.py", line 347, in getattr
2017-09-14 02:47:28 [transport ERROR] return getattr(self._get_current_object(), name)
2017-09-14 02:47:28 [transport ERROR] AttributeError: '_AppCtxGlobals' object has no attribute 'user_service'
2017-09-14 02:47:28 [transport ERROR]
2017-09-14 02:47:28 [app WARNING] No ssh channel get.
2017-09-14 02:47:30 [connectionpool DEBUG] Starting new HTTP connection (1): jumpserver
2017-09-14 02:47:30 [connectionpool DEBUG] http://jumpserver:8080 "POST /api/applications/v1/terminal/heatbeat/ HTTP/1.1" 201 28

@hfq-haochenxiao

This comment has been minimized.

Show comment
Hide comment
@hfq-haochenxiao

hfq-haochenxiao Sep 14, 2017

在coco/coco/proxy.py 中
image
修改这里,重启coco. 解决tail -f 输出大量日志卡顿。

hfq-haochenxiao commented Sep 14, 2017

在coco/coco/proxy.py 中
image
修改这里,重启coco. 解决tail -f 输出大量日志卡顿。

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 18, 2017

Contributor

@eli261 周末fixed了一个coco的bug jumpserver/coco#13 ,你试试最新版的coco还会不会出现这个问题

Contributor

choldrim commented Sep 18, 2017

@eli261 周末fixed了一个coco的bug jumpserver/coco#13 ,你试试最新版的coco还会不会出现这个问题

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 18, 2017

Contributor

@hfq-haochenxiao 你这样改完之后还能捕获到服务器输出么 0.0

Contributor

choldrim commented Sep 18, 2017

@hfq-haochenxiao 你这样改完之后还能捕获到服务器输出么 0.0

@hfq-haochenxiao

This comment has been minimized.

Show comment
Hide comment
@hfq-haochenxiao

hfq-haochenxiao Sep 18, 2017

@choldrim 我这个做法是做了个减法,这样xshell中可以获取到输出,虽然程序无法捕获输出,但是已满足公司的需求。在使用过程中出现一个问题,开发人员想使用rz sz 无法使用。这个可以使用正则匹配的方式对输出进行捕获吗?

hfq-haochenxiao commented Sep 18, 2017

@choldrim 我这个做法是做了个减法,这样xshell中可以获取到输出,虽然程序无法捕获输出,但是已满足公司的需求。在使用过程中出现一个问题,开发人员想使用rz sz 无法使用。这个可以使用正则匹配的方式对输出进行捕获吗?

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 18, 2017

Contributor

在使用过程中出现一个问题,开发人员想使用rz sz 无法使用。这个可以使用正则匹配的方式对输出进行捕获吗?

@hfq-haochenxiao self.output只是在审计记录使用到了而已,不影响原有的功能,sz rz也是可以正常使用的呀,我按你的做法注释了也是可以使用sz rz的

Contributor

choldrim commented Sep 18, 2017

在使用过程中出现一个问题,开发人员想使用rz sz 无法使用。这个可以使用正则匹配的方式对输出进行捕获吗?

@hfq-haochenxiao self.output只是在审计记录使用到了而已,不影响原有的功能,sz rz也是可以正常使用的呀,我按你的做法注释了也是可以使用sz rz的

@hfq-haochenxiao

This comment has been minimized.

Show comment
Hide comment
@hfq-haochenxiao

hfq-haochenxiao Sep 18, 2017

@choldrim 这个不是每次使用都会出现,偶尔出现。情况是下载一半,xshell中看到一堆乱码输出,就停止下载了。

hfq-haochenxiao commented Sep 18, 2017

@choldrim 这个不是每次使用都会出现,偶尔出现。情况是下载一半,xshell中看到一堆乱码输出,就停止下载了。

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 20, 2017

Contributor

@hfq-haochenxiao 之前有遇到过,有可能是rz sz本身的问题

Contributor

choldrim commented Sep 20, 2017

@hfq-haochenxiao 之前有遇到过,有可能是rz sz本身的问题

@choldrim

This comment has been minimized.

Show comment
Hide comment
@choldrim

choldrim Sep 20, 2017

Contributor

proxy过程没有对原有的字符进行过滤的,可以看下日志,是不是在proxy记录的时候是不是decode报错了,或者可以做个过滤,对sz rz开始字符进行匹配,开始传文件的时候就暂停proxy,匹配到结束字符的时候就开始proxy
之前有讨论过这个 #253

Contributor

choldrim commented Sep 20, 2017

proxy过程没有对原有的字符进行过滤的,可以看下日志,是不是在proxy记录的时候是不是decode报错了,或者可以做个过滤,对sz rz开始字符进行匹配,开始传文件的时候就暂停proxy,匹配到结束字符的时候就开始proxy
之前有讨论过这个 #253

@hfq-haochenxiao

This comment has been minimized.

Show comment
Hide comment
@hfq-haochenxiao

hfq-haochenxiao commented Sep 22, 2017

@choldrim 好的。谢谢

@ibuler

This comment has been minimized.

Show comment
Hide comment
@ibuler

ibuler Sep 25, 2017

Member

请更新一下代码,测试一下是否修复

Member

ibuler commented Sep 25, 2017

请更新一下代码,测试一下是否修复

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Sep 30, 2017

用的最新代码,还没有修复。。。

cnflyne commented Sep 30, 2017

用的最新代码,还没有修复。。。

@zsjohny

This comment has been minimized.

Show comment
Hide comment
@zsjohny

zsjohny Oct 9, 2017

@lyjason 现在还有这个bug 吗

zsjohny commented Oct 9, 2017

@lyjason 现在还有这个bug 吗

@cnflyne

This comment has been minimized.

Show comment
Hide comment
@cnflyne

cnflyne Oct 9, 2017

cnflyne commented Oct 9, 2017

@ibuler

This comment has been minimized.

Show comment
Hide comment
@ibuler

ibuler Mar 10, 2018

Member

fixed

Member

ibuler commented Mar 10, 2018

fixed

@ibuler ibuler closed this Mar 10, 2018

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