Skip to content
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

内部市场应用导出 #608

Closed
Aaron-23 opened this issue Dec 26, 2019 · 3 comments
Closed

内部市场应用导出 #608

Aaron-23 opened this issue Dec 26, 2019 · 3 comments

Comments

@Aaron-23
Copy link

Aaron-23 commented Dec 26, 2019

【BUG描述】内部市场应用导出 系统异常

【部署环境】

  • Rainbond版本(执行grctl version获取): 5.1.9
  • 操作系统类型和版本:centos7.4
  • 离线部署/网络开放:在线

管理后台打开导出应用功能,在内部市场导出应用时提示系统异常
image

app-ui日志

2019-12-26 23:12:31 [ERROR] localhost [post] /app/ui/console/views/center_pool/app_export.py:109 [('SSL routines', 'ssl3_write_pending', 'bad write retry')]
Traceback (most recent call last):
  File "/app/ui/console/views/center_pool/app_export.py", line 96, in post
    code, msg, new_export_record = export_service.export_current_app(self.tenant, export_format, app)
  File "/app/ui/console/services/app_import_and_export_service.py", line 64, in export_current_app
    region_api.export_app(region, team.tenant_name, data)
  File "/app/ui/www/apiclient/regionapi.py", line 1221, in export_app
    res, body = self._post(url, self.default_headers, region=region, body=json.dumps(data))
  File "/app/ui/www/apiclient/regionapibaseclient.py", line 235, in _post
    url, 'POST', headers=headers, body=body, *args, **kwargs)
  File "/app/ui/goodrain_web/decorator.py", line 14, in wrapper
    ret = func(self, *args, **kwargs)
  File "/app/ui/www/apiclient/regionapibaseclient.py", line 147, in _request
    url=url, method=method, headers=headers, body=body)
  File "/usr/local/lib/python2.7/site-packages/urllib3/request.py", line 72, in request
    **urlopen_kw)
  File "/usr/local/lib/python2.7/site-packages/urllib3/request.py", line 150, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "/usr/local/lib/python2.7/site-packages/urllib3/poolmanager.py", line 324, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/local/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/local/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
  File "/usr/local/lib/python2.7/httplib.py", line 826, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 331, in sendall
    sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE])
  File "/usr/local/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 320, in _send_until_done
    return self.connection.send(data)
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 1729, in send
    self._raise_ssl_error(self._ssl, result)
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 1639, in _raise_ssl_error
    _raise_current_error()
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
Error: [('SSL routines', 'ssl3_write_pending', 'bad write retry')]
@GLYASAI
Copy link
Contributor

GLYASAI commented Dec 27, 2019

好像是 urllib3 request 这两个库版本的问题, 参考 urllib3这个 issue

@GLYASAI
Copy link
Contributor

GLYASAI commented Dec 27, 2019

另外, 这应该是 rainbond-console 的 issue

@panda-zxs
Copy link

与这个issue描述问题不同,urllib3 1.24.3 版本中并没有发现相关问题代码。
核心问题是PyOpenSSL本身会先将unicode对象转换为bytes对象,然后再将其发送到OpenSSL
因此在传入data参数时应该手动进行编码为utf-8

@Aaron-23 Aaron-23 closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants