microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
379 stars 243 forks source link

Wrong message when providing a non existing country (minor issue) #1202

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the issue When using a non existing country parameter value in the artifact, the system returns message: The container operating system does not match the host operating system. As far as I understand this has nothing to do with the operating system. Just me being stupid to use 'uk' io. 'gb'.

Scripts used to create container and cause the issue

$containerName = 'bci-uk-0807'
$sasToken = "..."
$artifactURL = Get-BCArtifactUrl -type "sandbox" -storageAccount "bcinsider" -country "uk" -select "latest" -sasToken $sasToken 
$licenseFile = "C:\Temp\DEV.flf"
$credential = New-Object PSCredential 'admin', (ConvertTo-SecureString -String 'P@ssW0rd' -AsPlainText -Force)
New-BCContainer -accept_eula `
                -accept_outdated `
                -containerName $containerName `
                -artifactURL $artifactURL `
                -auth UserPassword `
                -Credential $credential `
                -licenseFile $licenseFile `
                -updateHosts `
                -assignPremiumPlan `
                -includeAL `
                -isolation process `
                -dns 8.8.8.8 `
                -doNotCheckHealth `
                -alwaysPull `
                -shortCuts Desktop 

Full output of scripts

NavContainerHelper is version 0.7.0.23
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - 2004
Docker Client Version is 19.03.12
Docker Server Version is 19.03.12
Removing bci-uk-0807 from host hosts file
Removing C:\ProgramData\NavContainerHelper\Extensions\bci-uk-0807
Fetching all docker images
Pulling image mcr.microsoft.com/businesscentral/onprem:ltsc2019
ltsc2019: Pulling from businesscentral/onprem
Using image mcr.microsoft.com/businesscentral/onprem:ltsc2019
Disabling Health Check (always report healthy)
Creating Container bci-uk-0807
Version: 16.3.14085.14238-W1
Style: onprem
Platform: 16.0.14073.14195
Generic Tag: 0.0.9.99
Container OS Version: 10.0.17763.973 (ltsc2019)
Host OS Version: 10.0.19041.388 (2004)
Using locale en-US
Using process isolation
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Temp\DEV.flf
Files in C:\ProgramData\NavContainerHelper\Extensions\bci-uk-0807\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bci-uk-0807 from image mcr.microsoft.com/businesscentral/onprem:ltsc2019
bb0fd0e048afdf4f319d129abeeb9e0f7167c992b0da331a7e8ff2e2fa6ce5fc
DockerDo : docker: Error response from daemon: hcsshim::CreateComputeSystem bb0fd0e048afdf4f319d129abeeb9e0f7167c992b0da331a7e8ff2e2fa6ce5fc: The container operating system does not match the host operating system.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

freddydk commented 4 years ago

The reason for this is that $artifactUrl is empty Calling Get-BcArtifactUrl returns empty if something isn't found. I will fix new-bccontainer to give an understandable error if both artifacturl and imagename are empty.

Thanks

freddydk commented 4 years ago

Is available in BcContainerHelper 1.0.2-prerelease Ships in BcContainerHelper 1.0.2