odo icon indicating copy to clipboard operation
odo copied to clipboard

odo is not executing `run` command on java-quarkus devfile

Open kadel opened this issue 3 years ago • 2 comments

▶ odo init --name test --devfile java-quarkus --starter community

  __
 /  \__     Initializing new component
 \__/  \
 /  \__/    odo version: v3.0.0-beta3
 \__/

Interactive mode enabled, please answer the following questions:
 ✓  Downloading devfile "java-quarkus" [2s]
 ✓  Downloading starter project "community" [872ms]

Your new component 'test' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.


▶ odo dev
  __
 /  \__     Developing using the test Devfile
 \__/  \    Namespace: tkral-dev
 /  \__/    odo version: v3.0.0-beta3
 \__/

↪ Deploying to the cluster in developer mode
 •  Waiting for Kubernetes resources  ...
 ✓  Added storage m2 to
 ⚠  Pod is Pending
 ✓  Pod is Running
 ✓  Syncing files into the container [2s]
 ✓  Executing init-compile command "mvn -Dmaven.repo.local=/home/user/.m2/repository compile" on container "tools" [36s]
 -  Forwarding from 127.0.0.1:40001 -> 8080


Watching for changes in the current directory /Users/tkral/Code/odo-examples/quarkus-test
Press Ctrl+c to exit `odo dev` and delete resources from the cluster

E0811 16:35:52.106701   26001 portforward.go:406] an error occurred forwarding 40001 -> 8080: error forwarding port 8080 to pod 3ab7daf467c6f7a573bc63d70080e4a0e5b1b80fbd747eb99a22324752153555, uid : port forward into network namespace "/var/run/netns/ba0ee200-62e8-45ff-afbc-224304a0b660": failed to connect to localhost:8080 inside namespace 3ab7daf467c6f7a573bc63d70080e4a0e5b1b80fbd747eb99a22324752153555: dial tcp [::1]:8080: connect: connection refused
E0811 16:35:52.109314   26001 portforward.go:234] lost connection to pod
 -  Forwarding from 127.0.0.1:40001 -> 8080



▶ curl localhost:40001
curl: (52) Empty reply from server

There is no information in odo dev output that the run command would be executed, and the output of the odo logs suggests the same.

▶ odo logs 
...
...
...
tools: [INFO] Changes detected - recompiling the module!
tools: [INFO] Compiling 2 source files to /projects/target/classes
tools: [INFO] ------------------------------------------------------------------------
tools: [INFO] BUILD SUCCESS
tools: [INFO] ------------------------------------------------------------------------
tools: [INFO] Total time:  33.289 s
tools: [INFO] Finished at: 2022-08-11T14:35:18Z
tools: [INFO] ------------------------------------------------------------------------
▶ odo version
odo v3.0.0-beta3 (53a7c3cd1)

kadel avatar Aug 11 '22 14:08 kadel

The same devfile with the same project works correctly with odo v2. The run commands gets executed as it is supposed to.

▶ odov2 push

Validation
 ✓  Validating the devfile [47167ns]

Creating Services for component test
W0811 16:41:55.243635   29551 warnings.go:70] workspace.devfile.io/v1alpha1 DevWorkspace is deprecated; use workspace.devfile.io/v1alpha2 DevWorkspace
W0811 16:41:55.644807   29551 warnings.go:70] workspace.devfile.io/v1alpha1 DevWorkspaceTemplate is deprecated; use workspace.devfile.io/v1alpha2 DevWorkspaceTemplate
 ✓  Services are in sync with the cluster, no changes are required

Creating Kubernetes resources for component test
 ✓  Added storage m2 to test
 ✓  Waiting for component to start [26s]
W0811 16:42:31.618031   29551 warnings.go:70] workspace.devfile.io/v1alpha1 DevWorkspace is deprecated; use workspace.devfile.io/v1alpha2 DevWorkspace
W0811 16:42:32.018643   29551 warnings.go:70] workspace.devfile.io/v1alpha1 DevWorkspaceTemplate is deprecated; use workspace.devfile.io/v1alpha2 DevWorkspaceTemplate
 ✓  Links are in sync with the cluster, no changes are required
 ✓  Waiting for component to start [118ms]

Applying URL changes
 ✓  URL http-quarkus: http://http-quarkus-4e8e07fb-tkral-dev.apps.sandbox.x8i5.p1.openshiftapps.com/ created

Syncing to component test
 ✓  Checking files for pushing [18ms]
 ✓  Syncing files to the component [2s]

Executing postStart event commands for component test
 ✓  Executing init-compile command "mvn -Dmaven.repo.local=/home/user/.m2/repository compile" [33s]

Executing devfile commands for component test
 ✓  Executing dev-run command "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager", if not running [2s]

Pushing devfile component "test"
 ✓  Changes successfully pushed to component

kadel avatar Aug 11 '22 14:08 kadel

Indeed, this is annoying. It looks like this is due to the run command being marked as hotReloadCapable in the Devfile. I saw this in the logs after quickly trying to reproduce the issue:

0811 18:31:36.045447 3870489 commandhandler.go:90] command is hot-reload capable, not restarting dev-run

rm3l avatar Aug 11 '22 16:08 rm3l

nextjs devfile has a similar problem.

valaparthvi avatar Aug 23 '22 13:08 valaparthvi