apache / airavata-custos

Apache Airavata Custos Security
https://airavata.apache.org/custos
Apache License 2.0
13 stars 25 forks source link

Maven build fails at docker image building on M2 Max #374

Closed DImuthuUpe closed 1 year ago

DImuthuUpe commented 1 year ago

I tried to build Custos on Apple M2 Max and got following error. Seems like it is related to this issue? https://github.com/spotify/dockerfile-maven/issues/394

[INFO] custos ............................................. SUCCESS [  0.570 s]
[INFO] custos-integration-core ............................ SUCCESS [  0.745 s]
[INFO] custos-client-sdks ................................. SUCCESS [  0.011 s]
[INFO] custos-java-clients ................................ SUCCESS [  0.009 s]
[INFO] custos-clients-core ................................ SUCCESS [  0.303 s]
[INFO] custos-core-services-client-stubs .................. SUCCESS [  0.010 s]
[INFO] tenant-profile-core-service-client-stub ............ SUCCESS [  1.593 s]
[INFO] iam-admin-core-service-client-stub ................. SUCCESS [  1.531 s]
[INFO] identity-core-service-client-stub .................. SUCCESS [  0.763 s]
[INFO] user-profile-core-service-client-stub .............. SUCCESS [  0.926 s]
[INFO] federated-authentication-core-service-client-stub .. SUCCESS [  0.762 s]
[INFO] credential-store-core-service-client-stubs ......... SUCCESS [  0.829 s]
[INFO] messaging-core-service-client-stub ................. SUCCESS [  0.813 s]
[INFO] sharing-core-service-client-stub ................... SUCCESS [  1.063 s]
[INFO] tenant-management-client ........................... SUCCESS [  0.942 s]
[INFO] identity-management-client ......................... SUCCESS [  0.789 s]
[INFO] agent-management-client ............................ SUCCESS [  0.703 s]
[INFO] group-management-client ............................ SUCCESS [  0.794 s]
[INFO] resource-secret-core-service-client-stub ........... SUCCESS [  0.735 s]
[INFO] resource-secret-management-client .................. SUCCESS [  0.691 s]
[INFO] sharing-management-client .......................... SUCCESS [  0.862 s]
[INFO] user-management-client ............................. SUCCESS [  1.149 s]
[INFO] custos-java-sdk .................................... SUCCESS [  4.727 s]
[INFO] custos-core-services ............................... SUCCESS [  0.008 s]
[INFO] custos-core-services-commons ....................... SUCCESS [  0.201 s]
[INFO] tenant-profile-core-service ........................ SUCCESS [  1.135 s]
[INFO] cluster-management-core-service-client-stub ........ SUCCESS [  0.542 s]
[INFO] custos-federated-services-clients .................. SUCCESS [  0.438 s]
[INFO] iam-admin-core-service ............................. SUCCESS [  1.557 s]
[INFO] credential-store-core-service ...................... SUCCESS [  0.891 s]
[INFO] federeted-authentication-core-service .............. SUCCESS [  1.081 s]
[INFO] identity-core-service .............................. SUCCESS [  1.016 s]
[INFO] user-profile-core-service .......................... SUCCESS [  1.102 s]
[INFO] agent-profile-core-service ......................... SUCCESS [  0.801 s]
[INFO] cluster-management-core-service .................... SUCCESS [  0.753 s]
[INFO] resource-secret-core-service ....................... SUCCESS [  0.876 s]
[INFO] custos-core ........................................ SUCCESS [  0.007 s]
[INFO] sharing-core-impl .................................. SUCCESS [  0.604 s]
[INFO] sharing-core-service ............................... SUCCESS [  0.961 s]
[INFO] custos-logging ..................................... SUCCESS [  0.621 s]
[INFO] custos-messaging-core-service ...................... SUCCESS [  0.920 s]
[INFO] agent-profile-core-service-client-stub ............. SUCCESS [  0.556 s]
[INFO] custos-logging-client-stub ......................... SUCCESS [  0.594 s]
[INFO] custos-core-services-server ........................ FAILURE [ 21.052 s]
[INFO] custos-external-services-distributions ............. SKIPPED
[INFO] custos-keycloak .................................... SKIPPED
[INFO] custos-grpc-web-proxy .............................. SKIPPED
[INFO] custos-integration-services ........................ SKIPPED
[INFO] custos-integration-services-commons ................ SKIPPED
[INFO] tenant-management-service .......................... SKIPPED
[INFO] identity-management-service ........................ SKIPPED
[INFO] user-management-service ............................ SKIPPED
[INFO] scim-service ....................................... SKIPPED
[INFO] group-management-service ........................... SKIPPED
[INFO] agent-management-service ........................... SKIPPED
[INFO] resource-secret-management-service ................. SKIPPED
[INFO] sharing-management-service ......................... SKIPPED
[INFO] log-management-service ............................. SKIPPED
[INFO] custos-integration-services-swagger ................ SKIPPED
[INFO] custos-integration-services-server ................. SKIPPED
[INFO] custos-services .................................... SKIPPED
[INFO] ide-integration .................................... SKIPPED
[INFO] custos-bootstrap-service ........................... SKIPPED
[INFO] custos-rest-proxy .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  57.406 s
[INFO] Finished at: 2023-04-04T13:52:37-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.13:build (container) on project custos-core-services-server: Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.lang.UnsatisfiedLinkError: could not load FFI provider com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider: ExceptionInInitializerError: Can't overwrite cause with java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/35/xpm2ws6s13gclylcp_9c33bw0000gn/T/jffi3222012652075478912.dylib
[ERROR]         at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
[ERROR]         at java.base/java.lang.Runtime.load0(Runtime.java:785)
[ERROR]         at java.base/java.lang.System.load(System.java:1979)
[ERROR]         at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371)
[ERROR]         at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258)
[ERROR]         at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:444)
[ERROR]         at java.base/java.lang.Class.forName0(Native Method)
[ERROR]         at java.base/java.lang.Class.forName(Class.java:488)
[ERROR]         at java.base/java.lang.Class.forName(Class.java:467)
[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 com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:187)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:66)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:62)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
[ERROR]         at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
[ERROR]         at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[ERROR]         at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
[ERROR]         at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:341)
[ERROR]         at java.base/java.lang.Class.newInstance(Class.java:677)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
[ERROR]         at com.spotify.docker.client.shaded.jnr.ffi.LibraryLoader.create(LibraryLoader.java:73)
[ERROR]         at com.spotify.docker.client.shaded.jnr.unixsocket.Native.<clinit>(Native.java:76)
[ERROR]         at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.<init>(UnixSocketChannel.java:101)
[ERROR]         at com.spotify.docker.client.shaded.jnr.unixsocket.UnixSocketChannel.open(UnixSocketChannel.java:60)
[ERROR]         at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:69)
[ERROR]         at com.spotify.docker.client.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:44)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:118)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
[ERROR]         at com.spotify.docker.client.shaded.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:435)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)
[ERROR]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[ERROR]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ERROR]         at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
[ERROR]         at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
[ERROR]         at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:50)
[ERROR]         at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:487)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:178)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:315)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:297)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:267)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
[ERROR]         at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:210)
[ERROR]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[ERROR]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ERROR]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[ERROR]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:833)
[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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[
DImuthuUpe commented 1 year ago

Using socat port forwarding to the docker socket fixed the issue https://stackoverflow.com/questions/71300031/docker-image-build-failed-on-mac-m1-chip. However, it might be better if the maven docker build library is changed as the current one is no longer maintained