Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenerateResourcesAndImage script errors during run #3434

Closed
tumm0283 opened this issue May 21, 2021 · 13 comments
Closed

GenerateResourcesAndImage script errors during run #3434

tumm0283 opened this issue May 21, 2021 · 13 comments
Assignees

Comments

@tumm0283
Copy link

tumm0283 commented May 21, 2021

Description
Script exited with non-zero exit status: 1.Allowed exit codes are: [0]

Area for Triage:
Deployment/Release

Question, Bug, or Feature?:
Question

Virtual environments affected
Windows Server 2019

Expected behavior
Random failures whilst building the Windows 2019 image.
Script Failed ,but image got created

Expected regular expression '9(.\d+){2,}' for 'ghc --version' command to match 'The Glorious Glasgow Haskell Compilation System, version 8.10.3
vhd: ', but it did not match.
vhd: at "ghc --version" | Should -MatchCommandOutput "9(.\d+){2,}", C:\image\Tests\Haskell.Tests.ps1:41
vhd: at , C:\image\Tests\Haskell.Tests.ps1:41
vhd: [+] Cabal is installed 67ms (65ms|1ms)
vhd: Tests completed in 4.38s
==> vhd: Test run has failed

Actual behavior

  • FullyQualifiedErrorId : Test run has failed

2021-05-20T23:38:49.1586971Z vhd: Chocolatey installed 1/1 packages.
2021-05-20T23:38:49.1600363Z vhd: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-05-20T23:38:50.4407957Z vhd: Package installed: mingw|8.1.0
2021-05-20T23:38:52.3949005Z vhd:
2021-05-20T23:38:52.3957874Z vhd: Starting discovery in 1 files.
2021-05-20T23:38:52.3967193Z vhd: Filter 'FullName' set to ('Mingw64').
2021-05-20T23:38:52.3977251Z vhd: Discovering in C:\image\Tests\Tools.Tests.ps1.
2021-05-20T23:38:53.8027833Z vhd: Found 47 tests. 687ms
2021-05-20T23:38:53.8038301Z vhd: Discovery finished in 1.32s.
2021-05-20T23:38:53.8047082Z vhd: Running tests.
2021-05-20T23:38:53.8057504Z vhd:
2021-05-20T23:38:53.8066372Z vhd: Running tests from 'C:\image\Tests\Tools.Tests.ps1'
2021-05-20T23:38:55.0682044Z vhd: Describing Mingw64
2021-05-20T23:38:55.9917198Z vhd: [+] gcc 731ms (508ms|223ms)
2021-05-20T23:38:55.9926885Z vhd: [+] g++ 51ms (50ms|1ms)
2021-05-20T23:38:55.9936845Z vhd: [+] make 56ms (54ms|2ms)
2021-05-20T23:38:56.8764164Z vhd: Tests completed in 4.25s
2021-05-20T23:38:56.8775455Z vhd: Tests Passed: 3, Failed: 0, Skipped: 0 NotRun: 44
2021-05-20T23:38:56.8787938Z ==> vhd: Provisioning with powershell script: D:\VMImage\virtenvwin\images\win/scripts/Installers/Install-TypeScript.ps1
2021-05-20T23:39:02.9222899Z vhd: C:\npm\prefix\tsc -> C:\npm\prefix\node_modules\typescript\bin\tsc
2021-05-20T23:39:02.9232393Z vhd: C:\npm\prefix\tsserver -> C:\npm\prefix\node_modules\typescript\bin\tsserver
2021-05-20T23:39:02.9239645Z vhd: + typescript@4.2.4
2021-05-20T23:39:02.9249480Z vhd: added 1 package from 1 contributor in 1.258s
2021-05-20T23:39:05.4422461Z vhd:
2021-05-20T23:39:05.4432694Z vhd: Starting discovery in 1 files.
2021-05-20T23:39:05.4443227Z vhd: Filter 'FullName' set to ('Typescript').
2021-05-20T23:39:05.4455190Z vhd: Discovering in C:\image\Tests\Tools.Tests.ps1.
2021-05-20T23:39:06.8936451Z vhd: Found 47 tests. 693ms
2021-05-20T23:39:06.8945148Z vhd: Discovery finished in 1.38s.
2021-05-20T23:39:06.8953944Z vhd: Running tests.
2021-05-20T23:39:06.8963278Z vhd:
2021-05-20T23:39:06.8972897Z vhd: Running tests from 'C:\image\Tests\Tools.Tests.ps1'
2021-05-20T23:39:08.1463259Z vhd: Describing Typescript
2021-05-20T23:39:09.0834972Z vhd: [+] tsc 809ms (626ms|183ms)
2021-05-20T23:39:09.9160950Z vhd: Tests completed in 4.29s
2021-05-20T23:39:09.9173004Z vhd: Tests Passed: 1, Failed: 0, Skipped: 0 NotRun: 46
2021-05-20T23:39:09.9187778Z ==> vhd: Provisioning with powershell script: D:\VMImage\virtenvwin\images\win/scripts/Installers/Install-Haskell.ps1
2021-05-20T23:39:15.6382737Z vhd: Installing ghc 8.6.5...
2021-05-20T23:39:17.1094126Z vhd: Running [#1]: choco install ghc -y --version 8.6.5 -m
2021-05-20T23:39:17.1106582Z vhd: Chocolatey v0.10.15
2021-05-20T23:39:17.1118886Z vhd: Installing the following packages:
2021-05-20T23:39:17.1129085Z vhd: ghc
2021-05-20T23:39:17.1147193Z vhd: By installing you accept licenses for the packages.
2021-05-20T23:39:18.3144476Z vhd:
2021-05-20T23:39:18.3152607Z vhd: cabal v3.4.0.0 [Approved]
2021-05-20T23:39:18.3161767Z vhd: cabal package files install completed. Performing other installation steps.
2021-05-20T23:39:19.6545329Z vhd: Downloading cabal 64 bit
2021-05-20T23:39:19.6559431Z vhd: from 'https://downloads.haskell.org/cabal/cabal-install-3.4.0.0/cabal-install-3.4.0.0-x86_64-windows.zip'
2021-05-20T23:39:19.6566565Z vhd:
2021-05-20T23:39:19.6578911Z vhd: Download of cabal-install-3.4.0.0-x86_64-windows.zip (18.7 MB) completed.
2021-05-20T23:39:22.8124187Z vhd: Hashes match.
2021-05-20T23:39:22.8137106Z vhd: Extracting C:\Users\packer\AppData\Local\Temp\chocolatey\cabal\3.4.0.0\cabal-install-3.4.0.0-x86_64-windows.zip to C:\ProgramData\chocolatey\lib\cabal.3.4.0.0\tools\cabal-3.4.0.0...
2021-05-20T23:39:23.4379784Z vhd: C:\ProgramData\chocolatey\lib\cabal.3.4.0.0\tools\cabal-3.4.0.0
2021-05-20T23:39:24.0173322Z vhd: Standalone msys2 detected. Using default paths.
2021-05-20T23:39:26.0190083Z vhd: Could not read cabal configuration key 'install-method'.
2021-05-20T23:39:26.0197323Z vhd: Updated cabal configuration.
2021-05-20T23:39:26.0209070Z vhd: PATH environment variable does not have C:\Users\packer\AppData\Roaming\cabal\bin in it. Adding...
2021-05-20T23:39:27.7392097Z vhd: Standalone msys2 detected. Using default paths.
2021-05-20T23:39:27.7405288Z vhd: Adding C:\ProgramData\chocolatey\bin\mingw64-pkg.bat and pointing it to powershell command C:\ProgramData\chocolatey\lib\cabal.3.4.0.0\tools\mingw64-pkg.ps1
2021-05-20T23:39:27.7413822Z vhd: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-05-20T23:39:27.7422603Z vhd: see the changes (or in powershell/cmd.exe just type refreshenv).
2021-05-20T23:39:30.1675004Z vhd: ShimGen has successfully created a shim for cabal.exe
2021-05-20T23:39:30.1683582Z vhd: The install of cabal was successful.
2021-05-20T23:39:30.1692466Z vhd: Software installed to 'C:\ProgramData\chocolatey\lib\cabal.3.4.0.0\tools\cabal-3.4.0.0'
2021-05-20T23:39:30.1699532Z vhd:
2021-05-20T23:39:30.1709071Z vhd: ghc v8.6.5 [Approved]
2021-05-20T23:39:30.1717893Z vhd: ghc package files install completed. Performing other installation steps.
2021-05-20T23:39:30.1726229Z vhd: Downloading ghc 64 bit
2021-05-20T23:39:30.1736144Z vhd: from 'https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-unknown-mingw32.tar.xz'
2021-05-20T23:39:32.4882906Z vhd:
2021-05-20T23:39:32.4892658Z vhd: Download of ghcInstall (267.3 MB) completed.
2021-05-20T23:39:36.9289218Z vhd: Hashes match.
2021-05-20T23:39:36.9298727Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.6.5\tmp\ghcInstall
2021-05-20T23:39:36.9307753Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.6.5\tmp\ghcInstall to C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools...
2021-05-20T23:39:59.2597446Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools
2021-05-20T23:39:59.2607045Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools\ghcInstall~ to C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools...
2021-05-20T23:41:00.5037658Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools
2021-05-20T23:41:00.5047151Z vhd: PATH environment variable does not have C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools\ghc-8.6.5\bin in it. Adding...
2021-05-20T23:41:00.5055605Z vhd: Hiding shims for 'C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools'.
2021-05-20T23:41:03.6770255Z vhd: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-05-20T23:41:03.6782585Z vhd: see the changes (or in powershell/cmd.exe just type refreshenv).
2021-05-20T23:41:14.2003180Z vhd: The install of ghc was successful.
2021-05-20T23:41:14.2011145Z vhd: Software installed to 'C:\ProgramData\chocolatey\lib\ghc.8.6.5\tools'
2021-05-20T23:41:14.2018264Z vhd:
2021-05-20T23:41:14.2027048Z vhd: Chocolatey installed 2/2 packages.
2021-05-20T23:41:14.2035624Z vhd: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-05-20T23:41:16.1235570Z vhd: Package installed: ghc|8.6.5
2021-05-20T23:41:16.1244301Z vhd: Installing ghc 8.8.4.1...
2021-05-20T23:41:16.1254436Z vhd: Running [#1]: choco install ghc -y --version 8.8.4.1 -m
2021-05-20T23:41:16.1262669Z vhd: Chocolatey v0.10.15
2021-05-20T23:41:16.1270855Z vhd: Installing the following packages:
2021-05-20T23:41:16.1279400Z vhd: ghc
2021-05-20T23:41:16.1288397Z vhd: By installing you accept licenses for the packages.
2021-05-20T23:41:17.3608429Z vhd:
2021-05-20T23:41:17.3615442Z vhd: ghc v8.8.4.1 [Approved]
2021-05-20T23:41:17.3625254Z vhd: ghc package files install completed. Performing other installation steps.
2021-05-20T23:41:18.2584037Z vhd: Downloading ghc 64 bit
2021-05-20T23:41:18.2592708Z vhd: from 'https://downloads.haskell.org/~ghc/8.8.4/ghc-8.8.4-x86_64-unknown-mingw32.tar.xz'
2021-05-20T23:41:20.0836964Z vhd:
2021-05-20T23:41:20.0845859Z vhd: Download of ghcInstall (195.22 MB) completed.
2021-05-20T23:41:24.3188240Z vhd: Hashes match.
2021-05-20T23:41:24.3195765Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tmp\ghcInstall
2021-05-20T23:41:24.3205265Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tmp\ghcInstall to C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools...
2021-05-20T23:41:41.3497352Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools
2021-05-20T23:41:41.3506489Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools\ghcInstall~ to C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools...
2021-05-20T23:42:46.6608895Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools
2021-05-20T23:42:46.6618491Z vhd: PATH environment variable does not have C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools\ghc-8.8.4\bin in it. Adding...
2021-05-20T23:42:46.6626350Z vhd: Hiding shims for 'C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools'.
2021-05-20T23:42:52.3211102Z vhd: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-05-20T23:42:52.3219257Z vhd: see the changes (or in powershell/cmd.exe just type refreshenv).
2021-05-20T23:43:04.9236447Z vhd: The install of ghc was successful.
2021-05-20T23:43:04.9245585Z vhd: Software installed to 'C:\ProgramData\chocolatey\lib\ghc.8.8.4.1\tools'
2021-05-20T23:43:04.9252661Z vhd:
2021-05-20T23:43:04.9261939Z vhd: Chocolatey installed 1/1 packages.
2021-05-20T23:43:04.9271084Z vhd: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-05-20T23:43:06.9406638Z vhd: Package installed: ghc|8.8.4.1
2021-05-20T23:43:06.9414804Z vhd: Installing ghc 8.10.3...
2021-05-20T23:43:06.9423444Z vhd: Running [#1]: choco install ghc -y --version 8.10.3 -m
2021-05-20T23:43:06.9431250Z vhd: Chocolatey v0.10.15
2021-05-20T23:43:06.9439928Z vhd: Installing the following packages:
2021-05-20T23:43:06.9448063Z vhd: ghc
2021-05-20T23:43:06.9457185Z vhd: By installing you accept licenses for the packages.
2021-05-20T23:43:08.0523521Z vhd:
2021-05-20T23:43:08.0532309Z vhd: ghc v8.10.3 [Approved]
2021-05-20T23:43:08.0542046Z vhd: ghc package files install completed. Performing other installation steps.
2021-05-20T23:43:09.1466038Z vhd: Downloading ghc 64 bit
2021-05-20T23:43:09.1475156Z vhd: from 'https://downloads.haskell.org/~ghc/8.10.3/ghc-8.10.3-x86_64-unknown-mingw32.tar.xz'
2021-05-20T23:43:12.8533184Z vhd:
2021-05-20T23:43:12.8542844Z vhd: Download of ghcInstall (411.26 MB) completed.
2021-05-20T23:43:22.1723717Z vhd: Hashes match.
2021-05-20T23:43:24.9082782Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.10.3\tmp\ghcInstall
2021-05-20T23:43:24.9094018Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.10.3\tmp\ghcInstall to C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools...
2021-05-20T23:44:00.6482157Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools
2021-05-20T23:44:00.6491366Z vhd: Extracting C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools\ghcInstall~ to C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools...
2021-05-20T23:45:15.9769646Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools
2021-05-20T23:45:15.9778734Z vhd: Cannot rename because item at 'C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools\ghc-8.10.3-x86_64-unknown-mingw32' does not exist.
2021-05-20T23:45:15.9787431Z vhd: PATH environment variable does not have C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools\ghc-8.10.3\bin in it. Adding...
2021-05-20T23:45:15.9794300Z vhd: Hiding shims for 'C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools'.
2021-05-20T23:45:15.9802557Z vhd: Only an exit code of non-zero will fail the package by default. Set
2021-05-20T23:45:15.9811068Z vhd: --failonstderr if you want error messages to also fail a script. See
2021-05-20T23:45:15.9818703Z vhd: choco -h for details.
2021-05-20T23:45:15.9827229Z vhd: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-05-20T23:45:15.9834825Z vhd: see the changes (or in powershell/cmd.exe just type refreshenv).
2021-05-20T23:45:43.0789805Z vhd: The install of ghc was successful.
2021-05-20T23:45:43.0798278Z vhd: Software installed to 'C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools'
2021-05-20T23:45:43.0806472Z vhd:
2021-05-20T23:45:43.0815889Z vhd: Chocolatey installed 1/1 packages.
2021-05-20T23:45:43.0824381Z vhd: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-05-20T23:45:43.0831000Z vhd:
2021-05-20T23:45:43.0840281Z vhd: Enjoy using Chocolatey? Explore more amazing features to take your
2021-05-20T23:45:43.0848223Z vhd: experience to the next level at
2021-05-20T23:45:43.0856571Z vhd: https://chocolatey.org/compare
2021-05-20T23:45:45.2522805Z vhd: Package installed: ghc|8.10.3
2021-05-20T23:45:45.2573807Z vhd: C:\ProgramData\chocolatey\lib\ghc.8.10.3\tools\ghc-8.10.3\bin;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\R\R-4.1.0\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Rust.cargo\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\go\1.15.12\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.292-10\x64\bin;C:\npm\prefix;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\Chocolatey\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Docker;C:\Program Files\PowerShell\7;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\nodejs;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.1\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\TortoiseSVN\bin;C:\SeleniumWebDrivers\ChromeDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\Program Files\CMake\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin
2021-05-20T23:45:45.2580444Z vhd: Installing cabal...
2021-05-20T23:45:45.2580793Z vhd: Running [#1]: choco install cabal -y
2021-05-20T23:45:45.2581123Z vhd: Chocolatey v0.10.15
2021-05-20T23:45:45.2581487Z vhd: Installing the following packages:
2021-05-20T23:45:45.2581791Z vhd: cabal
2021-05-20T23:45:45.2582144Z vhd: By installing you accept licenses for the packages.
2021-05-20T23:45:45.2586776Z vhd: cabal v3.4.0.0 already installed.
2021-05-20T23:45:45.2595897Z vhd: Use --force to reinstall, specify a version to install, or try upgrade.
2021-05-20T23:45:45.2602417Z vhd:
2021-05-20T23:45:45.2611288Z vhd: Chocolatey installed 0/1 packages.
2021-05-20T23:45:45.2621491Z vhd: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-05-20T23:45:45.2628253Z vhd:
2021-05-20T23:45:45.2636916Z vhd: Warnings:
2021-05-20T23:45:45.2646585Z vhd: - cabal - cabal v3.4.0.0 already installed.
2021-05-20T23:45:45.2654940Z vhd: Use --force to reinstall, specify a version to install, or try upgrade.
2021-05-20T23:45:46.5338425Z vhd: Package installed: cabal|3.4.0.0
2021-05-20T23:45:48.1288138Z vhd:
2021-05-20T23:45:48.1297483Z vhd: Starting discovery in 1 files.
2021-05-20T23:45:48.1306290Z vhd: Discovering in C:\image\Tests\Haskell.Tests.ps1.
2021-05-20T23:45:49.2553238Z vhd: Found 7 tests. 508ms
2021-05-20T23:45:49.2561509Z vhd: Discovery finished in 1.06s.
2021-05-20T23:45:49.2569364Z vhd: Running tests.
2021-05-20T23:45:49.2577311Z vhd:
2021-05-20T23:45:49.2587123Z vhd: Running tests from 'C:\image\Tests\Haskell.Tests.ps1'
2021-05-20T23:45:50.5219598Z vhd: Describing Haskell
2021-05-20T23:45:51.8980196Z vhd: [+] Accurate 3 versions of GHC are installed 826ms (603ms|222ms)
2021-05-20T23:45:51.8988028Z vhd: [+] GHC 8.10.3 is installed 48ms (45ms|4ms)
2021-05-20T23:45:51.8996991Z vhd: [+] GHC 8.6.5 is installed 64ms (63ms|1ms)
2021-05-20T23:45:51.9005312Z vhd: [+] GHC 8.8.4.1 is installed 31ms (30ms|1ms)
2021-05-20T23:45:51.9015697Z vhd: [+] GHC 8.10.3 is the default version and should be the latest installed 26ms (25ms|1ms)
2021-05-20T23:45:51.9022573Z vhd: [-] Default GHC version is 9 39ms (36ms|2ms)
2021-05-20T23:45:51.9033265Z vhd: Expected regular expression '9(.\d+){2,}' for 'ghc --version' command to match 'The Glorious Glasgow Haskell Compilation System, version 8.10.3
2021-05-20T23:45:51.9039137Z vhd: ', but it did not match.
2021-05-20T23:45:51.9051884Z vhd: at "ghc --version" | Should -MatchCommandOutput "9(.\d+){2,}", C:\image\Tests\Haskell.Tests.ps1:41
2021-05-20T23:45:51.9059944Z vhd: at , C:\image\Tests\Haskell.Tests.ps1:41
2021-05-20T23:45:51.9068144Z vhd: [+] Cabal is installed 67ms (65ms|1ms)
2021-05-20T23:45:52.7396637Z vhd: Tests completed in 4.38s
2021-05-20T23:45:52.7406339Z ==> vhd: Test run has failed
2021-05-20T23:45:52.7415799Z vhd: Tests Passed: 6, Failed: 1, Skipped: 0 NotRun: 0
2021-05-20T23:45:52.7422936Z vhd:
2021-05-20T23:45:52.7432729Z ==> vhd: At C:\Program Files\WindowsPowerShell\Modules\ImageHelpers\TestsHelpers.ps1:69 char:9
2021-05-20T23:45:52.7439139Z ==> vhd: + throw "Test run has failed"
2021-05-20T23:45:52.7447548Z ==> vhd: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-05-20T23:45:52.7456549Z ==> vhd: + CategoryInfo : OperationStopped: (Test run has failed:String) [], RuntimeException
2021-05-20T23:45:52.7462480Z vhd:
2021-05-20T23:45:52.7471700Z vhd: Containers : {[-] C:\image\Tests\Haskell.Tests.ps1}
2021-05-20T23:45:52.7479385Z vhd: Result : Failed
2021-05-20T23:45:52.7487479Z vhd: FailedCount : 1
2021-05-20T23:45:52.7495751Z vhd: FailedBlocksCount : 0
2021-05-20T23:45:52.7503311Z vhd: FailedContainersCount : 0
2021-05-20T23:45:52.7511375Z vhd: PassedCount : 6
2021-05-20T23:45:52.7519509Z vhd: SkippedCount : 0
2021-05-20T23:45:52.7527471Z vhd: NotRunCount : 0
2021-05-20T23:45:52.7538231Z vhd: TotalCount : 7
2021-05-20T23:45:52.7546632Z vhd: Duration : 00:00:04.3800109
2021-05-20T23:45:52.7554313Z vhd: Executed : True
2021-05-20T23:45:52.7563336Z vhd: ExecutedAt : 5/20/2021 11:45:45 PM
2021-05-20T23:45:52.7570618Z vhd: Version : 5.2.1
2021-05-20T23:45:52.7579581Z vhd: PSVersion : 5.1.17763.1852
2021-05-20T23:45:52.7589066Z vhd: PSBoundParameters : {[Configuration, PesterConfiguration]}
2021-05-20T23:45:52.7596090Z vhd: Plugins :
2021-05-20T23:45:52.7604973Z vhd: PluginConfiguration :
2021-05-20T23:45:52.7612999Z vhd: PluginData :
2021-05-20T23:45:52.7622117Z vhd: Configuration : PesterConfiguration
2021-05-20T23:45:52.7629703Z vhd: DiscoveryDuration : 00:00:00.9672357
2021-05-20T23:45:52.7637656Z vhd: UserDuration : 00:00:01.0176546
2021-05-20T23:45:52.7646703Z vhd: FrameworkDuration : 00:00:02.3951206
2021-05-20T23:45:52.7655130Z vhd: Failed : {[-] Default GHC version is 9}
2021-05-20T23:45:52.7662026Z vhd: FailedBlocks : {}
2021-05-20T23:45:52.7670946Z vhd: FailedContainers : {}
2021-05-20T23:45:52.7679932Z vhd: Passed : {[+] Accurate 3 versions of GHC are installed, [+] GHC 8.10.3 is installed, [+] GHC 8.6.5 is
2021-05-20T23:45:52.7687251Z vhd: installed, [+] GHC 8.8.4.1 is installed...}
2021-05-20T23:45:52.7694804Z vhd: Skipped : {}
2021-05-20T23:45:52.7702768Z vhd: NotRun : {}
2021-05-20T23:45:52.7712095Z vhd: Tests : {[+] Accurate 3 versions of GHC are installed, [+] GHC 8.10.3 is installed, [+] GHC 8.6.5 is
2021-05-20T23:45:52.7719096Z vhd: installed, [+] GHC 8.8.4.1 is installed...}
2021-05-20T23:45:52.7726781Z vhd: CodeCoverage :
2021-05-20T23:45:52.7734449Z vhd:
2021-05-20T23:45:52.7743765Z ==> vhd: + FullyQualifiedErrorId : Test run has failed
2021-05-20T23:45:52.7750835Z ==> vhd:
2021-05-20T23:45:52.7763132Z ==> vhd: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
2021-05-20T23:45:52.7766435Z ==> vhd: Step "StepProvision" failed

@dibir-magomedsaygitov
Copy link
Contributor

Hello @tumm0283. Thank you for your report. Could you please provide us minimal repro-steps to speed up investigation process.

@dibir-magomedsaygitov
Copy link
Contributor

dibir-magomedsaygitov commented May 24, 2021

Hello @tumm0283. This is a known issue with GCH and we reported it to choco team. You can track the status here.

@HUMBERP
Copy link

HUMBERP commented May 25, 2021

hi! As we run into the same problem during installation, i ended up with some modification to the install-haskell script

$MajorMinorDictonary = [System.Collections.Generic.SortedDictionary[string, System.Collections.Generic.SortedSet[version]]]::new()
$null = $MajorMinorDictonary.Clear()

$ODataQuery = '$filter=(Title eq ''ghc'') and (IsPrerelease eq false)&$orderby=Version desc'
$Url = "https://community.chocolatey.org/api/v2/Packages()?$ODataQuery"
$ChocoVersionsOutput = (Invoke-RestMethod -Uri $Url |
    Select-Object -Property @(
        @{ Name = 'Id'; Expression = { $_.title.innertext } }
        @{ Name = 'Version'; Expression = { [Version]$_.properties.Version } }
    )).Version

foreach ($ChocoversionEntry in $ChocoVersionsOutput) {
    if ($MajorMinorDictonary.ContainsKey($ChocoversionEntry.ToString(2))) {
        $CurrentDictonaryObject = $MajorMinorDictonary[$ChocoversionEntry.ToString(2)]
    }
    else {
        $CurrentDictonaryObject = [System.Collections.Generic.SortedSet[version]]::new()
        $null = $MajorMinorDictonary.Add($ChocoversionEntry.ToString(2), $CurrentDictonaryObject)
    }
    $null = $CurrentDictonaryObject.Add($ChocoversionEntry)
}

$VersionsList = $MajorMinorDictonary.GetEnumerator() | Select-Object -Last 3 | ForEach-Object { $_.Value.Reverse() | Select-Object -First 1 }

<# from here on the same installation steps #>

The odata query resolves the issue not returning the version 9.0.1 from choco search (as recommended from the open ticket), and the SortedSet and SortedDictonary resolves the issue that PowerShell and Windows PowerShell are sorting lists in different ways. May be you can give this a try.
@miketimofeev : may be interessting for you

@miketimofeev
Copy link
Contributor

@HUMBERP thanks for the query! But looks like it needs to be modified a bit since it returns

Major  Minor  Build  Revision
-----  -----  -----  --------
8      6      5      -1
8      8      4      1
9      0      1      -1

But we need 8.8.4.1, 8.10.4, and 9.0.1. Version sorting is always a pain

@HUMBERP
Copy link

HUMBERP commented May 26, 2021

@miketimofeev : I will have a look ...

@HUMBERP
Copy link

HUMBERP commented May 26, 2021

ok, my fault, stings can never be sorted correctly, because 10 is lower then 9 ... using the version type, the objects are sorted the right way (only a few modification is needed to the script sample).

      $MajorMinorDictonary = [System.Collections.Generic.SortedDictionary[version, System.Collections.Generic.SortedSet[version]]]::new()
      $null = $MajorMinorDictonary.Clear()

      $ODataQuery = '$filter=(Title eq ''ghc'') and (IsPrerelease eq false)&$orderby=Version desc'
      $Url = "https://community.chocolatey.org/api/v2/Packages()?$ODataQuery"
      $ChocoVersionsOutput = (Invoke-RestMethod -Uri $Url |
      Select-Object -Property @(
            @{ Name = 'Id'; Expression = { $_.title.innertext } }
            @{ Name = 'Version'; Expression = { [Version]$_.properties.Version } }
      )).Version

      foreach ($ChocoversionEntry in $ChocoVersionsOutput) {
            $ComparerVersion = [Version]('{0}.{1}' -f $ChocoversionEntry.Major, $ChocoversionEntry.Minor)
            if ($MajorMinorDictonary.ContainsKey($ComparerVersion)) {
                  $CurrentDictonaryObject = $MajorMinorDictonary[$ComparerVersion]
            }
            else {
                  $CurrentDictonaryObject = [System.Collections.Generic.SortedSet[version]]::new()
                  $null = $MajorMinorDictonary.Add($ComparerVersion, $CurrentDictonaryObject)
            }
            $null = $CurrentDictonaryObject.Add($ChocoversionEntry)
      }

      $VersionsList = $MajorMinorDictonary.GetEnumerator() | Select-Object -Last 3 | ForEach-Object { $_.Value.Reverse() | Select-Object -First 1 }

but keep in mind, that the "orderby" string in the odata query is used. This can also be a trap, because may be the results from chocolatey are "wrong". (If you remove the orderby query string, you get the result 9.0.1, 8.10.3 and 8.8.4.1)! So it seems for now to work, but I feel like "this is not the end" ...

@miketimofeev
Copy link
Contributor

@HUMBERP I think we can combine our current approach with the ODATA query so it will be

$ODataQuery = '$filter=(Title eq ''ghc'') and (IsPrerelease eq false)&$orderby=Version desc'
$Url = "https://community.chocolatey.org/api/v2/Packages()?$ODataQuery"
$ChocoVersionsOutput = (Invoke-RestMethod -Uri $Url |
Select-Object -Property @(
      @{ Name = 'Id'; Expression = { $_.title.innertext } }
      @{ Name = 'Version'; Expression = { [Version]$_.properties.Version } }
)).Version
$MajorMinorGroups = $ChocoVersionsOutput | Sort-Object -Descending | Group-Object { $_.ToString(2) } | Select-Object -First 3
$VersionsList = $MajorMinorGroups | ForEach-Object { $_.Group | Select-Object -First 1 } | Sort-Object

Looks good using native PowerShell
image

@HUMBERP
Copy link

HUMBERP commented May 26, 2021

for sure, keep it simple. (My aproach with the SortedSet and SortedDictonary was only because of PowerShell pwsh sorts different to Windows PowerShell and in case some time the packer runners switches over to PowerShell this won't work any longer, but this is may be never the case, who knows ;-))

@miketimofeev
Copy link
Contributor

@HUMBERP I haven't noticed different sorting since I didn't check pwsh 7 before. I vote for your approach then 😄
I'll prepare the PR with the changes.
Thank you!

@miketimofeev
Copy link
Contributor

@tumm0283 @HUMBERP we have switched the installation script to use the OData query to avoid the issue. Could you please pull the latest main and test if the issue persists?

@miketimofeev miketimofeev added bug Something isn't working and removed investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels May 27, 2021
@HUMBERP
Copy link

HUMBERP commented May 27, 2021

@miketimofeev: I have started our process, but this takes up to 8 hours. I keep you informed ... finally the process finished with success (ghc versions are correctly installed) :-) thank you very much

@tumm0283
Copy link
Author

@miketimofeev we started the process ,will keep you updated.Thank You!

@tumm0283
Copy link
Author

@miketimofeev just finished the process and testing no issues this time all looks good ..Appreciated thanks again

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

No branches or pull requests

4 participants