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

Given an openshift cluster with private certificate and restricted rights I get told that it cannot list the namespaces #547

Closed
adietish opened this issue May 22, 2023 · 5 comments · Fixed by #599
Assignees
Milestone

Comments

@adietish
Copy link
Contributor

[kind/bug]

This was reported in redhat-developer/intellij-kubernetes#600 (comment)

Steps:

  1. ASSERT: have a cluster with a private certificate
  2. EXEC: try to list the projects (expand the root node)

Result:
image

The toolbox window shows the cluster, but the only item in the dropdown is "Unable to get namespaces: An error has occurred.", which is correct, because my account doesn't have the appropriate rights for oc get namespaces. It does for oc get projects though.

@adietish
Copy link
Contributor Author

CC: @tschut

@tschut
Copy link

tschut commented May 22, 2023

Hi @adietish, I'm not sure this is related to the cluster having a private certificate, instead, I think it's related to the fact that I don't have the permissions to run oc get namespaces.

When I right-click the error it just says "Nothing here". Is there some way I could help by getting logging from somewhere or something?

@adietish
Copy link
Contributor Author

adietish commented May 23, 2023

Hi @tschut,
the "Nothing here" is automatically created by IDEA when there is not item to display in the ctx menu :)
You can have a look at the IDEA logs via Help > Show Log in ... Maybe there's something suspect in the log?
What looks suspect to me is that the plugin tries to list the namespaces where it should list the projects. At least that's how it looks at the surface. Maybe @sbouchet knows more?

@mohitsuman mohitsuman modified the milestones: 1.5.0, 1.6.0, 1.7.0 Jun 2, 2023
@sbouchet sbouchet self-assigned this Jun 6, 2023
@sbouchet
Copy link
Collaborator

sbouchet commented Sep 1, 2023

Hi @tschut , i'm trying to reproduce with a local crc and a private certificate.
the openshift navigator view rely on kubernetes-client to manage openshift/kubernetes clusters, and we do not perfrom any oc commands. we use redhat kubernetes extension only to help switch contexts.

@sbouchet
Copy link
Collaborator

sbouchet commented Sep 4, 2023

Running crc on private certificate like described in intellij-kubernetes#521 result on the above error, with this stack:

java.io.IOException: Process exited with an error: 1 (Exit value: 1) {
	"message": "Get \"https://api.crc.testing:6443/apis/servicebinding.io/v1alpha3/namespaces/default/servicebindings\": x509: certificate signed by unknown authority"
}

	at com.redhat.devtools.intellij.common.utils.ExecHelper.executeWithResult(ExecHelper.java:261)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.execute(OdoCli.java:246)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.discover(OdoCli.java:854)
	at org.jboss.tools.intellij.openshift.utils.odo.OdoProjectDecorator.discover(OdoProjectDecorator.java:253)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.addContext(ApplicationsRootNode.java:138)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.loadProjectModel(ApplicationsRootNode.java:109)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.lambda$initializeOdo$0(ApplicationsRootNode.java:83)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:887)
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2325)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode.initializeOdo(ApplicationsRootNode.java:78)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsTreeStructure.getApplicationsRoot(ApplicationsTreeStructure.java:83)
	at org.jboss.tools.intellij.openshift.tree.application.ApplicationsTreeStructure.getChildElements(ApplicationsTreeStructure.java:95)
	at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:410)
	at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:328)
	at com.intellij.ui.tree.StructureTreeModel.getNode(StructureTreeModel.java:322)
	at com.intellij.ui.tree.StructureTreeModel.getChildren(StructureTreeModel.java:342)
	at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:568)
	at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:464)
	at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:430)
	at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:304)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:72)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:129)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:110)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$1(ProgressManager.java:70)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:70)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:107)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:72)
	at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:187)
	at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:165)
	at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:431)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:248)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:28)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:221)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:227)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at com.redhat.devtools.intellij.common.utils.ExecHelper.executeWithResult(ExecHelper.java:258)
	... 51 more

@sbouchet sbouchet moved this to 📋 Backlog in IDE Cloudaptors Sep 27, 2023
@sbouchet sbouchet removed this from the 1.7.0 milestone Oct 18, 2023
@sbouchet sbouchet added this to the 1.7.0 milestone Oct 18, 2023
@sbouchet sbouchet moved this from 📋 Backlog to 👀 In review in IDE Cloudaptors Oct 18, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants