Skip to content

bazel builds fail with "Error in download_and_extract: java.io.IOException: Couldn't delete temporary directory" #20013

@ryanmacdonald

Description

@ryanmacdonald

Description of the bug:

Our team recently migrated our build to use Bazel v6.3.0, and we're seeing this error sometimes when we run a fresh build:

Analyzing: target <target I'm building>
INFO: Repository remote_java_tools_linux instantiated at: 
  /DEFAULT.WORKSPACE.SUFFIX:374:6: in <toplevel>
  <project_root_dir>/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at: 
  <project_root_dir>/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: An error occurred during the fetch of repository 'remote_java_tools_linux':
   Traceback (most recent call last):
  File "<project_root_dir>/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
    download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Couldn't delete temporary directory (<project_root_dir>/remote_java_tools_linux/temp6718266017446538312)

As far as I understand, @remote_java_tools_linux is a dependency that Bazel pulls in as part of supporting native build macros that compile Java code, so I'm not sure why a user would be seeing permissions issues. Thoughts on what might be going wrong or how to proceed with debug?

Which category does this issue belong to?

External Dependency

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

No response

Which operating system are you running Bazel on?

Red Hat Enterprise Linux Server v7.9

What is the output of bazel info release?

release 6.3.0

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 master; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No, but solicited help for this error on Stackoverflow, and the Bazel community slack without any engagement

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

No response

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)awaiting-user-responseAwaiting a response from the authorteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions