Skip to content

Fsharp non-deterministically fails to download vswhere #18432

Closed

Description

@ViktorHofer

I saw this failure couple times in the past. The recent VMR build failed because of it.

Downloading vswhere
  Stream was not readable.
  System.ArgumentException: Stream was not readable.
     at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
     at System.IO.StreamReader..ctor(Stream stream, Encoding encoding)
     at Microsoft.PowerShell.Commands.FileSystemContentReaderWriter.CreateStreams(String filePath, String streamName, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Encoding fileEncoding)
     at Microsoft.PowerShell.Commands.FileSystemProvider.GetContentWriter(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
##[error](NETCORE_ENGINEERING_TELEMETRY=Build) Failure preparing build

https://dev.azure.com/dnceng/internal/_build/results?buildId=2676220&view=logs&j=89eea50f-59b5-5921-c3ce-ce40b36fa819&t=483e1309-93e4-5a7a-74de-93b8d658274f

Activity

  1. added this to the Backlog milestone on Apr 1, 2025
  2. majocha commented on Apr 2, 2025

    @majocha
    Contributor

    Locked output file?

  3. vzarytovskii commented on Apr 2, 2025

    @vzarytovskii
    Member

    It should be using arcade script, I think? Wonder what could be different from everything else.

  4. added
    Impact-Low
    and removed on Apr 7, 2025
  5. akoeplinger commented on Nov 4, 2026

    @akoeplinger
    Member

    this wasn't when actually downloading vswhere but when writing to sdk.txt, D:\a\_work\1\s\src\fsharp\eng\build.ps1: line 517 corresponds to:

    'UsePreviews=True' | Set-Content $sdkFile

    the root cause was two powershell instances trying to write to the file at the same time: dotnet/dotnet#10704

    (#18491 claimed to fix this issue earlier, but that's wrong since this happens before msbuild actually runs)

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

    EngineeringImpact-Low

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions