bazel crashes when passed bad --remote_http_cache value

Created on 9 Aug 2018  路  5Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request:

Bazel crashes instead of printing an error message when the --remote_http_cache
value is bad.

Feature requests: what underlying problem are you trying to solve with this feature?

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

bazel build :all --remote_http_cache

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

0.15.0

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Have you found anything relevant by searching the web?

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

Here is the stack trace:

java.lang.RuntimeException: java.lang.NullPointerException
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.createRest(SimpleBlobStoreFactory.java:46)
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.create(SimpleBlobStoreFactory.java:63)
at com.google.devtools.build.lib.remote.RemoteModule.beforeCommand(RemoteModule.java:167)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:273)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:199)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:855)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:111)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:924)
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)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.remote.blobstore.http.HttpBlobStore.(HttpBlobStore.java:112)
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.createRest(SimpleBlobStoreFactory.java:42)
... 10 more
ERROR: bazel crash in async thread:
java.lang.RuntimeException: java.lang.NullPointerException
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.createRest(SimpleBlobStoreFactory.java:46)
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.create(SimpleBlobStoreFactory.java:63)
at com.google.devtools.build.lib.remote.RemoteModule.beforeCommand(RemoteModule.java:167)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:273)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:199)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:855)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:111)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:924)
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)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.remote.blobstore.http.HttpBlobStore.(HttpBlobStore.java:112)
at com.google.devtools.build.lib.remote.SimpleBlobStoreFactory.createRest(SimpleBlobStoreFactory.java:42)
... 10 more

P2 team-Remote-Exec bug

Most helpful comment

I'm experiencing the same thing, is there no way to turn off the remote cache once it has been enabled in bazelrc?

All 5 comments

Once --remote_http_cache is set to a value in .bazelrc, one cannot override the setting
and turn off use of the remote cache with a command line argument. I would expect that
--remote_http_cache="" might disable the remote cache, but it does not.

I'm experiencing the same thing, is there no way to turn off the remote cache once it has been enabled in bazelrc?

That surely sounds like an annoying bug. I'll make sure that it gets fixed.

Great to hear this will be fixed! If I may, I wanted to chime in with a specific use case: I occasionally want to use --disk_cache instead of the remote, but the two options are mutually exclusive. It would be great to have nullable options or to be able to unset them from overriding configs which I believe this feature will be fixed.

@vmrob @brown
FYI: There was a fix that disables remote cache in case am empty value provided, see #7650.
It is part of 0.25 release.

Was this page helpful?
0 / 5 - 0 ratings