Skip to content

UB Build Failure: fsharp - Cannot access the sdk.txt because it is in use by another process #5005

@mmitche

Description

@mmitche

Failure Mode:
File in use by another process (access denied)

Description:
Builds are failing because a file could not be accessed or written to, as it was being used by another process. This is seen in errors like:

Downloading vswhere
  The process cannot access the file 'C:\Users\cloudtest\AppData\Local\Microsoft\VisualStudio\17.0_c0a3a84d\sdk.txt' because it is being used by another process.
  System.IO.IOException: The process cannot access the file 'C:\Users\cloudtest\AppData\Local\Microsoft\VisualStudio\17.0_c0a3a84d\sdk.txt' because it is being used by another process.
     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
     at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
     at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
     at Microsoft.PowerShell.Commands.FileSystemProvider.ClearContent(String path)
  at EnablePreviewSdks, D:\a\_work\1\s\src\fsharp\eng\build.ps1: line 517
  at <ScriptBlock>, D:\a\_work\1\s\src\fsharp\eng\build.ps1: line 544
  at <ScriptBlock>, <No file>: line 1
  at <ScriptBlock>, <No file>: line 1

Explanation:
This failure occurs when the build process attempts to access or modify a file that is currently locked by another process. This results in an IOException and causes the build to fail. The error is intermittent and may be related to parallel processes or lingering handles on the file.

Affected Builds:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions