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

Bundled libsigar-amd64-linux.so not compatible with Alpine Linux #5

Open
marklieberman opened this issue May 6, 2016 · 4 comments
Open

Comments

@marklieberman
Copy link

marklieberman commented May 6, 2016

I have a Java8 application that runs in an Ubuntu-based Docker container. It works fine but I am trying to shrink it down a bit by using an Alpine Linux-based Docker container.

From what I can gather, it seems like the standard libsigar in the JAR file isn't compatible with Alpine Linux (something about glibc vs. musl libc?) In any case, there a Sigar package that provides me with a working libsigar via the OS's package manager.

How can I tell sigar-loader or Kamon to just use the OS's version of the library rather than the JAR?


The error when I try to run my application in Alpine Linux is:

Oops, cannot start the server.
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting method, java.lang.UnsatisfiedLinkError: /opt/play/native/libsigar-amd64-linux.so: Error relocating /opt/play/native/libsigar-amd64-linux.so: clnttcp_create: symbol not found
  at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
  at play.libs.akka.AkkaGuiceSupport.bindActor(AkkaGuiceSupport.java:55) (via modules: com.google.inject.util.Modules$OverrideModule -> config.GuiceModule)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:176)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
    at com.google.inject.Guice.createInjector(Guice.java:96)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
    at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
    at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
    at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
    at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Caused by: java.lang.UnsatisfiedLinkError: /opt/play/native/libsigar-amd64-linux.so: Error relocating /opt/play/native/libsigar-amd64-linux.so: clnttcp_create: symbol not found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at kamon.sigar.SigarProvisioner.provision(SigarProvisioner.java:179)
    at kamon.system.SystemMetricsExtension.<init>(SystemMetricsExtension.scala:52)
    at kamon.system.SystemMetrics$.createExtension(SystemMetricsExtension.scala:34)
    at kamon.system.SystemMetrics$.createExtension(SystemMetricsExtension.scala:32)
    at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:713)
    at akka.actor.ExtensionId$class.apply(Extension.scala:79)
    at kamon.system.SystemMetrics$.apply(SystemMetricsExtension.scala:32)
    at akka.actor.ExtensionId$class.get(Extension.scala:91)
    at kamon.system.SystemMetrics$.get(SystemMetricsExtension.scala:32)
    at kamon.ModuleLoaderExtension$$anonfun$2$$anonfun$apply$2.apply(ModuleLoader.scala:44)
    at kamon.ModuleLoaderExtension$$anonfun$2$$anonfun$apply$2.apply(ModuleLoader.scala:42)
    at scala.util.Success$$anonfun$map$1.apply(Try.scala:237)
    at scala.util.Try$.apply(Try.scala:192)
    at scala.util.Success.map(Try.scala:237)
    at kamon.ModuleLoaderExtension.<init>(ModuleLoader.scala:38)
    at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:27)
    at kamon.ModuleLoader$.createExtension(ModuleLoader.scala:25)
    at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:713)
    at kamon.Kamon$.start(Kamon.scala:55)
    at kamon.Kamon$.ifStarted(Kamon.scala:95)
    at kamon.Kamon$.metrics(Kamon.scala:78)
    at akka.kamon.instrumentation.LookupDataAware$LookupData$.apply$default$3(DispatcherInstrumentation.scala:184)
    at akka.kamon.instrumentation.DispatcherInstrumentation.aroundDispatchersLookup(DispatcherInstrumentation.scala:83)
    at akka.dispatch.Dispatchers.lookup(Dispatchers.scala:81)
    at akka.dispatch.Dispatchers.defaultGlobalDispatcher(Dispatchers.scala:71)
    at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:599)
    at akka.actor.ActorSystem$.apply(ActorSystem.scala:142)
    at akka.actor.ActorSystem$.apply(ActorSystem.scala:126)
    at play.api.libs.concurrent.ActorSystemProvider$.start(Akka.scala:291)
    at play.api.libs.concurrent.ActorSystemProvider.get$lzycompute(Akka.scala:256)
    at play.api.libs.concurrent.ActorSystemProvider.get(Akka.scala:255)
    at play.api.libs.concurrent.ActorSystemProvider.get(Akka.scala:251)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
    at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:54)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
    at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
    at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:62)
    at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
    at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
    at com.google.inject.util.Providers$GuicifiedProviderWithDependencies$$FastClassByGuice$$2a7177aa.invoke(<generated>)
    at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
    at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:57)
    at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:91)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
    at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
    at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
    at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:174)
    at com.google.inject.internal.Initializer.injectAll(Initializer.java:108)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174)
    ... 10 more

@Andrei-Pozolotin
Copy link
Contributor

please try to use glibc based alpine and jdk, i.e.:
https://github.com/frol/docker-alpine-glibc
https://github.com/frol/docker-alpine-oraclejdk8

@zifeo
Copy link

zifeo commented Jan 7, 2017

@aleksandr-vin
Copy link

@carwilki
Copy link

carwilki commented Mar 28, 2018

resurrecting this issue, glibc is not an option for us. alpine has a version of sigar that works, we have verified that it does. https://pkgs.alpinelinux.org/package/edge/community/x86/sigar

would it be possible to alter the loader so that it will NOT extract if the extract folder location is already present? this would allow for overrides if it is required.

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

5 participants