-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
SkyframeExecutor (7.x): Cannot invoke "java.lang.Throwable.getMessage()" because "cause" is null #23170
Comments
As a follow-up, the fixed code isn't super helpful because |
I agree with your analysis about the exception always being null (and I'm sorry I didn't notice that earlier). It probably means that there is some sort of skyframe error present: the other type of error that creates You can try checking for this and calling I'm happy to review a PR for either master or the 7.3 branch to address this. |
@katre Thanks for the quick response! I'll try to poke at some local mods maybe this afternoon (I'm on US/Pacific time, 11:30am at the moment). Cycles are about, say, rule A that depends (transitively) on rule B, and rule B (transitively) depends on rule A? I am not thinking there should be a cycle present - the added Also - do you accept changes to 7.x? What's the base branch I should use for that? |
Skyframe cycle detection is about skyframe nodes: Loaded bzl files do become Starlark values (see |
OK, It was indeed marked as a cycle. Here is some custom logging I put in to identify the issue:
I use IDEA on this project, which allows clicking into the various bzl files called out above. The problem is the last file -- However, I had previously read the section on repository names, so I figured it was an alias of some sort. Indeed:
I read the README; when I tried to add the steps into
It's at this point where I'm kind of stuck. I know that I can apple-rules-lint is on latest, 0.3.2 (but that is from 2022). rules-jvm is one release back, 0.26.0. |
@Wyverald Can you help figure what's happening during loading these bzl files? |
From the first cycle report, it looks like you never defined the The second cycle report is similar -- you didn't define the The MODULE.bazel file in |
Thanks, @Wyverald, that largely pointed me in the right direction. I couldn't find any The The Unfortunately, the
It would be nice if we could backport the logging fix into the 7.x branch, in case someone else runs into this. Would you accept a PR to do that? Even better, it would be nice if the cycle reporter reported the entire chain to where it was required. For this code: error.getCycleInfo().forEach((CycleInfo cycleInfo) -> {
cycleInfo.getCycle().forEach((SkyKey key) -> {
System.err.println("class: " + key.getClass() + " value: " + key);
});
}); I get this output:
But the cycle reporter only tells me this much:
Could the cycle reporter be improved to report the trace of how we got to expecting that repository definition? Like |
In troubleshooting bazelbuild/bazel#23170, I had to dig deep into this code to understand what was happening. Bazel's default error does not apply to this situation, and Bazel's own debugging is also unhelpful. In fact, per the issue, in 7.x, you get `java.lang.NullPointerException: Cannot invoke "java.lang.Throwable.getMessage()" because "cause" is null`. I think this change would at least make it easier for folks to identify this issue in their own builds.
closing as stale. |
Description of the bug:
I added a
load
statement into one of my .bzl files:and running
info
gave me this:In 8.0-pre, this was fixed here: c3c21d9 , but doesn't appear to have been backported into 7.x. (The problematic code is still present in 7.3.0)
The commit in which it was fixed doesn't link a PR or issue, so I can't tell why it was fixed this way. I'm willing to attempt backporting the change but I don't know if it's the right answer.
I wish I could provide a repro case, but this project is overwhelming and it's my first real exposure to bazel.
Which category does this issue belong to?
Java Rules
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I really don't know, I'm sorry. I can work on it, but I wouldn't know what of my build is required to trigger this, and this is my first day working on anything Bazel-related. I'm hoping the commit where it was already fixed can provide some context.
Which operating system are you running Bazel on?
MacOS 14.6
What is the output of
bazel info release
?release 7.0.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
No response
Have you found anything relevant by searching the web?
Just the commit where it was fixed.
Any other information, logs, or outputs that you want to share?
I'm willing to troubleshoot on my end, or provide more detailed logs, but I'm unclear how to get that information. Running with
--verbose_failures
and--batch
didn't provide anything different.The text was updated successfully, but these errors were encountered: