Skip to content

changing remote_cache should should invalidate remote files in action cache #26657

@tyler-french

Description

@tyler-french

Description of the bug:

The Bazel --output_base contains a persistent compact action cache that Bazel reuses across builds. When switching remote caches between runs (e.g., from Buildbarn to Buildfarm), this can lead to "Missing digest" errors.

This occurs because the action cache incorrectly assumes certain blobs are available in the new remote cache, causing builds to fail when running with --remote_download_outputs=minimal (build without the bytes).

Bazel should be able to know when a change in its flag invalidates some internal state.

In Bazel 8, this issue arises because RemoteFileArtifactValue does not keep information about remote instance name or remote cache URI

On latest master, this was refactored, but the remote metadata is still agnostic of remote cache URI or remote instance.

I would propose creating a configuration like --incompatible_remote_specific_action_cache or something like that, which would encode --remote_instance (and potentially --remote_cache URI into the remote file metadata, so that the client could properly discard these entries when the remote cache changes.

Which category does this issue belong to?

Remote Execution

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

Run a build with --remote_download_minimal against a populated remote cache. Change --remote_cache to something that is empty, and bazel build --remote_download_minimal will fail with missing digest

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

8.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions