bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.97k stars 4.03k forks source link

Bazel crashes with NPE #23483

Open tgeng opened 2 weeks ago

tgeng commented 2 weeks ago

Description of the bug:

We noticed the following error occasionally in our CI environment.

[2024-08-30T22:44:39.669Z] + bazel build --local_resources=memory=69578 --local_resources=cpu=10 --jobs=10 --config=ci --stamp ... (target patterns are omitted for confidentiality)
[2024-08-30T22:44:39.669Z] Starting bazel-event-subscriber as a background process...
[2024-08-30T22:44:39.669Z] Starting local Bazel server and connecting to it...
[2024-08-30T22:44:48.060Z] INFO: Invocation ID: 23da8df7-70a1-4c83-8d8a-e2bd6dec2c63
[2024-08-30T22:44:48.060Z] Computing main repo mapping: 
[2024-08-30T22:44:48.980Z] Computing main repo mapping: 
[2024-08-30T22:44:49.901Z] Computing main repo mapping: 
[2024-08-30T22:44:51.257Z] Computing main repo mapping: 
[2024-08-30T22:44:51.815Z] Loading: 
[2024-08-30T22:44:51.815Z] Loading: 2 packages loaded
[2024-08-30T22:44:53.170Z] Analyzing: nullFATAL: bazel crashed due to an internal error. Printing stack trace:
[2024-08-30T22:44:53.170Z] java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "message" is null
[2024-08-30T22:44:53.170Z]  at com.google.devtools.build.lib.runtime.SkymeldUiStateTracker.writeLoadingAnalysisPhaseProgress(SkymeldUiStateTracker.java:147)
[2024-08-30T22:44:53.170Z]  at com.google.devtools.build.lib.runtime.SkymeldUiStateTracker.writeProgressBar(SkymeldUiStateTracker.java:92)
[2024-08-30T22:44:53.170Z]  at com.google.devtools.build.lib.runtime.UiEventHandler.addProgressBar(UiEventHandler.java:1017)
[2024-08-30T22:44:53.170Z]  at com.google.devtools.build.lib.runtime.UiEventHandler.doRefresh(UiEventHandler.java:878)
[2024-08-30T22:44:53.170Z]  at com.google.devtools.build.lib.runtime.UiEventHandler.lambda$startUpdateThread$0(UiEventHandler.java:954)
[2024-08-30T22:44:53.170Z]  at java.base/java.lang.Thread.run(Unknown Source)
[2024-08-30T22:44:53.170Z] 
[2024-08-30T22:44:53.170Z] Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/mnt/jenkins/.cache/bazel/_bazel_jenkins/34b69d59fa4fc66fd3c84f6db0658cf9/server/jvm.out')

Which category does this issue belong to?

Core

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

We don't know how to reliably reproduce this. This happens a couple of times in a week, during which we run thousands of builds so it's pretty rare.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 7.3.1

If bazel info release returns development 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 ?

No response

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?

No response

Any other information, logs, or outputs that you want to share?

No response

benjaminp commented 2 weeks ago

4972db8a5211c2efd7af3a3b77f24f7698e4bdfe

tgeng commented 2 weeks ago

Thanks! Will this be cherry picked to bazel 7.4?

fmeum commented 2 weeks ago

@bazel-io fork 7.4.0

meisterT commented 1 week ago

cc @joeleba