I just ran into a situation where the Visual Studio installer is failing, but unfortunately, besides the fact that there was a non-zero exit code (a 1 exit code in this case), there's no further info in the packer output log besides the exit code. To see further what went wrong, I would have to have packer not dispose the VM and hop on it VM and look at the logs there.
It would be more advantageous if, on a non-zero exit code for Visual Studio, we got the contents of the produced install logs and included that in the output of the packer log, so you didn't have to keep the VM around nor remote into it to get more useful info.
PR incoming with a suggested approach to this.
Ah apologies! This is a duplicate of https://github.com/actions/virtual-environments-internal/issues/1336
We must have been looking at the same thing today. :)
@ryanspletzer thanks for your contribution anyway! It looks like a transient issue, we've faced it both during Win16 and Win19 image generation
@miketimofeev is the transient issue still occurring? I see the following from the log in the new output today (10/20) still:
Package 'Microsoft.VisualC.14.16.CRT.x64.Desktop.spectre,version=14.16.27024' failed to download from 'https://download.visualstudio.microsoft.com/download/pr/34114661-d2a2-4053-80ab-58f10efc25a9/002a28ab21662720ab5aecf1ab50fb36/microsoft.visualc.14.16.crt.x64.desktop.spectre.vsix'.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualC.14.16.CRT.x64.Desktop.spectre;PackageAction=DownloadPackage;ReturnCode=0x80096004
Details
WebClient download failed: SHA256 verification for 'Microsoft.VisualC.14.16.CRT.x64.Desktop.spectre.vsix' failed. Expected hash: 782D85D5165D7F5FE04DF504A509F51C04B8FC802C8A6BD1C7F24C2DF54530A1, Actual hash: 375A80A5B5DBB2F6BACD170636A97AAAADE93C06DB2919452218F0A696FF87A3
Bits download failed: The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. (Exception from HRESULT: 0x800704DD)
WinInet download failed: SHA256 verification for 'Microsoft.VisualC.14.16.CRT.x64.Desktop.spectre.vsix' failed. Expected hash: 782D85D5165D7F5FE04DF504A509F51C04B8FC802C8A6BD1C7F24C2DF54530A1, Actual hash: 375A80A5B5DBB2F6BACD170636A97AAAADE93C06DB2919452218F0A696FF87A3
Impacted components
MSVC v141 - VS 2017 C++ x64/x86 Spectre-mitigated libs (v14.16) (Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre,version=16.5.29515.121)
@ryanspletzer Unfortunately, yes. We've already escalated the issue to the network team and waiting for results.