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

Accessible namespaces functionality is broken in 4.1.0-beta2 #2111

Closed
amuraru opened this issue Feb 10, 2021 · 19 comments · Fixed by #2138 or #2174
Closed

Accessible namespaces functionality is broken in 4.1.0-beta2 #2111

amuraru opened this issue Feb 10, 2021 · 19 comments · Fixed by #2138 or #2174
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amuraru
Copy link

amuraru commented Feb 10, 2021

Describe the bug
Accessible namespaces functionality is broken in 4.1.0-beta2
To Reproduce
Steps to reproduce the behavior:

  1. Add a new cluster and configure Accessible Namespaces
  2. Click on cluster
  3. See error
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    
  },
  "status": "Failure",
  "message": "namespaces is forbidden: User \"https://sts.windows.net/fa7b1b5a-7b34-4387-94ae-d2c178decee1/#nqPjN1BDJSi4LUEkIYa8fR1C1-mZpoOiACmZXDYMKjE\" cannot list resource \"namespaces\" in API group \"\" at the cluster scope",
  "reason": "Forbidden",
  "details": {
    "kind": "namespaces"
  },
  "code": 403
}
@amuraru
Copy link
Author

amuraru commented Feb 15, 2021

just tried https://github.com/lensapp/lens/releases/tag/v4.1.0-rc.2 where I see the previous fixes went it but I still have issues using NS functionality. NS listing is still triggered

console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/config.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-workspace-store.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-cluster-store.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-extensions.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-filesystem-provisioner-store.json
console.js:124 info: [WORKSPACE-STORE] requesting initial state sync
console.js:124 info: [CLUSTER-STORE] requesting initial state sync
console.js:124 info: [CLUSTER-STORE] start to listen (1)
console.js:124 info: [WORKSPACE-STORE] starting to listen state events
console.js:124 info: [EXTENSION]: enabled kube-object-event-status@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-metrics-cluster-feature@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-node-menu@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-pod-menu@0.1.0
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/extension-store/lens-survey/preferences-store.json
console.js:124 info: [EXTENSION]: enabled lens-survey@0.1.0
/Applications/Lens.app/Contents/Resources/extensions/telemetry/dist/renderer.js:121 telemetry extension activated
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/extension-store/lens-telemetry/preferences-store.json
console.js:124 info: [EXTENSION]: enabled lens-telemetry@0.1.0
console.js:124 info: [LENS-VIEW]: init dashboard, clusterId=95d07f09-3f0e-4152-b236-2352e1200524
console.js:124 error: Can't find working API for the Kubernetes resource ingresses
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/config.json
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-workspace-store.json
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-cluster-store.json
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-extensions.json
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-filesystem-provisioner-store.json
VM57 Lens.js:2 info: [WORKSPACE-STORE] requesting initial state sync
VM57 Lens.js:2 info: [CLUSTER-STORE] requesting initial state sync
VM57 Lens.js:2 info: [CLUSTER-STORE] start to listen (5)
VM57 Lens.js:2 info: [WORKSPACE-STORE] starting to listen state events
VM57 Lens.js:2 info: [APP]: Init dashboard, clusterId=95d07f09-3f0e-4152-b236-2352e1200524, frameId=5
console.js:124 info: [LENS-VIEW]: loaded from http://95d07f09-3f0e-4152-b236-2352e1200524.localhost:63333/
VM57 Lens.js:2 info: [EXTENSION]: enabled kube-object-event-status@0.1.0
VM57 Lens.js:2 info: [EXTENSION]: enabled lens-metrics-cluster-feature@0.1.0
VM57 Lens.js:2 info: [EXTENSION]: enabled lens-node-menu@0.1.0
VM57 Lens.js:2 info: [EXTENSION]: enabled lens-pod-menu@0.1.0
VM57 Lens.js:2 info: [EXTENSION]: enabled lens-survey@0.1.0
VM137 renderer.js:121 telemetry extension activated
VM57 Lens.js:2 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/extension-store/lens-telemetry/preferences-store.json
VM57 Lens.js:2 info: [EXTENSION]: enabled lens-telemetry@0.1.0
95d07f09-3f0e-4152-b236-2352e1200524.localhost:63333/api-kube/api/v1/namespaces?:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
VM57 Lens.js:2 Loading store items failed Object
loadAll @ VM57 Lens.js:2
95d07f09-3f0e-4152-b236-2352e1200524.localhost:63333/api-kube/api/v1/namespaces?:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
VM57 Lens.js:2 Loading store items failed Object
loadAll @ VM57 Lens.js:2
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/config.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-workspace-store.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-cluster-store.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-extensions.json
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/lens-filesystem-provisioner-store.json
console.js:124 info: [WORKSPACE-STORE] requesting initial state sync
console.js:124 info: [CLUSTER-STORE] requesting initial state sync
console.js:124 info: [CLUSTER-STORE] start to listen (5)
console.js:124 info: [WORKSPACE-STORE] starting to listen state events
console.js:124 info: [APP]: Init dashboard, clusterId=95d07f09-3f0e-4152-b236-2352e1200524, frameId=5
console.js:124 info: [EXTENSION]: enabled kube-object-event-status@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-metrics-cluster-feature@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-node-menu@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-pod-menu@0.1.0
console.js:124 info: [EXTENSION]: enabled lens-survey@0.1.0
/Applications/Lens.app/Contents/Resources/extensions/telemetry/dist/renderer.js:121 telemetry extension activated
console.js:124 info: [STORE]: LOADED from /Users/amuraru/Library/Application Support/Lens/extension-store/lens-telemetry/preferences-store.json
console.js:124 info: [EXTENSION]: enabled lens-telemetry@0.1.0
cancelableFetch.ts:33 GET http://95d07f09-3f0e-4152-b236-2352e1200524.localhost:63333/api-kube/api/v1/namespaces? 403 (Forbidden)
(anonymous) @ Lens.js:2
request @ Lens.js:2
get @ Lens.js:2
list @ Lens.js:2
async function (async)
list @ Lens.js:2
loadItems @ Lens.js:2
loadItems @ Lens.js:2
loadAll @ Lens.js:2
async function (async)
loadAll @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
Object.fireImmediately @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
f @ Lens.js:2
(anonymous) @ Lens.js:2
e.runReaction @ Lens.js:2
Xe @ Lens.js:2
Ke @ Lens.js:2
(anonymous) @ Lens.js:2
pc @ Lens.js:2
Ke @ Lens.js:2
qe @ Lens.js:2
e.schedule @ Lens.js:2
ut @ Lens.js:2
autoLoadAllowedNamespaces @ Lens.js:2
init @ Lens.js:2
async function (async)
init @ Lens.js:2
Qy @ Lens.js:2
(anonymous) @ Lens.js:2
r @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
kube-object.store.ts:157 Loading store items failed {error: TypeError: Cannot read property 'items' of undefined
    at Function.isJsonApiData (http://95d07f09…, store: Qy}
loadAll @ Lens.js:2
async function (async)
loadAll @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
Object.fireImmediately @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
f @ Lens.js:2
(anonymous) @ Lens.js:2
e.runReaction @ Lens.js:2
Xe @ Lens.js:2
Ke @ Lens.js:2
(anonymous) @ Lens.js:2
pc @ Lens.js:2
Ke @ Lens.js:2
qe @ Lens.js:2
e.schedule @ Lens.js:2
ut @ Lens.js:2
autoLoadAllowedNamespaces @ Lens.js:2
init @ Lens.js:2
async function (async)
init @ Lens.js:2
Qy @ Lens.js:2
(anonymous) @ Lens.js:2
r @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
cancelableFetch.ts:33 GET http://95d07f09-3f0e-4152-b236-2352e1200524.localhost:63333/api-kube/api/v1/namespaces? 403 (Forbidden)
(anonymous) @ Lens.js:2
request @ Lens.js:2
get @ Lens.js:2
list @ Lens.js:2
async function (async)
list @ Lens.js:2
loadItems @ Lens.js:2
loadItems @ Lens.js:2
loadAll @ Lens.js:2
async function (async)
loadAll @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
n @ Lens.js:2
(anonymous) @ Lens.js:2
async function (async)
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
a @ Lens.js:2
preloadStores @ Lens.js:2
u @ Lens.js:2
subscribeStores @ Lens.js:2
componentDidMount @ Lens.js:2
uo @ Lens.js:2
Qc @ Lens.js:2
t.unstable_runWithPriority @ Lens.js:2
zn @ Lens.js:2
Ic @ Lens.js:2
hc @ Lens.js:2
oc @ Lens.js:2
Jc @ Lens.js:2
(anonymous) @ Lens.js:2
dc @ Lens.js:2
$c @ Lens.js:2
t.render @ Lens.js:2
dU @ Lens.js:2
async function (async)
dU @ Lens.js:2
(anonymous) @ Lens.js:2
r @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
kube-object.store.ts:157 Loading store items failed {error: TypeError: Cannot read property 'items' of undefined
    at Function.isJsonApiData (http://95d07f09…, store: Qy}
loadAll @ Lens.js:2
async function (async)
loadAll @ Lens.js:2
ye @ Lens.js:2
i @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
n @ Lens.js:2
(anonymous) @ Lens.js:2
async function (async)
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2
a @ Lens.js:2
preloadStores @ Lens.js:2
u @ Lens.js:2
subscribeStores @ Lens.js:2
componentDidMount @ Lens.js:2
uo @ Lens.js:2
Qc @ Lens.js:2
t.unstable_runWithPriority @ Lens.js:2
zn @ Lens.js:2
Ic @ Lens.js:2
hc @ Lens.js:2
oc @ Lens.js:2
Jc @ Lens.js:2
(anonymous) @ Lens.js:2
dc @ Lens.js:2
$c @ Lens.js:2
t.render @ Lens.js:2
dU @ Lens.js:2
async function (async)
dU @ Lens.js:2
(anonymous) @ Lens.js:2
r @ Lens.js:2
(anonymous) @ Lens.js:2
(anonymous) @ Lens.js:2

@amuraru
Copy link
Author

amuraru commented Feb 15, 2021

/cc @jakolehm

@jakolehm jakolehm reopened this Feb 15, 2021
@jakolehm
Copy link
Contributor

@amuraru how is the error visible in the app? Do you see an error page or is cluster dashboard just empty?

@jakolehm
Copy link
Contributor

Moving to 4.1.1 because I cannot reproduce this.

@amuraru
Copy link
Author

amuraru commented Feb 19, 2021

@jakolehm thanks for looking into this. Unfortunately I am still seeing this in latest 4.1.2.
Here is a recording of my session:

https://recordit.co/yGDKo8aprA

and console logs:
localhost-1613740972462.log

@Nokel81
Copy link
Collaborator

Nokel81 commented Feb 19, 2021

Will investigate again

@Nokel81 Nokel81 reopened this Feb 19, 2021
@Nokel81
Copy link
Collaborator

Nokel81 commented Feb 19, 2021

Looking at code this is definitely broken will create a PR to fix, namespace select is ignoring changes to accessible-namespaces and only ever displays items gotten from the namespace API.

@jakolehm jakolehm modified the milestones: 4.1.1, 4.1.3, 4.1.4 Feb 22, 2021
@jakolehm jakolehm modified the milestones: 4.1.4, 4.1.5 Mar 4, 2021
@Nokel81 Nokel81 modified the milestones: 4.1.5, 4.2.0 Mar 5, 2021
@amuraru
Copy link
Author

amuraru commented Mar 5, 2021

This is working for me! Thanks!

@Nokel81
Copy link
Collaborator

Nokel81 commented Mar 5, 2021

Excellent thanks, did you try that branch or is it fixed in the latest release?

@amuraru
Copy link
Author

amuraru commented Mar 6, 2021

4.1.3 release seems to fix that

@Nokel81
Copy link
Collaborator

Nokel81 commented Mar 8, 2021

Excellent, thanks.

@Nokel81 Nokel81 closed this as completed Mar 8, 2021
@amuraru
Copy link
Author

amuraru commented May 6, 2021

this bug is back, it works in 4.2.2 but 4.2.3 and 4.2.4 cannot list namespaces

@amuraru
Copy link
Author

amuraru commented May 6, 2021

/reopen

@Nokel81 Nokel81 reopened this May 6, 2021
@Nokel81
Copy link
Collaborator

Nokel81 commented May 6, 2021

Will investigate.

@amuraru
Copy link
Author

amuraru commented Jun 3, 2021

@Nokel81 any update on this please? It's quite annoying cause I cannot find a way to pin the version to 4.2.2
For some reason - lens keeps updating to latest 4.2.4 even if I select No when upgrade popup appears

@Nokel81
Copy link
Collaborator

Nokel81 commented Jun 4, 2021

There was a bug in 4.2.2 where updating was accidentally forced. I will see if I can reproduce the accessible namespaces not working in 4.2.4

@Nokel81
Copy link
Collaborator

Nokel81 commented Jun 4, 2021

I have verified that this is working in the 5.0.0 beta releases.

@Nokel81 Nokel81 closed this as completed Jun 4, 2021
@amuraru
Copy link
Author

amuraru commented Jun 9, 2021

hi @Nokel81 - just tried this in Lens: 5.0.0-beta.7.20210607.1 and I can still see the issue with the namespaces not being displayed in the dropdown and errors trying to list the namespaces in the console log.

here is a testing session recording:
https://user-images.githubusercontent.com/728853/121344687-b8235780-c92c-11eb-880f-c2cc3905ddad.mov

And the console logs:
localhost-1623237101796.log

I am not sure if this is something specific to my environment (k8s version, rbacs, etc) - let me know if you need more info

@Nokel81
Copy link
Collaborator

Nokel81 commented Jun 9, 2021

Thanks for the repro, I am currently working on simplifying the accessibleNamespaces logic, so I will keep this in mind. Will link the PR when I get it up.

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