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

ArgoCD v.2.4.0 Terminal read message err: websocket: unexpected reserved bits 0x70 #9643

Closed
chrism417 opened this issue Jun 13, 2022 · 11 comments · Fixed by #9895
Closed

ArgoCD v.2.4.0 Terminal read message err: websocket: unexpected reserved bits 0x70 #9643

chrism417 opened this issue Jun 13, 2022 · 11 comments · Fixed by #9895
Labels
bug Something isn't working component:web-terminal

Comments

@chrism417
Copy link

chrism417 commented Jun 13, 2022

My argocd-cm:

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
data:
  exec.enabled: 'true'

My argocd-params-cm:

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cmd-params-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cmd-params-cm
data:
  server.insecure: 'true'
  server.enable.exec: 'true'

My argocd-server cluster role:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app.kubernetes.io/component: server
    app.kubernetes.io/name: argocd-server
    app.kubernetes.io/part-of: argocd
    argocd.argoproj.io/instance: argocd-itself
  name: argocd-server
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - delete
  - get
  - patch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - list
- apiGroups:
  - ""
  resources:
  - pods
  - pods/log
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - pods/exec
  verbs:
  - create

I've enabled websockets on my HTTPProxy and I can see the terminal for a pod, but I can't type in the terminal. I see the error in the argocd-server:

time="2022-06-13T14:22:05Z" level=error msg="read message err: websocket: unexpected reserved bits 0x70"
E0613 14:22:05.001903 1 v2.go:105] websocket: unexpected reserved bits 0x70

@chrism417 chrism417 added the bug Something isn't working label Jun 13, 2022
@mkilchhofer
Copy link
Member

mkilchhofer commented Jun 14, 2022

Same for me with kubectl port-forward.

With my ingress controller (project contour) I didn't have success at all yet. Still testing random things to bring websockets alive. (Already use websockets for other apps with contour, no issues so far with these apps, but Argo won't work yet).

But I have 0x60 errors:

time="2022-06-14T12:19:23Z" level=info msg="terminal session starting" application=chaoskube cluster=apps-with-clusterroles container=chaoskube namespace=base-infra podName=chaoskube-5d49569df8-ds4ql userName=marco@<REDACTED>
E0614 12:19:24.022648       1 v2.go:105] EOF
time="2022-06-14T12:19:27Z" level=error msg="read message err: websocket: unexpected reserved bits 0x60"
E0614 12:19:27.802163       1 v2.go:105] websocket: unexpected reserved bits 0x60

grafik

@chrism417
Copy link
Author

With my ingress controller (project contour) I didn't have success at all yet. Still testing random things to bring websockets alive. (Already use websockets for other apps with contour, no issues so far with these apps, but Argo won't work yet).

I'm also using contour and have enabled websockets on the HTTPProxy. Like you said, it works everywhere else. I keep getting the error with Argo though

@mkilchhofer
Copy link
Member

Okay I can eliminate contour as I converted the argocd-server Service to a NodePort service. Same behavior :(

Argo CD via NodePort Service

@chrism417
Copy link
Author

Thanks @mkilchhofer, so definitely an Argo issue.

@arthurk
Copy link
Contributor

arthurk commented Jun 15, 2022

Same issue when opening the web terminal:

{"level":"error","msg":"read message err: websocket: unexpected reserved bits 0x60","time":"2022-06-15T04:15:27Z"}

It seems to work fine for containers that have bash installed but not for ones that are using sh (based on alpine). Maybe something wrong with the logic here?

// FIXME: if the first shell fails then the first keyboard event is lost

@crenshaw-dev
Copy link
Member

It seems to work fine for containers that have bash installed but not for ones that are using sh (based on alpine). Maybe something wrong with the logic here?

Is this the case for others on the thread? If so, I'll close as duplicate to consolidate discussion here: #9641

If not, we have two different issues.

@mkilchhofer
Copy link
Member

Tested both nginx flavours:
grafik

I cannot open the terminal for both. 😢

@djfinnoy
Copy link
Contributor

My experience is that ui exec issues caused by RBAC are almost indistinguishable from those caused by the pod not having bash installed.

@mkilchhofer are you able to run bash via kubectl exec -it <pod name> -- bash ? If so, are you able to UI exec into the pod with an admin account?

@crenshaw-dev
Copy link
Member

Keep in mind that Argo CD doesn't use your account to exec into a Pod. It uses its own ServiceAccount. So even if you can kubectl exec in, that doesn't necessarily mean the RBAC (either the k8s RBAC restricting the Argo CD API Server or the Argo CD RBAC restricting the user) is permissive enough.

@chrism417
Copy link
Author

I'm in the same boat as @mkilchhofer, I have the issue with alpine, non-alpine, and windows terminals. This is not an RBAC issue as the service account has the required permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:web-terminal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants