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

Upgrade Spanner samples to OpenCensus 0.25.0 #2233

Closed
lesv opened this issue Feb 26, 2020 · 2 comments · Fixed by #2415
Closed

Upgrade Spanner samples to OpenCensus 0.25.0 #2233

lesv opened this issue Feb 26, 2020 · 2 comments · Fixed by #2415
Assignees
Labels
api: spanner Issues related to the Spanner API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@lesv
Copy link
Contributor

lesv commented Feb 26, 2020

In which file did you encounter the issue?

spanner/cloud-client/pom.xml

Did you change the file? If so, how?

Upgrade OpenCensus to v0.25.0 by RenovateBot in #2224

Describe the issue

There are two issues here, both w/ the Spanner Samples:
SpannerSampleIT

java.lang.IllegalAccessError: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor
	at com.example.spanner.SpannerSampleIT.setUp(SpannerSampleIT.java:61)

QuickStartSampleIT

com.google.cloud.spanner.SpannerException: UNKNOWN: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor
	at com.example.spanner.QuickstartSampleIT.testQuickstart(QuickstartSampleIT.java:58)
Caused by: com.google.cloud.spanner.SpannerException: UNKNOWN: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor
Caused by: java.lang.IllegalAccessError: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor
@lesv lesv added api: spanner Issues related to the Spanner API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Feb 26, 2020
@lesv lesv assigned guangyus and unassigned gguuss Feb 26, 2020
@lesv lesv changed the title Upgrade to OpenCensus 0.25.0 Upgrade Spanner samples to OpenCensus 0.25.0 Feb 26, 2020
@guangyus guangyus assigned skuruppu and unassigned guangyus Feb 26, 2020
@skuruppu
Copy link
Contributor

I can reproduce the issue with both OpenCensus version 0.24.0 and 0.25.0. Did a quick search to see if other people have run into this issue. Not much help there. I found census-instrumentation/opencensus-java#2004 but it's still open.

@mayurkale22 would you be able to give some pointers on how to fix this?

@mayurkale22
Copy link
Contributor

mayurkale22 commented Feb 27, 2020

This is related to census-instrumentation/opencensus-java#1938

I think we should use the latest version of grpc dependency. To solve the issue, I have added grpc-netty-shaded and grpc-core into the exclusion list and separately addded > 1.21.0 version of grpc-netty-shaded.

<dependency>
      <!-- Version auto-managed by BOM -->
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-spanner</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava-jdk5</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.opencensus</groupId>
          <artifactId>opencensus-api</artifactId>
        </exclusion>
        <!-- START OF NEW CODE -->
        <exclusion>
          <groupId>io.grpc</groupId>
          <artifactId>grpc-netty-shaded</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.grpc</groupId>
          <artifactId>grpc-core</artifactId>
        </exclusion>
       <!-- END OF NEW CODE -->
      </exclusions>
    </dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
6 participants