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

Error running on Alpine docker #65

Open
ErikThorsell opened this issue Dec 17, 2018 · 8 comments
Open

Error running on Alpine docker #65

ErikThorsell opened this issue Dec 17, 2018 · 8 comments

Comments

@ErikThorsell
Copy link

ErikThorsell commented Dec 17, 2018

Perhaps related to #39.

After downloading plugin (version 3.6.0.1), as part of a pom.xml on a Jenkins agent based on an alpine-image, I get the following error:

[INFO] Protoc version: 3.6.0
protoc-jar: protoc version: 3.6.0, detected platform: linux-x86_64 (linux/amd64)
protoc-jar: embedded: bin/3.6.0/protoc-3.6.0-linux-x86_64.exe
protoc-jar: executing: [/tmp/protocjar12635287816338122886/bin/protoc.exe, --version]
protoc-jar: caught exception, retrying: java.io.IOException: Cannot run program "/tmp/protocjar12635287816338122886/bin/protoc.exe": error=2, No such file or directory
protoc-jar: executing: [/tmp/protocjar12635287816338122886/bin/protoc.exe, --version]
protoc-jar: caught exception, retrying: java.io.IOException: Cannot run program "/tmp/protocjar12635287816338122886/bin/protoc.exe": error=2, No such file or directory
protoc-jar: executing: [/tmp/protocjar12635287816338122886/bin/protoc.exe, --version]
protoc-jar: protoc version: 3.6.0, detected platform: linux-x86_64 (linux/amd64)
protoc-jar: embedded: bin/3.6.0/protoc-3.6.0-linux-x86_64.exe
[INFO] Protoc command: /root/protocjar17242107685880089516/bin/protoc.exe
[INFO] Input directories:
[INFO]     /root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf
[INFO] Output targets:
[INFO]     java: /root/workspace/_jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/target/generated-sources (add: main, clean: false, plugin: null, outputOptions: null)
[INFO] /root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/target/generated-sources does not exist. Creating...
[INFO]     Processing (java): mission.proto
protoc-jar: executing: [/root/protocjar17242107685880089516/bin/protoc.exe, -I/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf, --java_out=/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/target/generated-sources, /root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf/mission.proto]
protoc-jar: caught exception, retrying: java.io.IOException: Cannot run program "/root/protocjar17242107685880089516/bin/protoc.exe": error=2, No such file or directory
protoc-jar: executing: [/root/protocjar17242107685880089516/bin/protoc.exe, -I/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf, --java_out=/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/target/generated-sources, /root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf/mission.proto]
protoc-jar: caught exception, retrying: java.io.IOException: Cannot run program "/root/protocjar17242107685880089516/bin/protoc.exe": error=2, No such file or directory
protoc-jar: executing: [/root/protocjar17242107685880089516/bin/protoc.exe, -I/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf, --java_out=/root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/target/generated-sources, /root/workspace/jenkinsfile-test-U6PQZV3G2CJQNIADJADVA4QMJ6AJP2SFIO3MJWXBEQF7WW2TYCBA/src/main/protobuf/mission.proto]

Running the exact same project on my local machine (Windows 10) works just fine.

It seems like the plugin thinks it's running on Windows (since it's attempting to execute .exe-files). I have yet to find a workaround that works both in my CI system and locally.

@os72
Copy link
Owner

os72 commented Dec 17, 2018

It detects Linux just fine (bin/3.6.0/protoc-3.6.0-linux-x86_64.exe) but yes it seems the system isn't compatible. It rather looks like os72/protoc-jar#15, missing glibc or so

@os72 os72 changed the title Alpine docker implies environment is windows Error running on Alpine docker Dec 17, 2018
@michaelkrupp
Copy link

michaelkrupp commented Jun 30, 2019

Any plans on supporting a locally provided protoc, instead of the ones shipped with protoc-jar?
This would basically fix the issue of running on Alpine.

Edit: nevermind, you actually already do this and are just missing the documentation for it:
https://github.com/os72/protoc-jar-maven-plugin/blob/master/src/main/java/com/github/os72/protocjar/maven/ProtocJarMojo.java#L265

@contrun
Copy link

contrun commented Jul 25, 2019

How can I change the protoc command path?

@michaelkrupp
Copy link

<plugin>
	<artifactId>protoc-jar-maven-plugin</artifactId>
	<groupId>com.github.os72</groupId>
	<configuration>
		<protocCommand>protoc</protocCommand>
	</configuration>
</plugin>

@contrun does this answer your question? :-)

@contrun
Copy link

contrun commented Jul 26, 2019

@michaelkrupp Thanks

@bmarwell
Copy link

bmarwell commented Aug 2, 2019

Is this maybe related to the download issue I had?

Try to specify the artifact yourself: <pluginArtifact>com.google.protobuf:protoc:${dependency.protobuf.version}</pluginArtifact>
This will force this plugin to do maven resolution instead of trying to download it manually.

@os72
Copy link
Owner

os72 commented Aug 3, 2019

@bmhm This is a runtime issue. See os72/protoc-jar#15, missing glibc or so

@breun
Copy link

breun commented Apr 12, 2021

As a workaround I've found you can add the gcompact package (apk add gcompat), which will provide a glibc compatibility layer for Alpine's musl C library.

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

No branches or pull requests

6 participants