Open jagraj opened 4 years ago
/priority stopship
@sghung pls review. Thanks
Using Eclipse + codewind 0.8.0 + mac, I see this issue as well, s o we can rule this out as being a windows only issue. I will keep investigating and add comments with updates
Isolating the problem further, if calling it outside of codewind (i.e. appsody init
on the OS), it does work.
The output is as follows:
Setting up the development environment Pulling docker image docker.io/appsody/java-microprofile:0.2 Running command: docker pull docker.io/appsody/java-microprofile:0.2 0.2: Pulling from appsody/java-microprofile Digest: sha256:44deecb2d0b2567e964444e9ba9d50417b355a0c3956237e0de74f1e248aa0db Status: Image is up to date for appsody/java-microprofile:0.2 docker.io/appsody/java-microprofile:0.2 [Warning] The stack image does not contain APPSODY_PROJECT_DIR. Using /project Running command: docker run --rm --entrypoint /bin/bash docker.io/appsody/java-microprofile:0.2 -c find /project -type f -name .appsody-init.sh Extracting project from development environment [Warning] The stack image does not contain APPSODY_PROJECT_DIR. Using /project [Warning] Path /Users/stevenhung/eclipse-workspaceDec2019_20/microprofilefail/pom.xml for mount points to a single file. Single file Docker mount paths cause unexpected behavior and will be deprecated in the future. Running command: docker create --name microprofilefail-extract -v /Users/stevenhung/.m2/repository:/mvn/repository -v /Users/stevenhung/eclipse-workspaceDec2019_20/microprofilefail/src:/project/user-app/src -v /Users/stevenhung/eclipse-workspaceDec2019_20/microprofilefail/pom.xml:/project/user-app/pom.xml docker.io/appsody/java-microprofile:0.2 Running command: docker cp microprofilefail-extract:/project /Users/stevenhung/.appsody/extract/microprofilefail Running command: docker rm microprofilefail-extract -f Project extracted to /Users/stevenhung/eclipse-workspaceDec2019_20/microprofilefail/.appsody_init Running command: ./.appsody-init.sh [InitScript] [INFO] Scanning for projects... [InitScript] [INFO] [InitScript] [INFO] -------------------< dev.appsody:java-microprofile >-------------------- [InitScript] [INFO] Building java-microprofile 0.2.21 [InitScript] [INFO] --------------------------------[ pom ]--------------------------------- [InitScript] [INFO] [InitScript] [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ java-microprofile --- [InitScript] [INFO] Skipping Rule Enforcement. [InitScript] [INFO] [InitScript] [INFO] --- maven-install-plugin:2.4:install (default-install) @ java-microprofile --- [InitScript] [INFO] Installing /Users/stevenhung/eclipse-workspaceDec2019_20/microprofilefail/.appsody_init/pom.xml to /Users/stevenhung/.m2/repository/dev/appsody/java-microprofile/0.2.21/java-microprofile-0.2.21.pom [InitScript] [INFO] ------------------------------------------------------------------------ [InitScript] [INFO] BUILD SUCCESS [InitScript] [INFO] ------------------------------------------------------------------------ [InitScript] [INFO] Total time: 0.884 s [InitScript] [INFO] Finished at: 2020-01-10T11:16:34-05:00 [InitScript] [INFO] ------------------------------------------------------------------------ Successfully initialized Appsody project with the stack and the default template.
When it fails on my machine (calling in codewind), I see the output:
Running development environment...
Pulling docker image docker.io/appsody/java-microprofile:0.2
Running command: docker pull docker.io/appsody/java-microprofile:0.2
0.2: Pulling from appsody/java-microprofile
Digest: sha256:44deecb2d0b2567e964444e9ba9d50417b355a0c3956237e0de74f1e248aa0db
Status: Image is up to date for appsody/java-microprofile:0.2
[Warning] Could not stat mount path: /root/.m2/repository
[Warning] Could not mount /root/.m2/repository:/mvn/repository because the local file was not found.
Running command: docker run --rm -P --name cw-microprofilefail-905c2730-33bf-11ea-9f23-91642edbb008 --network codewind_network -v /Users/stevenhung/codewind-data/microprofilefail/src:/project/user-app/src -v /Users/stevenhung/codewind-data/microprofilefail/pom.xml:/project/user-app/pom.xml -v appsody-controller-0.3.3:/.appsody -t --entrypoint /.appsody/appsody-controller docker.io/appsody/java-microprofile:0.2 --mode=run
[Container] Running APPSODY_PREP command: ../validate.sh && mvn -B -Dmaven.repo.local=/mvn/repository install -DskipTests && /project/install-dev-deps.sh
[Container] Error: Could not find Maven pom.xml
[Container]
[Container] The project directory (containing an .appsody-conf.yaml file) must contain a pom.xml file.
[Container] On Windows and MacOS, the project directory should also be shared with Docker:
[Container] - Win: https://docs.docker.com/docker-for-windows/#shared-drives
[Container] - Mac: https://docs.docker.com/docker-for-mac/#file-sharing
[Container]
[Container] [Error] FATAL error APPSODY_PREP command received an error. The controller is exiting: exit status 1
[Error] Error in 'appsody run': exit status 1
I tried creating 3 more projects and all of them worked. It could be a timing issue as it isn't reproducible 100% of the time.
I reset my codewind environment again (cleared all the projects). I cannot reproduce the scenario despite being able to on Friday. I am using the same home network that I had hit the problem originally with. I had hoped to investigate the theory that the pom.xml isn't available at the time the appsody run
was called, but I cannot verify.
@jagraj in your error scenario above, if you call a build again after, does it fix the problem? Another colleague and I ran into that problem on Friday but on a re-build, it ended up fixing the problem. That might isolate the issue more towards a timing issue as opposed to a sharing volume issue.
Update: I can consistently re-create this issue and get the error shown at the end of the comment. If I stop codewind and start it up, then start eclipse + codewind, and for the first appsody microprofile it will always hit the error.
Observations:
[Warning] Could not stat mount path: /root/.m2/repository
[Warning] Could not mount /root/.m2/repository:/mvn/repository because the local file was not found.
Running command: docker run --rm -P --name cw-failingappsodytwo-9df0db10-362c-11ea-bed5-d7bff229df3a --network codewind_network -v /Users/stevenhung/codewind-data/failingappsodytwo/src:/project/user-app/src -v /Users/stevenhung/codewind-data/failingappsodytwo/pom.xml:/project/user-app/pom.xml -v appsody-controller-0.3.3:/.appsody -t --entrypoint /.appsody/appsody-controller docker.io/appsody/java-microprofile:0.2 --mode=run
[Container] Running APPSODY_PREP command: ../validate.sh && mvn -B -Dmaven.repo.local=/mvn/repository install -DskipTests && /project/install-dev-deps.sh
[Container] Installing parent dev.appsody:java-microprofile:0.2.21
[Container] [[1;34mINFO[m] Scanning for projects...
[Container] [[1;34mINFO[m]
[Container] [[1;34mINFO[m] [1m-------------------< [0;36mdev.appsody:java-microprofile[0;1m >--------------------[m
[Container] [[1;34mINFO[m] [1mBuilding java-microprofile 0.2.21[m
[Container] [[1;34mINFO[m] [1m--------------------------------[ pom ]---------------------------------[m
[Container] [[1;34mINFO[m]
[Container] [[1;34mINFO[m] [1m--- [0;32mmaven-enforcer-plugin:3.0.0-M2:enforce[m [1m(enforce-versions)[m @ [36mjava-microprofile[0;1m ---[m
[Container] [[1;34mINFO[m] Skipping Rule Enforcement.
[Container] [[1;34mINFO[m]
[Container] [[1;34mINFO[m] [1m--- [0;32mmaven-install-plugin:2.4:install[m [1m(default-install)[m @ [36mjava-microprofile[0;1m ---[m
[Container] [[1;34mINFO[m] Installing /project/user-app/../pom.xml to /mvn/repository/dev/appsody/java-microprofile/0.2.21/java-microprofile-0.2.21.pom
[Container] [[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[Container] [[1;34mINFO[m] [1;32mBUILD SUCCESS[m
[Container] [[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[Container] [[1;34mINFO[m] Total time: 1.315 s
[Container] [[1;34mINFO[m] Finished at: 2020-01-13T17:46:39Z
[Container] [[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[Container] failed to load external entity "pom.xml"
[Container] failed to load external entity "pom.xml"
[Container] failed to load external entity "pom.xml"
[Container] Project pom.xml is missing the required parent:
[Container]
[Container]
[Container] [Error] FATAL error APPSODY_PREP command received an error. The controller is exiting: exit status 1
[Error] Error in 'appsody run': exit status 1
I tried to re-direct the contents of the directory to a .log file. But I couldn't reproduce the problem anymore. It might have affected the timing. Basically in the appsody extension, I log ls -la
and also log pom.xml
so we can be sure what is there. I will keep trying to reproduce with this extra debugging.
I tried on my windows VM after recovering my docker issues. Out of two projects, the 2nd appsody microprofile project failed to build with the following issue.
[Container] [[1;34mINFO[m] Total time: 5.334 s
[Container] [[1;34mINFO[m] Finished at: 2020-01-15T20:20:45Z
[Container] [[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[Container] failed to load external entity "pom.xml"
[Container] failed to load external entity "pom.xml"
[Container] failed to load external entity "pom.xml"
[Container] Project pom.xml is missing the required parent:
[Container]
[Container] <parent>
[Container] <groupId>dev.appsody</groupId>
[Container] <artifactId>java-microprofile</artifactId>
[Container] <version></version>
[Container] <relativePath/>
[Container] </parent>
[Container]
[Container] [Error] FATAL error APPSODY_PREP command received an error. The controller is exiting: exit status 1
[Error] Error in 'appsody run': exit status 1
I could not readily reproduce this on VSCode (maybe once out of many attempts), but on Eclipse I do see it (I'm on Mac). As noted by others it usually happens on first create of the project but a manual build request resolves the problem.
FFIW, I do not see this problem with the new java-openliberty
stack, which is meant to be the replacement for the java-microprofile
stack
Shelling into the appsody container in the short time before it go does, this is what I see:
root@b8335126f5d7:/project/user-app# ls -la
ls: cannot access 'pom.xml': No such file or directory
total 16
drwxr-xr-x 1 root root 4096 Jan 16 19:41 .
drwxr-xr-x 1 root root 4096 Nov 26 15:02 ..
-????????? ? ? ? ? ? pom.xml
drwxrwxr-x 4 root root 128 Jan 16 19:41 src
drwxr-xr-x 3 root root 4096 Nov 26 15:02 target
I'm really wondering whether or not this is another manifestation of the single file mount issue that we encountered in #1202? (and as noted above the java-openliberty
stack does not have this issue; it also doesn't single file mount the pom.xml
)
I removed all the m2e
components from my Eclipse install, and after that, I do not run into this problem any longer.
This strongly suggest to me that we are seeing something very similar to what I noted here https://github.com/eclipse/codewind/issues/1202#issuecomment-557596131
Basically:
pom.xml
is a single mounted file, (which is a practice appsody is moving away from since finding out it is only officially supported on Linux).state NFS file handle
)pom.xml
somehow after it was mounted to the appsody containerm2e
tooling is the thing that's modifying the pom.xml
somehow @sghung was there a workaround you were going to merge?
I'm not aware of a code workaround (but maybe @sghung did find one). A manual workaround is to simply request to build the project.
Given that the replacement java-openliberty
stack is out and the java-microprofile
stack is to be (eventually) removed, I wonder if we can put a note in the docs or what's new telling users to use the new stack and lower the priority of this issue?
The workaround that Jag and I had used (when we hit similar issues about missing pom.xml) was to run a manual build again and it would fix the problem.
From the investigation above, we suspect the cause is due to the single file mount in the microprofile stack (reported here: https://github.com/appsody/appsody/issues/794). The Open Liberty stack does not have single file mounts and is used to replace the microprofile stack.
Right now, we recommend people use the java-openliberty stack instead of the java-microprofile
Jag agreed to remove the stopship tag
removing 0.8.0 release tag
Codewind version: 0.8.0 OS: Windows
Che version: IDE extension version: Codewind 0.8.0 IDE version: Eclipse - 2019-09 Kubernetes cluster:
Description:
Appsody eclipse microprofile fails to build on Windows. It is complaining about disk share issue and I already have disk shared in my docker. You can see the screenshot below.
Logs:
.log pfe.txt
Steps to reproduce:
Workaround: