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

Cannot start any workspaces anymore: Found '2' matching labeled namespaces #20803

Closed
sunix opened this issue Nov 22, 2021 · 4 comments
Closed
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.

Comments

@sunix
Copy link
Contributor

sunix commented Nov 22, 2021

Describe the bug

when switching to per user namespaces some times ago, all my new workspaces were created in a new dedicated namespace. It was working well for a while.
However, after an upgrade, I cannot start any workspaces

[WARN ] [k.n.KubernetesNamespaceFactory 496] - found '2' matching labeled namespaces [KubernetesNamespaceMetaImpl{name='che', attributes={phase=Active}}, KubernetesNamespaceMetaImpl{name='che-ws-sunix', attributes={phase=Active}}]. Using 'che'.

I guess it is starting using the wrong one ... che instead of che-ws-sunix
and obviously I have some permission issue and cannot start any new workspaces:

Failure executing: PUT at: https://x.x.x.x/apis/rbac.authorization.k8s.io/v1/namespaces/che/rolebindings/che-workspace-view. Message: RoleBinding.rbac.authorization.k8s.io "che-workspace-view" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"workspace-view"}: cannot change roleRef. 

Che version

7.39@latest

Steps to reproduce

N/A

Expected behavior

Should be able to start a workspace

Runtime

Kubernetes (vanilla)

Screenshots

No response

Installation method

chectl/latest

Environment

GCE

Eclipse Che Logs

[WARN ] [k.n.KubernetesNamespaceFactory 496] - found '2' matching labeled namespaces [KubernetesNamespaceMetaImpl{name='che', attributes={phase=Active}}, KubernetesNamespaceMetaImpl{name='che-ws-sunix', attributes={phase=Active}}]. Using 'che'.
io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PUT at: https://x.x.x.x/apis/rbac.authorization.k8s.io/v1/namespaces/che/rolebindings/che-workspace-view. Message: RoleBinding.rbac.authorization.k8s.io "che-workspace-view" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"workspace-view"}: cannot change roleRef. Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=roleRef, message=Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"workspace-view"}: cannot change roleRef, reason=FieldValueInvalid, additionalProperties={})], group=rbac.authorization.k8s.io, kind=RoleBinding, name=che-workspace-view, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=RoleBinding.rbac.authorization.k8s.io "che-workspace-view" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"workspace-view"}: cannot change roleRef, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}). at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:686) at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:625) at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:565) at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:526) at

Additional context

No response

@sunix sunix added the kind/bug Outline of a bug - must adhere to the bug report template. label Nov 22, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Nov 22, 2021
@sunix sunix changed the title Found '2' matching labeled namespaces Cannot start any workspaces anymore: Found '2' matching labeled namespaces Nov 22, 2021
@sunix
Copy link
Contributor Author

sunix commented Nov 22, 2021

apiVersion: v1
kind: Namespace
metadata:
  annotations:
    che.eclipse.org/username: sunix
[...]
  labels:
    app.kubernetes.io/component: workspaces-namespace
    app.kubernetes.io/part-of: che.eclipse.org
  name: che
[...]
apiVersion: v1
kind: Namespace
metadata:
  annotations:
    che.eclipse.org/username: sunix
[...]
  labels:
    app.kubernetes.io/component: workspaces-namespace
    app.kubernetes.io/part-of: che.eclipse.org
  name: che-ws-sunix
[...]

@sunix
Copy link
Contributor Author

sunix commented Nov 22, 2021

trying

$ kubectl label namespace che app.kubernetes.io/component-
namespace/che labeled
$ kubectl label namespace che app.kubernetes.io/part-of-
namespace/che labeled

@skabashnyuk
Copy link
Contributor

@sunix can you remove labels and annotations from che namespace?

@ibuziuk ibuziuk added area/che-server severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Nov 22, 2021
@sunix
Copy link
Contributor Author

sunix commented Nov 30, 2021

hi @skabashnyuk it works, I am closing this one

@sunix sunix closed this as completed Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants