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

AdoptOpenJDK 11.0.4 gives UnsatisfiedLinkError #1773

Closed
raphaelbauer opened this issue Aug 22, 2019 · 5 comments
Closed

AdoptOpenJDK 11.0.4 gives UnsatisfiedLinkError #1773

raphaelbauer opened this issue Aug 22, 2019 · 5 comments

Comments

@raphaelbauer
Copy link

We have a Java project that uses postgresql from testcontainers. The project builds fine on Macs, Travis etc.

But there is this one Mac where it does not work.

Somehow postgresql cannot be started by the testcontainers plugin and we get a long problem description (attached below). Something like InvalidConfigurationException (ping failed).

Docker is installed on that machine and docker run hello-world is running just fine. We already deinstalled docker and re-installed it - to no avail.

Any pointer why this is happening would be great. Thanks!

More specs:

  • Docker desktop for Mac 2.1.0.1 (latest)
  • Engine 19.03.1
  • Machine 0.16.01
  • MacOSX 10.14.6
  • openjdk version "11.0.4" 2019-07-16
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <version>1.12.0</version>
            <scope>test</scope>
        </dependency>
2019-08-22 20:57:14.735  INFO 663 --- [           main] o.t.d.DockerClientProviderStrategy       : Will use 'okhttp' transport
2019-08-22 20:57:15.197  INFO 663 --- [           main] o.t.d.DockerClientProviderStrategy       : Will use 'okhttp' transport
Exception in thread "tcp-unix-proxy-accept-thread" java.lang.ExceptionInInitializerError
	at org.newsclub.net.unix.AFUNIXSocket.<init>(AFUNIXSocket.java:36)
	at org.newsclub.net.unix.AFUNIXSocket.newInstance(AFUNIXSocket.java:54)
	at org.rnorth.tcpunixsocketproxy.TcpToUnixSocketProxy.lambda$start$0(TcpToUnixSocketProxy.java:86)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
	at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:42)
	... 4 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:35)
	... 4 more
Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/libjunixsocket-native-2.0.412172391289713650973.dylib: dlopen(/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/libjunixsocket-native-2.0.412172391289713650973.dylib, 1): no suitable image found.  Did find:
	/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/libjunixsocket-native-2.0.412172391289713650973.dylib: code signature in (/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/libjunixsocket-native-2.0.412172391289713650973.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
	at java.base/java.lang.Runtime.load0(Runtime.java:767)
	at java.base/java.lang.System.load(System.java:1831)
	at org.newsclub.net.unix.NarSystem.loadLibrary(NarSystem.java:39)
	... 9 more
2019-08-22 20:57:25.449  INFO 663 --- [           main] .t.d.DockerMachineClientProviderStrategy : Found docker-machine, and will use machine named 
2019-08-22 20:57:25.463 ERROR 663 --- [           main] o.t.d.DockerClientProviderStrategy       : Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2019-08-22 20:57:25.463 ERROR 663 --- [           main] o.t.d.DockerClientProviderStrategy       :     UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause UnsatisfiedLinkError (/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/jna-3631/jna11187727230720609909.tmp: dlopen(/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/jna-3631/jna11187727230720609909.tmp, 1): no suitable image found.  Did find:
	/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/jna-3631/jna11187727230720609909.tmp: code signature in (/private/var/folders/_4/8g56zqg955xc6pnp59xpg77w0000gp/T/jna-3631/jna11187727230720609909.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
2019-08-22 20:57:25.464 ERROR 663 --- [           main] o.t.d.DockerClientProviderStrategy       :     ProxiedUnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause TimeoutException (null)
2019-08-22 20:57:25.464 ERROR 663 --- [           main] o.t.d.DockerClientProviderStrategy       :     DockerMachineClientProviderStrategy: failed with exception InvalidConfigurationException (Exception when executing docker-machine status )
2019-08-22 20:57:25.464 ERROR 663 --- [           main] o.t.d.DockerClientProviderStrategy       : As no valid configuration was found, execution cannot continue
@bsideup
Copy link
Member

bsideup commented Aug 22, 2019

Hi @raphaelbauer,

Are you using AdoptOpenJDK? There seems to be an issue:
adoptium/temurin-build#1211 (comment)

If so, you can either downgrade or upgrade (see the issue for the details)

@bsideup bsideup added resolution/answered resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party. and removed resolution/answered labels Aug 22, 2019
@raphaelbauer
Copy link
Author

raphaelbauer commented Aug 23, 2019

@bsideup You are a genius. Thanks! This was the problem. It looks like the adoptopenjdk11 builds got an issue right now.

Workaround for those hitting this issue is detailed in the linked issue (adoptium/temurin-build#1211 (comment)).

@akki
Copy link

akki commented Sep 11, 2019

Thanks for the info guys. Saved me a lot of time. 🙏

@ian-speers
Copy link

In my case this issue was being masked by a java.lang.IllegalStateException: Could not find a valid Docker environment error in org.testcontainers.dockerclient.DockerClientProviderStrategy. Posting here to improve searchability.

@bsideup bsideup changed the title InvalidConfigurationException (ping failed) AdoptOpenJDK 11.0.4 gives UnsatisfiedLinkError Oct 30, 2019
@bsideup bsideup pinned this issue Oct 30, 2019
@bsideup bsideup added resolution/answered and removed resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party. labels Oct 30, 2019
@bsideup bsideup unpinned this issue Apr 14, 2020
@aferodriguez
Copy link

Good Evening, Currently Im having what looks like the same problem, but using adoptopenjdk12, please could you help me?

[tcp-unix-proxy-accept-thread] DEBUG org.rnorth.tcpunixsocketproxy.ProxyPump - Accepting incoming connection from /127.0.0.1:65434 Exception in thread "tcp-unix-proxy-accept-thread" java.lang.ExceptionInInitializerError at org.newsclub.net.unix.AFUNIXSocket.<init>(AFUNIXSocket.java:36) at org.newsclub.net.unix.AFUNIXSocket.newInstance(AFUNIXSocket.java:54) at org.rnorth.tcpunixsocketproxy.TcpToUnixSocketProxy.lambda$start$0(TcpToUnixSocketProxy.java:86) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:42) ... 4 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:35) ... 4 more Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/libjunixsocket-native-2.0.410290736493434087540.dylib: dlopen(/private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/libjunixsocket-native-2.0.410290736493434087540.dylib, 1): no suitable image found. Did find: /private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/libjunixsocket-native-2.0.410290736493434087540.dylib: code signature in (/private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/libjunixsocket-native-2.0.410290736493434087540.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617) at java.base/java.lang.Runtime.load0(Runtime.java:765) at java.base/java.lang.System.load(System.java:1866) at org.newsclub.net.unix.NarSystem.loadLibrary(NarSystem.java:39) ... 9 more 16:31:30.915 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - ProxiedUnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause TimeoutException (null) 16:31:30.916 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were: 16:31:30.916 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause UnsatisfiedLinkError (/private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/jna--1333910504/jna14289931666946055953.tmp: dlopen(/private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/jna--1333910504/jna14289931666946055953.tmp, 1): no suitable image found. Did find: /private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/jna--1333910504/jna14289931666946055953.tmp: code signature in (/private/var/folders/qm/w28xgj395s91f1jgd1gghj8c0000gn/T/jna--1333910504/jna14289931666946055953.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.) 16:31:30.916 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause NoClassDefFoundError (Could not initialize class org.testcontainers.shaded.org.scalasbt.ipcsocket.UnixDomainSocketLibrary) 16:31:30.916 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - ProxiedUnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause TimeoutException (null) 16:31:30.916 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue

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

5 participants