Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Stackdriver exporter doesn't work in mac #2056

Open
kanjih opened this issue Sep 25, 2020 · 0 comments
Open

Stackdriver exporter doesn't work in mac #2056

kanjih opened this issue Sep 25, 2020 · 0 comments
Labels

Comments

@kanjih
Copy link

kanjih commented Sep 25, 2020

Stackdriver exporter doesn't work in mac.
When I run the app with stackdriver configuration, no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path error happens.

What version of OpenCensus are you using?

  • 0.27.0 (gradle setting is the below)
compile 'io.opencensus:opencensus-api:0.27.0'
compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.27.0'
runtime 'io.opencensus:opencensus-impl:0.27.0'

What JVM are you using (java -version)?

java version "1.8.0_172"

What did you do?

Run the code below, I can reproduce the error every time.

Code

@SpringBootApplication
@EnableScheduling
public class App {
	public static void main(String[] args) {
		try {
			StackdriverTraceExporter.createAndRegister(StackdriverTraceConfiguration.builder().setProjectId("my-project-id").build());
		} catch (IOException e) {
			throw new UncheckedIOException(e);
		}
		SpringApplication.run(App.class, args);
	}
}

build.gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
    }
}

apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'xxx'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compile 'io.opencensus:opencensus-api:0.27.0'
    compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.27.0'
    runtime 'io.opencensus:opencensus-impl:0.27.0'
    compileOnly 'org.projectlombok:lombok:1.18.12'
    annotationProcessor 'org.projectlombok:lombok:1.18.12'
    testCompileOnly 'org.projectlombok:lombok:1.18.12'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'

}

What did you expect to see?

No error

What did you see instead?

I got this error:

14:22:54.936 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader - Unable to load the library 'io_grpc_netty_shaded_netty_tcnative_osx_x86_64', trying other loading mechanism.
java.lang.UnsatisfiedLinkError: no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:369)
	at java.security.AccessController.doPrivileged(Native Method)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:361)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:339)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:136)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:96)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:578)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:133)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:217)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:397)
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:543)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:268)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:185)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:177)
	at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:160)
	at com.google.cloud.trace.v2.stub.GrpcTraceServiceStub.create(GrpcTraceServiceStub.java:73)
	at com.google.cloud.trace.v2.stub.TraceServiceStubSettings.createStub(TraceServiceStubSettings.java:99)
	at com.google.cloud.trace.v2.TraceServiceClient.<init>(TraceServiceClient.java:137)
	at com.google.cloud.trace.v2.TraceServiceClient.create(TraceServiceClient.java:118)
	at io.opencensus.exporter.trace.stackdriver.StackdriverV2ExporterHandler.createWithCredentials(StackdriverV2ExporterHandler.java:187)
	at io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter.createAndRegister(StackdriverTraceExporter.java:86)
	at sample.App.main(App.java:19)
14:22:54.937 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader - io_grpc_netty_shaded_netty_tcnative_osx_x86_64 cannot be loaded from java.library.path, now trying export to -Dio.netty.native.workdir: /var/folders/mg/kby94csx3nndsrz8g744nz5r0000gn/T
java.lang.UnsatisfiedLinkError: no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:349)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:136)
	at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:96)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:578)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:133)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:217)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:397)
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:543)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:268)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:185)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:177)
	at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:160)
	at com.google.cloud.trace.v2.stub.GrpcTraceServiceStub.create(GrpcTraceServiceStub.java:73)
	at com.google.cloud.trace.v2.stub.TraceServiceStubSettings.createStub(TraceServiceStubSettings.java:99)
	at com.google.cloud.trace.v2.TraceServiceClient.<init>(TraceServiceClient.java:137)
	at com.google.cloud.trace.v2.TraceServiceClient.create(TraceServiceClient.java:118)
	at io.opencensus.exporter.trace.stackdriver.StackdriverV2ExporterHandler.createWithCredentials(StackdriverV2ExporterHandler.java:187)
	at io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter.createAndRegister(StackdriverTraceExporter.java:86)
	at sample.App.main(App.java:19)
	Suppressed: java.lang.UnsatisfiedLinkError: no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path
		at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
		at java.lang.Runtime.loadLibrary0(Runtime.java:870)
		at java.lang.System.loadLibrary(System.java:1122)
		at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.lang.reflect.Method.invoke(Method.java:498)
		at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:369)
		at java.security.AccessController.doPrivileged(Native Method)
		at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:361)
		at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:339)
		... 20 common frames omitted
14:22:54.960 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader - Was not able to find the ID of the shaded native library io_grpc_netty_shaded_netty_tcnative_osx_x86_64, can't adjust it.

Additional context

Mac OS: Catalina, 10.15.15
openssl version: LibreSSL 2.8.3

@kanjih kanjih added the bug label Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant