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

sometimes build fails with "Execution failed for task ':grpc-core:compileJava'. > assert i != -1" #8611

Closed
morgwai opened this issue Oct 19, 2021 · 3 comments · Fixed by #10406
Labels

Comments

@morgwai
Copy link
Contributor

morgwai commented Oct 19, 2021

What version of gRPC-Java are you using?

incremental build from 0376de1 to 1f90e0e but happened before also

What is your environment?

ubuntu-18.04, openJDK-11

What did you expect to see?

build should succeed cleanly

What did you see instead?

$ git fetch github 
remote: Enumerating objects: 68, done.
remote: Counting objects: 100% (68/68), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 40 (delta 15), reused 25 (delta 8), pack-reused 0
Unpacking objects: 100% (40/40), done.
From https://github.com/grpc/grpc-java
   0376de15b..1f90e0e28  master     -> github/master
$ git merge --ff-only 
Updating 0376de15b..1f90e0e28
Fast-forward
 core/src/main/java/io/grpc/util/CertificateUtils.java     |  18 +++++++--
 core/src/test/java/io/grpc/util/CertificateUtilsTest.java |  10 +++++
 testing/src/main/resources/certs/README                   |   5 +++
 testing/src/main/resources/certs/ecdsa.key                |   5 +++
 xds/src/main/java/io/grpc/xds/Bootstrapper.java           |  93 +++++++++++++++++++++++++++++++++++++++++++-
 xds/src/main/java/io/grpc/xds/BootstrapperImpl.java       | 135 +++++++++++++++++++++++++++++++++++++++++++++-------------------
 xds/src/test/java/io/grpc/xds/BootstrapperImplTest.java   |  96 +++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 318 insertions(+), 44 deletions(-)
 create mode 100644 testing/src/main/resources/certs/ecdsa.key
$ ./gradlew -PskipAndroid=true -PskipCodegen=true build
Starting a Gradle Daemon (subsequent builds will be faster)
*** Skipping the build of codegen and compilation of proto files because skipCodegen=true
  * Skipping the build of Android projects because skipAndroid=true
> Task :grpc-core:compileJava FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/morgwai/projects/upstreamProjects/grpc-java/core/build.gradle' line: 68

* What went wrong:
Execution failed for task ':grpc-core:compileJava'.
> assert i != -1
         | |
         | false
         -1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
9 actionable tasks: 5 executed, 4 up-to-date

simply repeating the build command made it succeed:

$ ./gradlew -PskipAndroid=true -PskipCodegen=true build
*** Skipping the build of codegen and compilation of proto files because skipCodegen=true
  * Skipping the build of Android projects because skipAndroid=true

> Task :grpc-xds:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :grpc-interop-testing:test
[jetty-alpn-agent][ warn] Could not find a matching alpn-boot jar for Java version: 11.0.11

> Task :grpc-netty:test
[jetty-alpn-agent][ warn] Could not find a matching alpn-boot jar for Java version: 11.0.11

BUILD SUCCESSFUL in 6m 31s
324 actionable tasks: 139 executed, 185 up-to-date

Steps to reproduce the bug

very hard to reproduce reliably: happened to me like 2 times across about 30 builds during last 2 months. As far as I remember the previous time it also happened during an incremental build, but not 100% sure.

@dapengzhang0
Copy link
Member

I was experiencing the same issue on mac. Retry will compile successfully. Should be a bug.

@dapengzhang0 dapengzhang0 added this to the Next milestone Oct 19, 2021
@dapengzhang0 dapengzhang0 self-assigned this Oct 19, 2021
@ejona86
Copy link
Member

ejona86 commented Jun 6, 2022

This is caused by #7834, although it's unclear exactly how. However, that code will be removed to resolve #7211. Instead of fixing this directly, we should just delete the code. Closing since #7834 will remove the class rewriter.

@ejona86 ejona86 closed this as completed Jun 6, 2022
@ejona86 ejona86 removed this from the Next milestone Jun 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2022
@grpc grpc unlocked this conversation Oct 3, 2023
@sergiitk
Copy link
Member

sergiitk commented Oct 3, 2023

This will be properly fixed by #10406.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants