Skip to content

Nightly, all Windows builds: PermissionError: [WinError 5] Access is denied: 'c:/build'  #5749

Closed

Description

@jin

rules_nodejs: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/367#5b4e9de4-589f-4fb2-bcfb-cd13995a469e

rules_sass: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/367#5d8ee0ea-cff5-414b-a84a-b66833c98f2a

rules_typescript: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/367#5d8ad44a-b5e2-4acb-928d-be3ea236f33e

tensorflow: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/367#afa9c059-9913-47b4-aa27-982ad06876a4

Android Testing: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/368#329f3af6-a1a3-4527-a3f8-3b6124138d7a

 C:\Users\b\AppData\Local\Temp\buildkite-script-219452124.bat
--
  | Traceback (most recent call last):
  | File "bazelci.py", line 1255, in <module>
  | sys.exit(main())
  | File "bazelci.py", line 1242, in main
  | args.build_only, args.test_only, args.monitor_flaky_tests)
  | File "bazelci.py", line 365, in execute_commands
  | clone_git_repository(git_repository, platform)
  | File "bazelci.py", line 601, in clone_git_repository
  | root = downstream_projects_root(platform)
  | File "bazelci.py", line 313, in downstream_projects_root
  | os.makedirs(path)
  | File "C:\python3\lib\os.py", line 211, in makedirs
  | makedirs(head, exist_ok=exist_ok)
  | File "C:\python3\lib\os.py", line 211, in makedirs
  | makedirs(head, exist_ok=exist_ok)
  | File "C:\python3\lib\os.py", line 221, in makedirs
  | mkdir(name, mode)
  | PermissionError: [WinError 5] Access is denied: 'c:/build'
  | 🚨 Error: The command exited with status 1

cc @philwo @laszlocsomor

Activity

  1. added
    P1
    on Aug 3, 2018
  2. laszlocsomor commented on Aug 3, 2018

    @laszlocsomor
    Contributor

    ERROR_ACCESS_DENIED is a versatile, generic error, and MSDN does not document it in detail.
    In my experience with CreateDirectoryW, which I believe os.makedirs ultimately calls, the error may indicate:

  3. laszlocsomor commented on Aug 3, 2018

    @laszlocsomor
    Contributor

    I suggest one or more of:

    • Catching the PermissionError, then checking os.isdir(path). If another process concurrently created the directory, there's a chance the directory remained, though there's also a chance that it was removed again after os.makedirs threw but before we checked os.isdir. Still, checking os.isdir in the catch-block increases the likelihood of a figuring out what happened.
    • Verifying that the process can write in the root of the drive.
    • Using another output directory.
  4. philwo commented on Aug 3, 2018

    @philwo
    Member

    I’ve moved C:\build (slow persistent SSD) to D:\build (fast local SSD) recently. We probably just have to update these projects. Sorry, I wasn’t aware that anyone hardcodes that path...

  5. philwo commented on Aug 3, 2018

    @philwo
    Member

    @buchgr FYI, maybe we have to change this simply in bazelci.py?

  6. dslomov commented on Aug 6, 2018

    @dslomov
    Contributor

    @buchgr @philwo still failing

  7. philwo commented on Aug 6, 2018

    @philwo
    Member
  8. jin commented on Aug 8, 2018

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1breakageplatform: windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions