Skip to content

Command '['bazel', 'dump', '--action_cache']' returned non-zero exit status 9 #198

Open
@Kayaking-zh

Description

@Kayaking-zh

I use bazel 6.1.1 with bzlmod, when I execute bazel run :refresh_compile_commands, it fails with following traceback but no error message. I don't know why and what could I do.

Traceback (most recent call last):
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.check_python_version.py", line 15, in <module>
    refresh_compile_commands.main()
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1416, in main
    compile_command_entries.extend(_get_commands(target, flags))
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1278, in _get_commands
    yield from _convert_compile_commands(parsed_aquery_output)
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1158, in _convert_compile_commands
    for source_files, header_files, compile_command_args in outputs:
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1122, in _get_cpp_command_for_files
    source_files, header_files = _get_files(compile_action)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 679, in _get_files
    header_files = _get_headers(compile_action, source_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 597, in _get_headers
    headers, should_cache = _get_headers_gcc(compile_action, source_path, compile_action.actionKey)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 243, in _get_headers_gcc
    if action_key in _get_bazel_cached_action_keys():  # Safe because Bazel only holds one cached action key per path, and the key contains the path.
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/execroot/_main/bazel-out/k8-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 132, in _get_bazel_cached_action_keys
    action_cache_process = subprocess.run(
                           ^^^^^^^^^^^^^^^
  File "/home/project/bazel-cache/external/rules_python~0.25.0~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['bazel', 'dump', '--action_cache']' returned non-zero exit status 9.

If I run bazel dump --action_cache directly, it succeeds.
I use git 2.45.2, gcc 8.3.1 and bazel-compile-commands-extractor a14ad3a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions