/kind bug
Operating System:
macOS
Output of odo version:
โถ odo version
odo v1.2.5 (552aad7ea)
โถ odo create java-maven
Experimental mode is enabled, use at your own risk
Validation
โ Checking devfile existence [39413ns]
โ Checking devfile compatibility [84734ns]
โ Creating a devfile component from registry: DefaultDevfileRegistry [89449ns]
โ Validating devfile component [247861ns]
Please use `odo push` command to create the component with source deployed
โถ odo push
Validation
โ Validating the devfile [188307ns]
Creating Kubernetes resources for component java-maven
โ Waiting for component to start [2m]
Applying URL changes
โ URL http-8080: http://http-8080-java-maven-tkral-test.apps.testocp4x.psiodo.net/ created
Syncing to component java-maven
โ Checking files for pushing [5ms]
โ Syncing files to the component [25s]
Executing devfile commands for component java-maven
โ Executing mvn-package command "mvn package", if not running [1m]
โ Executing run command "java -jar target/*.jar", if not running [2s]
Pushing devfile component java-maven
โ Changes successfully pushed to component
โถ curl http://http-8080-java-maven-tkral-test.apps.testocp4x.psiodo.net/
Greetings from Spring Boot!%
โถ odo storage create mystorage --path=/data --size=1Gi
โ Added storage mystorage to java-maven
Please use `odo push` command to make the storage accessible to the component
โถ odo push
Validation
โ Validating the devfile [124117ns]
Creating Kubernetes resources for component java-maven
โ Waiting for component to start [4m]
Applying URL changes
โ URLs are synced with the cluster, no changes are required.
Syncing to component java-maven
โ Checking file changes for pushing [3ms]
โ Syncing files to the component [2s]
Executing devfile commands for component java-maven
โ Executing mvn-package command "mvn package", if not running [3s]
โ Failed to start component with name java-maven. Error: Failed to create the component: command execution failed: unable to execute the run command: unable to exec command [/bin/sh -c mvn package]:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.089 s
[INFO] Finished at: 2020-08-26T09:42:09Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/projects). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
: error while streaming command: command terminated with exit code 1
source code should be present in container and my application should be running after odo push
build command while running odo push fails because the directory where the application source is supposed to be is empty.
โถ oc exec java-maven-748556d67-kmk7x -- ls /projects
?
devfile.yaml
The problem is in the sync code. After the storage is mounted, the pod is restarted and source code files are lost. Any command which causes the pod to restart will break the component.
is it related with this https://github.com/openshift/odo/pull/3409??
is it related with this #3409??
I don't think so, that bug was causing the redeployment. Here the issue is about the syncing after a redeployment not being handled by the sync adapter.
I'm hitting this issue too, without using odo storage.
It seems syncing is entirely broken whenever a component is restarted on a push (with or without the -f flag). If the component restarts, it only ever syncs the delta, based on what's in odo-file-index.json.
It seems odo is no longer determining when it needs to bypass the odo-file-index.json file (such as when a component is redeployed). I can also confirm that odo v1.2.5 works fine.
I think the reason why this is happening is because we're no longer resetting the index file on a force push:
https://github.com/openshift/odo/commit/4a67c9adaf5dc349134f61f81f910b5b0f15e336#diff-474c230eecd0c5084d941b6d880143b1L111
In my opinion, this should be high priority given how visible it is, and it's a regression from v1.2.5 functionality
/priority high
Confirmed this is due to https://github.com/openshift/odo/pull/3619 ... removing the index-removal code was intentional, but it looks like it regresses the 'sync after new pod' scenario as seen on this issue.
New PR to do those things, plus an integration test to verify the behaviour: https://github.com/openshift/odo/pull/3859
Assigning to myself since I introduced the behaviour (FYI @mik-dass , who is the current assignee)
/assign
/unassign @mik-dass
Most helpful comment
I'm hitting this issue too, without using
odo storage.It seems syncing is entirely broken whenever a component is restarted on a push (with or without the
-fflag). If the component restarts, it only ever syncs the delta, based on what's inodo-file-index.json.It seems odo is no longer determining when it needs to bypass the
odo-file-index.jsonfile (such as when a component is redeployed). I can also confirm that odo v1.2.5 works fine.I think the reason why this is happening is because we're no longer resetting the index file on a force push:
https://github.com/openshift/odo/commit/4a67c9adaf5dc349134f61f81f910b5b0f15e336#diff-474c230eecd0c5084d941b6d880143b1L111
In my opinion, this should be high priority given how visible it is, and it's a regression from v1.2.5 functionality
/priority high