-
Notifications
You must be signed in to change notification settings - Fork 80
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
Protoc Plugin fails when build runs in Alpine container #23
Comments
Is it the problem same as was reported in #12 ? |
Actually, I don't think it's the same issue. The binary is downloaded successfully Here is some output. Initial Run:
Showing the file exists (downloaded without execute permissions)
2nd run after modifying execute permissions
Again, showing permissions didn't revert after mvn goal:
Attempting to execute the binary manually:
|
I fixed the issue, and it is what I suggested. The musl libc included with alpine is not compatible with the protoc binary built by google. I added the install instructions included here to my alpine Dockerfile and now the build is successful. |
Closing, as I believe it's definitely not an issue with the plugin but it is an error message that may send a user down a long path. |
1. alpine linux 裡的 musl libc 未能如期支援 google 的 protoc xolstice/protobuf-maven-plugin#23 2. 加入 alpine-pkg-glibc 可以解決 gRPC 不支援問題 https://github.com/sgerrand/alpine-pkg-glibc
Just hit the same problem... Switched to Amazon Corretto... $ docker run -it --rm --name my-maven-project
-v "$(pwd)":/usr/src/mymaven
-w /usr/src/mymaven
maven:3.5.4-jdk-8-alpine mvn -s settings.xml test
...
...
Caused by: java.io.IOException: Cannot run program "/usr/src/mymaven/my-protoc-test/target/protoc-plugins/protoc-3.9.1-linux-x86_64.exe": error=2, No such file or directory
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
at java.lang.Runtime.exec (Runtime.java:620)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:660)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:89)
at org.xolstice.maven.plugin.protobuf.Protoc.execute (Protoc.java:242)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute (AbstractProtocMojo.java:569)
at org.xolstice.maven.plugin.protobuf.AbstractProtocTestCompileMojo.execute (AbstractProtocTestCompileMojo.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec (Native Method)
at java.lang.UNIXProcess.<init> (UNIXProcess.java:247)
at java.lang.ProcessImpl.start (ProcessImpl.java:134)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029)
at java.lang.Runtime.exec (Runtime.java:620)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:660)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:89)
at org.xolstice.maven.plugin.protobuf.Protoc.execute (Protoc.java:242)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute (AbstractProtocMojo.java:569)
at org.xolstice.maven.plugin.protobuf.AbstractProtocTestCompileMojo.execute (AbstractProtocTestCompileMojo.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my-protoc-plugin-parent 1.0.0-SNAPSHOT ........... SUCCESS [01:52 min]
[INFO] my-protoc-plugin ................................. SUCCESS [01:18 min]
[INFO] my-protoc-plugin-test 1.0.0-SNAPSHOT ............. FAILURE [ 17.538 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:17 min
[INFO] Finished at: 2019-11-15T07:48:56Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:test-compile (protoc-my) on project my-protoc-plugin-test: An error occurred while invoking protoc: Error while executing process.: Cannot run program "/usr/src/mymaven/my-protoc-test/target/protoc-plugins/protoc-3.9.1-linux-x86_64.exe": error=2, No such file or 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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :my-protoc-plugin-test |
This may not be an issue with this plugin, however if alpine is not supported I believe the plugin should be more explicit. Changing the image to ubuntu fixes the issue. This may be a musl libc vs glibc issue, but I thought I'd open it here so it's more obvious for users if running the plugin on an unsupported OS.
OS Detection log:
Gives:
Repro:
used the following Dockerfile:
and plugin config:
The text was updated successfully, but these errors were encountered: