intellij-openshift-connector icon indicating copy to clipboard operation
intellij-openshift-connector copied to clipboard

Bug - exception thrown with invalid devfile volume component

Open sreich opened this issue 2 years ago • 2 comments

[kind/bug]

What versions of software are you using?

  • Operating System: Win 10
  • IntelliJ version: IntelliJ IDEA 2022.3.2 (Ultimate Edition) Build #IU-223.8617.56, built on January 26, 2023
  • OpenShift version: C:\Users\sreich.odo\cache\3.6.0\odo-windows-amd64.exe version odo v3.6.0 (5b4959272)

Server: https://api.deoggyu0.eastus.aroapp.io:6443 Kubernetes: v1.23.12+8a6bfe4


A newer version of odo (v3.7.0) is available, visit https://github.com/redhat-developer/odo/releases to update. If you wish to disable this notification, run: odo preference set UpdateNotification false

openshift connector version 1.2.0.168

What did you run exactly?

I simply opened the panel that had some components listed in it, after a fresh start up. Then the exception threw below

This issue is reproducible each time i start my project

Actual behavior

exception thrown

Expected behavior

should gracefully handle undesired states in openshift. even if what i have is setup wrong, it should not be crashing the plugin, but instead telling me the error and (ideally) how to fix it

Any logs, error output, etc?

java.io.IOException: Process exited with an error: 1 (Exit value: 1) { "message": "failed to parse the devfile C:\Users\sreich\work\repos\Git Services\ampi-guidservice\devfile.yaml: 1 error occurred:\n\t* unable to find the following volume mounts in devfile volume components: \nvolume mount ojdbc8 belonging to the container component odjbc8\n\n" }

at com.redhat.devtools.intellij.common.utils.ExecHelper.executeWithResult(ExecHelper.java:261)
at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.execute(OdoCli.java:244)
at org.jboss.tools.intellij.openshift.utils.odo.OdoCli.discover(OdoCli.java:856)
at org.jboss.tools.intellij.openshift.utils.odo.OdoProjectDecorator.discover(OdoProjectDecorator.java:263)
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$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at com.redhat.devtools.intellij.common.utils.DownloadHelper$1.onFinished(DownloadHelper.java:199)
at com.intellij.openapi.progress.impl.CoreProgressManager.finishTask(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.finishTask(ProgressManagerImpl.java:155)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$7(CoreProgressManager.java:495)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:454)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:74)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:114)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:36)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

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) ... 45 more

sreich avatar Mar 08 '23 13:03 sreich

Hi than,k you for reporting this exception.

It seems you have a component that have an incorrect devfile ( ampi-guidservice ), and as we parse the project on startup to map with the current cluster components, that's why the message appears on each startup.

odo 3.6 supports devfiles v2 ( https://devfile.io/ ) is this component devfile can be shared with us ?

sbouchet avatar Mar 27 '23 16:03 sbouchet

Hey, yep, that is what's happening. I lost the specific devfile for it at the moment (sorry, chaos right now with the efforts i'm leading)

You should be able to reproduce it by just creating an invalid spec file (invalid tabbing or yaml property should be easy enough to reproduce).

My point with this issue wasn't for the specific case, but rather I would expect it to assume that the user is going to create a bad dev file at some point and gracefully handle it (in a similar manner to how it prompts on a label for you to re-login), rather than throw exceptions. But, that is a design question/decision

If you still have trouble reproducing, i can throw something together when i get time over the next few weeks

sreich avatar Mar 29 '23 14:03 sreich