question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Protobuf Bug Breaks Plugin, Fixable By Update

See original GitHub issue

Hello Bazel Intelij Plugin Folks,

TL;DR: Sync ingestion broken. Fixable by updating rules_proto to commit 40298556293ae502c66579620a7ce867d5f57311 in WORKSPACE.

More detail: I’d come back the the plugin after a little hiatus (and Android Studio, OS, bazel, plugin, etc. updates) and found something odd indeed. Syncing seemed to finish…but fail, but rendering the plugin broken. Sad times. Console looked like

<aspects all succeeding>
build invocation result: success
Parsing build outputs...
Total rules: 107, new/changed: 107, removed: 0
Reading IDE info result...
Reading IDE info result...
Updating target map
Sync finished

Timing summary:
BlazeInvocation: 35.9s, Prefetching: 0ms, Other: 77ms
Sync failed

Weird, okay. So I launched Android Studio from the command line to look at some logs. Many many instances like the following:

Dec 16, 2020 7:11:51 PM com.google.common.util.concurrent.AggregateFuture log
SEVERE: Input Future failed with Error
java.lang.NoSuchMethodError: java.nio.CharBuffer.flip()Ljava/nio/CharBuffer;
	at com.google.repackaged.protobuf.TextFormat$Parser.toStringBuilder(TextFormat.java:1602)
	at com.google.repackaged.protobuf.TextFormat$Parser.merge(TextFormat.java:1586)
	at com.google.repackaged.protobuf.TextFormat$Parser.merge(TextFormat.java:1558)
	at com.google.idea.blaze.base.sync.aspects.strategy.AspectStrategy.readAspectFile(AspectStrategy.java:133)
	at com.google.idea.blaze.base.sync.aspects.BlazeIdeInterfaceAspectsImpl.lambda$updateState$8(BlazeIdeInterfaceAspectsImpl.java:486)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:222)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:29)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:201)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:210)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:190)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Aha! So some strange internal issue to the protobuf dependency. Looks like this one, which lists at least protobufs between 3.12.2 and 3.14 (exclusive) as problematic (this plugin is currently pointing to something even older, 3.10).

Anyway, sure enough, if we change the version of rules_proto in the plugin WORKSPACE to a version out of that range, the issue goes away. rules_proto doesn’t support 3.14 yet, so in my test, I moved it up to the last working version it did support (commit 40298556293ae502c66579620a7ce867d5f57311 which is protobuf 3.11.3). Huzzah!

My setup details: Latest stable releases of macOS, bazel, plugin, and Android Studio. Android Studio logs list “JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o”.

Thanks for the work you do! Chris (ex-Googler)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

2reactions
cpsauercommented, Feb 4, 2021

Update: Because I needed this change–and some others–to make the the plugin run, I made a fork.

While we’re waiting for an official response, check it out if you want this fix and others. https://github.com/hedronvision/bazelbuild-intellij

(Would be delighted to submit a PR, but I think I shouldn’t until I hear from maintainers, based on the contribution guidelines. But you can see the diff corresponding to the change in the commit auto-linked above.)

0reactions
alice-kscommented, Mar 24, 2021

Closing this issue as #2437 was merged and the fix will be available in the next release. Thanks everyone for the help here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rules and categories | Buf®
Rules and categories. As discussed in the overview, buf categorizes breaking rules into four main categories: FILE : Generated source code breaking changes ......
Read more >
Overview | Protocol Buffers - Google Developers
Protocol buffers can be extended with new information without invalidating existing data or requiring code to be updated. Protocol buffers are ...
Read more >
refs/tags/v1.4.2 - Google Git
Bugs : If a package has a bug that violates correctness, a program depending on the buggy behavior may break if the bug...
Read more >
Release Notes | protobuf-net - GitHub Pages
BuildTools usage with duplicate filenames (#925); fix protobuf-net.BuildTools issue with gRPC/WCF detection not working correctly ...
Read more >
protobuf-dt - Google Code
148, Fixed, Elements with different types bug same names are marked as errors Type-Defect Priority-Critical Milestone-Release-1.0.12.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found