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

interactive shell not working in 2.0.0 #28

Closed
devopstales opened this issue Jun 7, 2023 · 2 comments
Closed

interactive shell not working in 2.0.0 #28

devopstales opened this issue Jun 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@devopstales
Copy link
Owner

devopstales commented Jun 7, 2023

It Dose not work behind proxy.

[2023-06-07 09:35:46 +0200] [13] [ERROR] Socket error processing request.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 271, in handle
    keepalive = self.handle_request(req, conn)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 343, in handle_request
    util.reraise(*sys.exc_info())
  File "/usr/local/lib/python3.11/site-packages/gunicorn/util.py", line 626, in reraise
    raise value
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 329, in handle_request
    resp.write(item)
  File "/usr/local/lib/python3.11/site-packages/gunicorn/http/wsgi.py", line 326, in write
    self.send_headers()
  File "/usr/local/lib/python3.11/site-packages/gunicorn/http/wsgi.py", line 322, in send_headers
    util.write(self.sock, util.to_bytestring(header_str, "latin-1"))
  File "/usr/local/lib/python3.11/site-packages/gunicorn/util.py", line 287, in write
    sock.sendall(data)
OSError: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/eventlet/queue.py", line 118, in switch
    self.greenlet.switch(value)
greenlet.error: cannot switch to a different thread
@devopstales devopstales added the bug Something isn't working label Jun 7, 2023
@devopstales
Copy link
Owner Author

Local error:

Exception in thread Thread-109 (_handle_event_internal):
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/kubernetes/stream/ws_client.py", line 521, in websocket_call
    client = WSClient(configuration, url, headers, capture_all)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/stream/ws_client.py", line 65, in __init__
    self.sock = create_websocket(configuration, url, headers)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/stream/ws_client.py", line 487, in create_websocket
    websocket.connect(url, **connect_opt)
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 253, in connect
    self.handshake_response = handshake(self.sock, url, *addrs, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_handshake.py", line 57, in handshake
    status, resp = _get_resp_headers(sock)
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_handshake.py", line 147, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/site-packages/socketio/server.py", line 733, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/socketio/server.py", line 758, in _trigger_event
    return self.handlers[namespace][event](*args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask_socketio/__init__.py", line 282, in _handler
    return self._handle_event(handler, message, namespace, sid,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask_socketio/__init__.py", line 828, in _handle_event
    ret = handler(*args)
          ^^^^^^^^^^^^^^
  File "/Users/paladm/git/kubedash/src/kubedash/functions/routes.py", line 37, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/paladm/git/kubedash/src/kubedash/functions/routes.py", line 1187, in message
    wsclient = k8sPodExecSocket(session['user_role'], user_token, session['ns_select'], data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/paladm/git/kubedash/src/kubedash/functions/k8s.py", line 1434, in k8sPodExecSocket
    wsclient = stream(k8s_client.CoreV1Api().connect_get_namespaced_pod_exec,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/stream/stream.py", line 35, in _websocket_request
    return api_method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api/core_v1_api.py", line 994, in connect_get_namespaced_pod_exec
    return self.connect_get_namespaced_pod_exec_with_http_info(name, namespace, **kwargs)  # noqa: E501
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api/core_v1_api.py", line 1101, in connect_get_namespaced_pod_exec_with_http_info
    return self.api_client.call_api(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api_client.py", line 348, in call_api
    return self.__call_api(resource_path, method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api_client.py", line 180, in __call_api
    response_data = self.request(
                    ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kubernetes/stream/ws_client.py", line 527, in websocket_call
    raise ApiException(status=0, reason=str(e))
kubernetes.client.exceptions.ApiException: (0)
Reason: Handshake status 400 Bad Request

@devopstales
Copy link
Owner Author

Same problem as in #29. The main cause of this is the usage of gunicorn and a bug in gunicprn that has been fixed in benoitc/gunicorn#2828 and benoitc/gunicorn#2581 but not yet been release.

devopstales added a commit that referenced this issue Jun 17, 2023
devopstales added a commit that referenced this issue Jun 17, 2023
@devopstales devopstales reopened this Feb 24, 2024
devopstales added a commit that referenced this issue Apr 25, 2024
devopstales added a commit that referenced this issue Apr 25, 2024
devopstales added a commit that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant