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

mvn liberty:devc failed on Windows. Error response from daemon: container create: no such file or directory. #330

Closed
abdulmateen-1 opened this issue Jan 29, 2024 · 9 comments

Comments

@abdulmateen-1
Copy link

Doing the lab Getting started with open liberty
Running locally on a Windows 10 machine
Section Developing the application in a docker container

When I run
mvn liberty:devc

I got this error:

mvn liberty:devc
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------< io.openliberty.guides:guide-getting-started >-------------
[INFO] Building guide-getting-started 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- liberty-maven-plugin:3.8.2:devc (default-cli) @ guide-getting-started ---
[INFO] The recompileDependencies parameter is set to "false". On a file change only the affected classes will be recompiled.
[INFO] Running maven-resources-plugin:resources
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\7J5953897\learning\guide-getting-started\finish\src\main\resources
[INFO] Running maven-compiler-plugin:compile on C:\Users\7J5953897\learning\guide-getting-started\finish\pom.xml
[INFO] Nothing to compile - all classes are up to date
[INFO] Running maven-resources-plugin:testResources
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\7J5953897\learning\guide-getting-started\finish\src\test\resources
[INFO] Running maven-compiler-plugin:testCompile on C:\Users\7J5953897\learning\guide-getting-started\finish\pom.xml
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\7J5953897\learning\guide-getting-started\finish\target\test-classes
[INFO] Running liberty:deploy
[INFO] Copying 1 file to C:\Users\7J5953897\learning\guide-getting-started\finish\target\liberty\wlp\usr\servers\defaultServer
[WARNING] C:\Users\7J5953897\learning\guide-getting-started\finish\target\liberty\wlp\usr\servers\defaultServer\configDropins\overrides\liberty-plugin-variable-config.xml file deleted before processing plugin configuration.
[INFO] CWWKM2144I: Update server configuration file server.xml from C:\Users\7J5953897\learning\guide-getting-started\finish\src\main\liberty\config\server.xml.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] Application configuration is found in server.xml : guide-getting-started.war
[INFO] CWWKM2160I: Installing application guide-getting-started.war.xml.
[INFO] Copying 1 file to C:\Users\7J5953897\learning\guide-getting-started\finish\target\liberty\wlp\usr\servers\defaultServer
[WARNING] C:\Users\7J5953897\learning\guide-getting-started\finish\target\liberty\wlp\usr\servers\defaultServer\configDropins\overrides\liberty-plugin-variable-config.xml file deleted before processing plugin configuration.
[INFO] CWWKM2144I: Update server configuration file server.xml from C:\Users\7J5953897\learning\guide-getting-started\finish\src\main\liberty\config\server.xml.
[INFO] Building Docker image...
[INFO] docker build --pull -f C:\Users\7J5953897\learning\guide-getting-started\finish\target\.libertyDevc\tempDockerfile10664630618834107563 -t guide-getting-started-dev-mode C:\Users\7J5953897\learning\guide-getting-started\finish
[INFO] The RUN features.sh command is detected in the Dockerfile and extra time may be necessary when installing features.
[INFO] Sending build context to Docker daemon  60.82MB
[INFO]
[INFO] STEP 1/8: FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi
[INFO] Trying to pull icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi...
[INFO] Getting image source signatures
[INFO] Checking if image destination supports signatures
[INFO] Copying blob sha256:0383cee21c8bd4c5f8dad78b2a955a6a67caf45bb64508693a7e1d7f7bbd341a
[INFO] Copying blob sha256:fbba58c0aeb5ce07147e99ec5051d2779fe3d8cc15ceb4a50c075793cd03d998
[INFO] Copying blob sha256:159f914b1a7981aa28c1d20c1319c2af0be1baa0b010280d8f701786e0c23205
[INFO] Copying blob sha256:bc460aad042325cd60376c2e14bbca1182eb6213cd269f7ff2b21a78f4808c19
[INFO] Copying blob sha256:adf22a53365a02dbb0e9d8da112fd5d004d6494ca95542185981d5172abe2afb
[INFO] Copying blob sha256:410a01b7eb6d1df7af318fcefd933eb495bac20736871e6f911d7904cf683128
[INFO] Copying blob sha256:287f184acf327de222f6597b52ec47e0079242a676166edf6c9e01667f62ad9c
[INFO] Copying blob sha256:982c13ebd4ca7daf5764933700f049e1946a0933b60b440c36552630cf4f938d
[INFO] Copying blob sha256:a932a3eeb76ca058b5212589ab3093bed07de7cd76df82369e4c13acb7ccdade
[INFO] Copying blob sha256:635cb7b6386e30037871a35e2baaf28d2c3a3116e580d369e9343dc588e0f9df
[INFO] Copying blob sha256:7a7e9ad3e1d2456da8e8a1edb2ae75177f31fb12dfe5cb998edf935409fc6161
[INFO] Copying blob sha256:1f44e29caba57a6cc606ff5142288d38d0834a402dae73c8728a9fbd432f6d6f
[INFO] Copying blob sha256:725f7899ff4a57a2989fc34e472f3fb3721e50b6272c3db54b91a0172859e949
[INFO] Copying blob sha256:a5c067724741d3b99c29147c452bccb86bf253c98575e3535ed62f1eb3e3e08b
[INFO] Copying blob sha256:7ee42f0bfc8fe6a697211a22052bd4ad935a0ebeedfb50651f2fff9b25e6dd1a
[INFO] Copying blob sha256:6754fdca4156c6ad5d42feb7131fe7ff9fbba2d986d09934fd3df66792697e21
[INFO] Copying blob sha256:4ae1f0f72151e39199a34175ec531c1c08fdd7f772532e7088bde5335afc002e
[INFO] Copying config sha256:c86c7d66a68a193f7d44e69e6481895cdcbe0cac15bc90ef7705105ce7b90cbf
[INFO] Writing manifest to image destination
[INFO] Storing signatures
[INFO] STEP 2/8: ARG VERSION=1.0
[INFO] --> Using cache 15ff58b95fc9cee7cd22af9ca07f2c92bb18c9f7a6c58316709f361b3102f5f8
[INFO] --> 15ff58b95fc9
[INFO] STEP 3/8: ARG REVISION=SNAPSHOT
[INFO] --> Using cache 33a22ba377b6ae86ae9464e596c3d17f48f8ff6e6db0346b68df2e8f889fc288
[INFO] --> 33a22ba377b6
[INFO] STEP 4/8: LABEL org.opencontainers.image.authors="Your Name" org.opencontainers.image.vendor="IBM" org.opencontainers.image.url="local" org.opencontainers.image.source="https://github.com/OpenLiberty/guide-getting-started" org.opencontainers.image.version="$VERSION" org.opencontainers.image.revision="$REVISION" vendor="Open Liberty" name="system" version="$VERSION-$REVISION" summary="The system microservice from the Getting Started guide" description="This image contains the system microservice running with the Open Liberty runtime."
[INFO] --> 16f3ff954852
[INFO] STEP 5/8: COPY --chown=1001:0 src/main/liberty/config/ /config/
[INFO] --> 6ef9ef7ad54a
[INFO] STEP 6/8: RUN features.sh
[INFO] + SNIPPETS_SOURCE=/opt/ol/helpers/build/configuration_snippets
[INFO] + SNIPPETS_TARGET=/config/configDropins/overrides
[INFO] + SNIPPETS_TARGET_DEFAULTS=/config/configDropins/defaults
[INFO] + mkdir -p /config/configDropins/overrides
[INFO] + mkdir -p /config/configDropins/defaults
[INFO] + '[' -n '' ']'
[INFO] + '[' '' == client ']'
[INFO] + '[' '' == embedded ']'
[INFO] + [[ -n '' ]]
[INFO] + '[' '' == true ']'
[INFO] + '[' '' == true ']'
[INFO] + featureUtility installServerFeatures --acceptLicense defaultServer --noCache
[INFO] + find /opt/ol/wlp/lib /opt/ol/wlp/bin '!' -perm -g=rw -print0
[INFO] + xargs -0 -r chmod g+rw
[INFO] --> 17a753405bdb
[INFO] STEP 7/8: ENV OPENJ9_SCC=false
[INFO] --> 77a8ccb8984a
[INFO] STEP 8/8: RUN configure.sh
[INFO] COMMIT docker.io/library/guide-getting-started-dev-mode:latest
[INFO] --> 8e64430d5775
[INFO] Successfully tagged docker.io/library/guide-getting-started-dev-mode:latest
[INFO] 8e64430d5775ef2a801ff225925dda4a225a73b75e778aa5431b4cc00efe0f37
[INFO] Successfully built 8e64430d5775
[INFO] Successfully tagged guide-getting-started-dev-mode
[INFO] SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
[WARNING] The docker build command took longer than 30 seconds. You may increase performance by adding unneeded files and directories such as any Liberty runtime directories to a .dockerignore file in C:\Users\7J5953897\learning\guide-getting-started\finish.
[INFO] Completed building Docker image.
[INFO] Starting Docker container...
[INFO] docker run --rm -p 9080:9080 -p 9443:9443 -p 7777:7777 -e WLP_DEBUG_SUSPEND=n -e WLP_DEBUG_ADDRESS=7777 -e WLP_DEBUG_REMOTE=y -v C:\Users\7J5953897\learning\guide-getting-started\finish\target/.libertyDevc/apps:/config/apps -v C:\Users\7J5953897\learning\guide-getting-started\finish\target/.libertyDevc/dropins:/config/dropins -v C:\Users\7J5953897\learning\guide-getting-started\finish:/devmode -v C:\Users\7J5953897\learning\guide-getting-started\finish\target\liberty\wlp\usr\servers\defaultServer/logs:/logs -v C:\Users\7J5953897\.m2\repository:/devmode-maven-cache --name liberty-dev guide-getting-started-dev-mode server debug defaultServer -- --io.openliberty.tools.projectRoot=/devmode
[ERROR] docker: Error response from daemon: container create: statfs /mnt/c/Users/7J5953897/learning/guide-getting-started/finish/target/.libertyDevc/dropins: no such file or directory.
[ERROR] See 'docker run --help'.
[ERROR] An error occurred while running the container: docker: Error response from daemon: container create: statfs /mnt/c/Users/7J5953897/learning/guide-getting-started/finish/target/.libertyDevc/dropins: no such file or directory. RC=127
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:27 min
[INFO] Finished at: 2024-01-29T11:15:55-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.8.2:devc (default-cli) on project guide-getting-started: Error starting the server in dev mode.: An error occurred while running the container: docker: Error response from daemon: container create: statfs /mnt/c/Users/7J5953897/learning/guide-getting-started/finish/target/.libertyDevc/dropins: no such file or directory. RC=127 -> [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/MojoExecutionException
@abdulmateen-1
Copy link
Author

I removed the command to mount dropins and the container was started successfully.
-v C:\Users\7J5953897\learning\guide-getting-started\start\target/.libertyDevc/dropins:/config/dropins \

@gkwan-ibm
Copy link
Member

hi @abdulmateen-1

would you tell us

  • which docker you used? DockerDesktop, RancherDesktop, Colima, or other?
  • run mvn -version

@abdulmateen-1
Copy link
Author

Hi @gkwan-ibm

I used podman and podman desktop to run the application
This is my output of mvn --version

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\Program Files\apache-maven-3.8.6
Java version: 17.0.4, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.4.8-hotspot
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

@gkwan-ibm
Copy link
Member

hi @abdulmateen-1

  • Is your Win also installed docker too? I mean only podman?
  • which podman desktop you used? would you point to us so that we can try it out?
    Thanks

@abdulmateen-1
Copy link
Author

Yeah I have docker daemon installed on my Win and not the Desktop. I don't have the desktop installed.
I used podman desktop v1.0.1

@gkwan-ibm
Copy link
Member

download from https://podman-desktop.io/?

@abdulmateen-1
Copy link
Author

Yes it was downloaded from there, I know there is a new release but I've not yet updated it.

@Ruilin-Ma
Copy link
Contributor

Ruilin-Ma commented Feb 5, 2024

Hi @abdulmateen-1,

I was able to reproduce the issue with the similar configuration (Win 10, Java 17, Maven 3.8.8, Podman Desktop). I observed that this issue occurs when executing the command mvn liberty:devc while the Docker service is disabled, and the Podman service is running by Podman Desktop, leading to the error you mentioned.

The problem arises because mvn liberty:devc defaults to use Docker rather than Podman, especially if Docker is installed on the system (The devc goal will continue to use Docker service even if the Docker service is not running). Consequently, in this scenario, the devc goal attempts to utilize the Docker service, unaware that it is actually being run with Podman service.

To address this issue, I recommend enabling only the Docker engine/Desktop without the concurrent activation of the Podman service, or uninstalling the Docker engine/Desktop and using Podman exclusively.

Moreover, you may have encountered a deprecated error while attempting to execute the devc goal.

[ERROR] DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
[ERROR]             BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
[ERROR]             environment-variable.
[ERROR] 

Please be advised that to resolve this error, it is recommended to update the liberty-maven-plugin version in the pom.xml file from 3.8.2 to 3.10. An upcoming guide update will also address this issue.

<plugin>
   <groupId>io.openliberty.tools</groupId>
   <artifactId>liberty-maven-plugin</artifactId>
   <version>3.8.2</version> --> update to 3.10
</plugin>

Could you please try these solutions to see if they resolve the issue? Thank you.

@abdulmateen-1
Copy link
Author

Sorry for the late response, that resolved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants