docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

Build on s390x architecture- could not get native definition for type: POINTER: java.lang.UnsatisfiedLinkError

Open gcrova opened this issue 6 years ago • 7 comments
trafficstars

Description

I'm using the plugin to build Docker images on x86_64, ppc64le & s390x architectures. Plugin is working fine on x86_64, ppc64le but is failing as following on s390x:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.29.0:build (build) on project ci.docker: Execution build of goal io.fabric8:docker-maven-plugin:0.29.0:build failed: An API incompatibility was encountered while executing io.fabric8:docker-maven-plugin:0.29.0:build: java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider

[ERROR] : could not get native definition for type: POINTER: java.lang.UnsatisfiedLinkError: could not locate stub library in jar file. Tried [jni/s390x-Linux/libjffi-1.2.so, /jni/s390x-Linux/libjffi-1.2.so] [ERROR] at com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:412) [ERROR] at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:355) [ERROR] at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258) [ERROR] at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:449) [ERROR] at java.lang.Class.forNameImpl(Native Method) [ERROR] at java.lang.Class.forName(Class.java:403) [ERROR] at com.kenai.jffi.Init.load(Init.java:68) [ERROR] at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) [ERROR] at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45) [ERROR] at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) [ERROR] at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242) [ERROR] at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237) [ERROR] at com.kenai.jffi.Type.resolveSize(Type.java:155) [ERROR] at com.kenai.jffi.Type.size(Type.java:138) [ERROR] at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:178) [ERROR] at jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48) [ERROR] at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:57) [ERROR] at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41) [ERROR] at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:53) [ERROR] at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49) [ERROR] at jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29) [ERROR] at java.lang.J9VMInternals.newInstanceImpl(Native Method) [ERROR] at java.lang.Class.newInstance(Class.java:1848) [ERROR] at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68) [ERROR] at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57) [ERROR] at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35) [ERROR] at jnr.ffi.LibraryLoader.create(LibraryLoader.java:73) [ERROR] at jnr.unixsocket.Native.<clinit>(Native.java:76) [ERROR] at jnr.unixsocket.UnixSocketChannel.<init>(UnixSocketChannel.java:101) [ERROR] at jnr.unixsocket.UnixSocketChannel.open(UnixSocketChannel.java:60) [ERROR] at io.fabric8.maven.docker.access.util.LocalSocketUtil.canConnectUnixSocket(LocalSocketUtil.java:38) [ERROR] at io.fabric8.maven.docker.access.DockerConnectionDetector$UnixSocketDockerHostProvider.getConnectionParameter(DockerConnectionDetector.java:109) [ERROR] at io.fabric8.maven.docker.access.DockerConnectionDetector.detectConnectionParameter(DockerConnectionDetector.java:78) [ERROR] at io.fabric8.maven.docker.service.DockerAccessFactory.createDockerAccess(DockerAccessFactory.java:34) [ERROR] at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:222) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) [ERROR] at java.lang.reflect.Method.invoke(Method.java:508) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [ERROR] -> [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/PluginContainerException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :ci.docker

Info

  • d-m-p version : 0.29.0
  • Maven version (mvn -v) : 3.5.0
  • Tested on Xenial & Trusty Ubuntu (s390x arch) with libjffi-jni libjffi-java modules installed
  • JDK: IBM JDK8

  • Docker version : 18.06.3-ce
  • If it's a bug, how to reproduce :
  • If it's a feature request, what is your use case :
  • Sample project : [GitHub Clone URL] (private repository)

Thanks a lot, any help would be appreciated. (also tried the skip.docker.machine option without success)

gcrova avatar Apr 18 '19 13:04 gcrova

The problem is, that it looks like that https://github.com/jnr/jnr-unixsocket doesn't support this architecture. d-m-p uses jnr-unixsocket for communication with the Docker daemon vail local Unix sockets. The alternative is, to use TCP for talking to the Docker daemon which I would recommend in this case.

We can only support Unix socket via jnr-unixsocket only, so I suggest to open a feature request over there to support System Z. I'm afraid, that's all we can do.

rhuss avatar Apr 20 '19 19:04 rhuss

This issues looks similar: https://github.com/jruby/jruby/issues/1389

rhuss avatar Apr 20 '19 19:04 rhuss

Hi, Ok thanks. I'm then using another way to build these images. Gael

gcrova avatar Apr 25 '19 12:04 gcrova

Hi, I had a response from jnr-unixsocket for s390x support, see https://github.com/jnr/jnr-unixsocket/issues/71 Could you please have a look and let me know if you can now support this architecture ? Thanks

gcrova avatar Jun 24 '19 08:06 gcrova

Sorry, but as long as there is no official support from jnr-unixsocket or at least included in theri distribution, there is nothing we can do from our side. d-m-p will only support released version of jnr-unixsocket.

I've seen that there has been a new release of jnr-unixsocket, so you might want to try update the dependency version in pom.xml and then build d-m-p locally to try this out.

rhuss avatar Jul 22 '19 10:07 rhuss

The same issue occurs on Apple M1 machines.

saschpe avatar Nov 02 '21 15:11 saschpe

@saschpe thanks for bringing this up. I'd propose to monitor https://github.com/jnr/jnr-unixsocket/issues/95 and soon as this is fixed and released, we can update the dependencies.

rhuss avatar Nov 16 '21 09:11 rhuss