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

StackdriverTraceExporter java.lang.IllegalAccessError #2004

Open
maduris opened this issue Jan 25, 2020 · 3 comments
Open

StackdriverTraceExporter java.lang.IllegalAccessError #2004

maduris opened this issue Jan 25, 2020 · 3 comments
Labels

Comments

@maduris
Copy link

maduris commented Jan 25, 2020

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.24.0

What JVM are you using (java -version)?

1.8

What did you do?

If possible, provide a recipe for reproducing the error.
I am using the following libraries to use stackdriver exporter with opencensus traces

io.opencensus
opencensus-api
0.24.0


io.opencensus
opencensus-exporter-trace-stackdriver
0.24.0


io.opencensus
opencensus-impl
0.24.0
runtime

Initialising a Tracer with Exporter as:

public Tracer build() 
{
      try {

          StackdriverTraceExporter.createAndRegister(
                  StackdriverTraceConfiguration.builder().build());

      } catch (Exception e) {

          LOGGER.error("Error: Cannot connect to cloud trace, {}", e);

      }

      TraceConfig traceConfig = Tracing.getTraceConfig();
      traceConfig.updateActiveTraceParams(traceConfig.getActiveTraceParams().toBuilder().setSampler(Samplers.alwaysSample()).build());

      return Tracing.getTracer();

    }

After creating spans calling the exporter using:

Tracing.getExportComponent().shutdown();

What did you expect to see?

Traces exported to stackdriver

What did you see instead?

Jan 25, 2020 11:07:58 AM io.opencensus.implcore.trace.export.SpanExporterImpl$Worker onBatchExport WARNING: Exception thrown by the service export io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter java.lang.IllegalAccessError: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor at io.grpc.internal.CensusTracingModule$TracingClientInterceptor.interceptCall(CensusTracingModule.java:384) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at io.grpc.internal.CensusStatsModule$StatsClientInterceptor.interceptCall(CensusStatsModule.java:685) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at com.google.api.gax.grpc.GrpcHeaderInterceptor.interceptCall(GrpcHeaderInterceptor.java:81) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at com.google.api.gax.grpc.GrpcMetadataHandlerInterceptor.interceptCall(GrpcMetadataHandlerInterceptor.java:55) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:766) at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63) at com.google.api.gax.grpc.GrpcClientCalls.newCall(GrpcClientCalls.java:88) at com.google.api.gax.grpc.GrpcDirectCallable.futureCall(GrpcDirectCallable.java:58) at com.google.api.gax.grpc.GrpcUnaryRequestParamCallable.futureCall(GrpcUnaryRequestParamCallable.java:65) at com.google.api.gax.grpc.GrpcExceptionCallable.futureCall(GrpcExceptionCallable.java:64) at com.google.api.gax.tracing.TracedUnaryCallable.futureCall(TracedUnaryCallable.java:75) at com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126) at com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87) at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112) at com.google.cloud.trace.v2.TraceServiceClient.batchWriteSpans(TraceServiceClient.java:234) at com.google.cloud.trace.v2.TraceServiceClient.batchWriteSpans(TraceServiceClient.java:182) at io.opencensus.exporter.trace.stackdriver.StackdriverV2ExporterHandler.export(StackdriverV2ExporterHandler.java:444) at io.opencensus.implcore.trace.export.SpanExporterImpl$Worker.onBatchExport(SpanExporterImpl.java:248) at io.opencensus.implcore.trace.export.SpanExporterImpl$Worker.exportBatches(SpanExporterImpl.java:336) at io.opencensus.implcore.trace.export.SpanExporterImpl$Worker.run(SpanExporterImpl.java:290) at java.lang.Thread.run(Thread.java:748)

Additional context

In version 0.20.0 the same lines of code are able to export traces to stackdriver.

@maduris maduris added the bug label Jan 25, 2020
@maduris maduris closed this as completed Jan 26, 2020
@maduris maduris reopened this Jan 26, 2020
@mflis
Copy link

mflis commented Feb 7, 2020

I've also encountered similar exception(when using https://github.com/census-ecosystem/opencensus-scala).

I've pulled master of opencensus-java(precisely from this commit: 49bac50), built it locally, and used this version as my dependency.
This resolved error.

If I had to guess, I would tell that this commit might be relevant in this case: 61a025e

@rajivml
Copy link

rajivml commented May 24, 2020

We are also seeing these exceptions in our production environment

@shobhitsharma11
Copy link

Same here, failing with 0.24.0 and 0.26.0 but passed with 0.23.0

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

4 participants