Skip to content

builds with remote caching sometimes fails on incomplete downloads #5047

Closed

Description

@BenTheElder

Description of the problem / feature request:

Sometimes builds with http remote caching enabled fail with Failed to delete output files after incomplete download. Cannot continue with local execution.

See EG the logs here: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/62063/pull-kubernetes-bazel-test/38632/

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

I've had some difficulty making this bug reproducible unfortunately, you need to have remote caching enabled and fail to download to an entry, which often still succeeds and falls back to local building.

What operating system are you running Bazel on?

A debian jessie based docker container.

What's the output of bazel info release?

release 0.11.0

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

https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/62063/pull-kubernetes-bazel-test/38632/

https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/62723/pull-kubernetes-bazel-build/38747/

Activity

  1. BenTheElder commented on Apr 18, 2018

    @BenTheElder
    Author

    cc @buchgr @ixdy @rmmh
    I've spent a fair bit of time trying to make this reproducible, unsuccesfuly. even digging through our logs most runs are either successful or actual failures, but this happens often enough to be a bad experience.

  2. self-assigned this
    on Apr 19, 2018
  3. buchgr commented on Apr 19, 2018

    @buchgr
    Contributor

    Thanks for reporting. I ll take a look!

  4. added
    P2
    on Apr 21, 2018
  5. ixdy commented on May 15, 2018

    @ixdy
    Contributor

    Still happening occasionally in in bazel 0.13.0. Failure from this morning: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/54372/pull-kubernetes-e2e-gce-device-plugin-gpu/31984/

    W0515 15:50:29.365] INFO: Analysed target //build/release-tars:release-tars (1997 packages loaded).
    W0515 15:50:29.370] INFO: Found 1 target...
    W0515 15:50:29.510] [0 / 15] [-----] Writing file build/release-tars/kubernetes-manifests.args
    W0515 15:50:34.291] [49 / 2,338] [-----] Writing file vendor/github.com/google/certificate-transparency-go/x509/go_default_library._cgo_.o-2.params
    W0515 15:50:37.467] ERROR: /bazel-scratch/.cache/bazel/_bazel_prow/48d5366022b4e3197674c8d6e2bee219/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/pkg failed: Failed to delete output files after incomplete download. Cannot continue with local execution.: /bazel-scratch/.cache/bazel/_bazel_prow/48d5366022b4e3197674c8d6e2bee219/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/pkg (Directory not empty)
    
  6. added a commit that references this issue on May 16, 2018
    4aed6b5
  7. BenTheElder commented on May 16, 2018

    @BenTheElder
    Author

    Thanks @buchgr!

  8. added a commit that references this issue on May 24, 2018
    e2dfb97
  9. added a commit that references this issue on May 25, 2018
    1eccd41
  10. BenTheElder commented on Jun 28, 2018

    @BenTheElder
    Author

    we're seeing this again with 0.15.0 :(

    Test run a and b both hit an error like:

    ERROR: /bazel-scratch/.cache/bazel/_bazel_root/27a95fe2fc68aa1195ddf1a4bbaaea62/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_amd64_race_stripped/stdlib~/pkg failed: Failed to delete output files after incomplete download. Cannot continue with local execution.: /bazel-scratch/.cache/bazel/_bazel_root/27a95fe2fc68aa1195ddf1a4bbaaea62/execroot/main/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_race_stripped/stdlib~/pkg/linux_amd64_race (Directory not empty)

    Per the logs these tests ran in the image gcr.io/k8s-testimages/kubekins-e2e:v20180627-0ed738715-experimental which is definitely 0.15.0:

    $ docker run --rm -it --entrypoint=/bin/sh gcr.io/k8s-testimages/kubekins-e2e:v20180627-0ed738715-experimental
    # bazel version
    Extracting Bazel installation...
    WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
    Build label: 0.15.0
    Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
    Build time: Tue Jun 26 12:10:19 2018 (1530015019)
    Build timestamp: 1530015019
    Build timestamp as int: 1530015019
    
  11. BenTheElder commented on Jun 29, 2018

    @BenTheElder
    Author

    I've personally hit this 3x today, I think we will downgrade to 0.14.0 in the short term..
    Edit: I can't be completely certain yet, but AFAICT this regressed somewhere between 0.14.0 and 0.15.0

  12. buchgr commented on Jun 29, 2018

    @buchgr
    Contributor

    @BenTheElder sorry about that :(. I don't understand what's happening there yet. Can you try running with --remote_max_connections=200. I think this will avoid the failures in the first place.

    I will try to reproduce the error.

  13. added
    P1
    on Jun 29, 2018
  14. 36 remaining items

  15. added a commit that references this issue on Aug 2, 2018
    b35fc60
  16. added a commit that references this issue on Aug 7, 2018
    fb9215a
  17. added a commit that references this issue on Aug 13, 2018
    1bd5883
  18. ob commented on Sep 18, 2018

    @ob
    Contributor

    I'm still seeing this issue using Bazel 0.17.1 and a medium sized iOS application (using rules_apple 0.7.0 and rules_swift as of 7bbcf9584613169cda709b9c217f5ac29cc5a089). Unfortunately I can't share the app but I'd be happy to help debug the issue.

    My config:

    build --spawn_strategy=standalone
    build --genrule_strategy=standalone
    build --experimental_objc_enable_module_maps
    build --features swift.no_generated_module_map
    build --symlink_prefix=build/
    build --xcode_version 9.4.1
    build --remote_http_cache=$REMOTE_CACHE_URL
    

    And I'm building with the command:

    bazel build --jobs 128 //:Learning
    

    Where Learning is an ios_application. The error message is:

    ERROR: /Users/obonilla/r/learning-ios_trunk/BUILD.bazel:317:1: SwiftCompile Learning.swiftmodule failed: Unexpected IO error.: Exhaused retry attempts (0)
    Target //:Learning failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    ERROR: /Users/obonilla/r/learning-ios_trunk/BUILD.bazel:1259:1 SwiftCompile Learning.swiftmodule failed: Unexpected IO error.: Exhaused retry attempts (0)
    
  19. buchgr commented on Sep 19, 2018

    @buchgr
    Contributor

    Can you run with --verbose_failures and see if you get the same error message?

  20. ob commented on Sep 19, 2018

    @ob
    Contributor

    Same error message.

    ERROR: /Users/obonilla/r/learning-ios_trunk/LearningDataModel/BUILD.bazel:2:1: C++ compilation of rule '//LearningDataModel:LearningDataModel_ObjC' failed: Unexpected IO error.: Exhaused retry attempts (0)
    

    This time though, I noticed that buried in the compilation output there is this:

    WARNING: Error reading from the remote cache:
    ClosedChannelException
    

    However, the output seems wrong since I can't tell if it retried, and if so how many times it retried. I also ran it adding the flag --remote_local_fallback, which I expected would fail back to building if there was a problem with the remote cache, but it didn't appear to do anything.

    Maybe this is a different issue... should I open a new Issue?

  21. buchgr commented on Sep 20, 2018

    @buchgr
    Contributor

    That's actually a different error, as the output does not contain Failed to delete output files after incomplete download. Cannot continue with local execution.. It's possible that local fallback is broken :. Please open a new issue.

  22. ob commented on Dec 8, 2018

    @ob
    Contributor

    I'm seeing this one with Bazel 0.20.0. I think a failure in the remote cache:

    [538 / 5,501] CompileStrings scripts/bazel/deviceBuilds/appStore/Learning.resources/LIAuthLibraryBundle.bundle/nb.lproj/LIAuthLibrary.strings; 3s remote-cache ... (1426 actions, 1423 running)
    WARNING: Error reading from the remote cache:
    502 Bad Gateway
    <html>
    <head><title>502 Bad Gateway</title></head>
    <body bgcolor="white">
    <center><h1>502 Bad Gateway</h1></center>
    <hr><center>nginx/1.12.2</center>
    </body>
    </html>
    ....
    WARNING: Error reading from the remote cache:
    Exhausted retry attempts (0)
    

    triggered this again:

    ERROR:... XibCompile .../CodeBlockView.ibtool-outputs failed: Failed to delete output files after incomplete download. Cannot continue with local execution.: ...CodeBlockView.ibtool-outputs/CodeBlockView.nib (Directory not empty)
    INFO: Elapsed time: 45.007s, Critical Path: 21.92s
    

    this was with --jobs 2000 so it might be that same race?

  23. rijosimon commented on Mar 27, 2019

    @rijosimon

    That's actually a different error, as the output does not contain Failed to delete output files after incomplete download. Cannot continue with local execution.. It's possible that local fallback is broken :. Please open a new issue.

    I am getting a ClosedChannelException error when trying to use bazel remote cache deployed on k8s. Was a separate issue opened for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions