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

Download of Artifact often fails and triples the time to create a container #1719

Closed GreatScott000 closed 3 years ago

GreatScott000 commented 3 years ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue I often see the artifact download fail and fall back to another URL. This fail/failover process seems to take an inordinate amount of time (a number of minutes).

Why is this download failure happening? Is there a problem with the default artifact URL? Is there a throttling issue?
Can the "fail/failover" happen faster?

Scripts used to create container and cause the issue

Run-AlValidation `
    -licenseFile $licenseFile `
    -apps $apps `
    -previousApps $previousApps `
    -affixes $affixes `
    -countries $countries

I have include the full results below but it is not really really relevant. Here is the relevant section

  / ____|              | | (_)                             | |      (_)                
 | |     _ __ ___  __ _| |_ _ _ __   __ _    ___ ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
 | |    | '__/ _ \/ _` | __| | '_ \ / _` |  / __/ _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | |____| | |  __/ (_| | |_| | | | | (_| | | (__ (_) | | | | |_ (_| | | | | |  __/ |   
  \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \___\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
                                     __/ |                                             
                                    |___/                                              

Creating container for country gb
BcContainerHelper is version 2.0.5
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - 20H2
Docker Client Version is 20.10.2
Docker Server Version is 20.10.2
Downloading application artifact /sandbox/17.0.17126.22050/gb
Downloading C:\Users\micro\AppData\Local\Temp\5d2d89cb-16a8-4559-904e-85f2e28b70b5.zip
Could not download from https://bcartifacts.azureedge.net/..., retrying from https://bcartifacts.blob.core.windows.net/...
Unpacking application artifact to tmp folder using 7zip
Downloading platform artifact /sandbox/17.0.17126.22050/platform
Downloading C:\Users\micro\AppData\Local\Temp\8a166358-1baa-4fc0-a54b-997159caef4e.zip
Unpacking platform artifact to tmp folder using 7zip

When it doesn't have an issue downloading the artifact it takes less than 5 minutes to build the container

Creating container took 288 seconds

When it fails the first time it takes nearly 3 times as long (13+ minutes)

Creating container took 824 seconds

Scripts used to create container and cause the issue

Setting hostHelperFolder = d:\bccontainerhelper
Setting bcartifactsCacheFolder = d:\bcartifacts.cache
BcContainerHelper version 2.0.5
  _____                               _                
 |  __ \                             | |               
 | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___ 
 |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
 | |  | (_| | | | (_| | | | | | |  __/ |_  __/ |  \__ \
 |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/

Container name               bcserver
Image name                   
Credential                   admin/Xeho6190
License file                 Specified
MemoryLimit                  8G
validateVersion              
validateCurrent              False
validateNextMinor            False
validateNextMajor            False
SasToken                     Not Specified
countries                    gb
validateCountries            gb
affixes                      iMS
supportedCountries           
vsixFile                     
Install Apps
- None
Previous Apps
- None
Apps
- D:\Repos\evolveims\FinTools\src\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
- D:\Repos\evolveims\FinTools\test\Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
  _____       _                      _                         _   _  __           _       
 |  __ \     | |                    (_)                       | | (_)/ _|         | |      
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __   ___    __ _ _ __| |_ _| |_ __ _  ___| |_ ___ 
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \ / _ \  / _` | '__| __| |  _/ _` |/ __| __/ __|
 | |__| |  __/ |_  __/ |  | | | | | | | | | |  __/ | (_| | |  | |_| | || (_| | (__| |_\__ \
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|\___|  \__,_|_|   \__|_|_| \__,_|\___|\__|___/

Found https://bcartifacts.azureedge.net/sandbox/17.4.21491.22171/gb
Using https://bcartifacts.azureedge.net/sandbox/17.4.21491.22171/gb
  _____       _                      _       _                   _                           _                       
 |  __ \     | |                    (_)     (_)                 | |                         | |                      
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __  _ _ __   __ _    __| | ___ _ __   ___ _ __   __| | ___ _ __   ___ _   _ 
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \| | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '_ \ / _` |/ _ \ '_ \ / __| | | |
 | |__| |  __/ |_  __/ |  | | | | | | | | | | | | | | (_| | | (_| |  __/ |_) |  __/ | | | (_| |  __/ | | | (__| |_| |
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|_|_| |_|\__, |  \__,_|\___| .__/ \___|_| |_|\__,_|\___|_| |_|\___|\__, |
                                                      __/ |            | |                                      __/ |
                                                     |___/             |_|                                     |___/ 
Extracting D:\bccontainerhelper\42c11cd4-9f68-40b0-8574-4f33ed4ef507\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
Extracting D:\bccontainerhelper\42c11cd4-9f68-40b0-8574-4f33ed4ef507\Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
Validating against Current Version (17.4)
Additionally validating against application dependency (17.0)

  _____       _ _ _                                          _        _                            
 |  __ \     | | (_)                                        (_)      (_)                           
 | |__) |   _| | |_ _ __   __ _    __ _  ___ _ __   ___ _ __ _  ___   _ _ __ ___   __ _  __ _  ___ 
 |  ___/ | | | | | | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '__| |/ __| | | '_ ` _ \ / _` |/ _` |/ _ \
 | |   | |_| | | | | | | | (_| | | (_| |  __/ | | |  __/ |  | | (__  | | | | | | | (_| | (_| |  __/
 |_|    \__,_|_|_|_|_| |_|\__, |  \__, |\___|_| |_|\___|_|  |_|\___| |_|_| |_| |_|\__,_|\__, |\___|
                           __/ |   __/ |                                                 __/ |     
                          |___/   |___/                                                 |___/      

Pulling mcr.microsoft.com/businesscentral:10.0.19042.804

Pulling generic image took 1 seconds

   _____                _   _                               _        _                 
  / ____|              | | (_)                             | |      (_)                
 | |     _ __ ___  __ _| |_ _ _ __   __ _    ___ ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
 | |    | '__/ _ \/ _` | __| | '_ \ / _` |  / __/ _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | |____| | |  __/ (_| | |_| | | | | (_| | | (__ (_) | | | | |_ (_| | | | | |  __/ |   
  \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \___\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
                                     __/ |                                             
                                    |___/                                              

Creating container for country gb
BcContainerHelper is version 2.0.5
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - 20H2
Docker Client Version is 20.10.2
Docker Server Version is 20.10.2
Removing bcserver from host hosts file
Removing bcserver-* from host hosts file
Removing d:\bccontainerhelper\Extensions\bcserver
Fetching all docker images
Using image mcr.microsoft.com/businesscentral:10.0.19042.804
Creating Container bcserver
Version: 17.4.21491.22171-GB
Style: sandbox
Multitenant: No
Platform: 17.0.21485.22158
Generic Tag: 1.0.1.3
Container OS Version: 10.0.19042.804 (20H2)
Host OS Version: 10.0.19042.804 (20H2)
Using process isolation
Using locale en-GB
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file D:\License\BC17License.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in d:\bccontainerhelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.19042.804
0811e2c20416266d61c329fe7a1f3f49df0bcee13ebfe6556f0312de0d9b4674
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/17.4.21491.22171/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
Copying PowerShell Scripts
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\17.4.21491.22171\gb\BusinessCentral-GB.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
Copying Client Files
Copying ModernDev Files
Copying additional files
Copying ConfigurationPackages
Copying Test Assemblies
Copying Extensions
Copying Applications
Copying Applications.GB
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 196 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.192.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 755749E0326144F41AF3591297B006DB0C133F9B
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Enabling Financials User Experience
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.27.196.94
Container Hostname  : bcserver
Container Dns Name  : bcserver
Web Client          : http://bcserver/BC/
Dev. Server         : http://bcserver
Dev. ServerInstance : BC
Setting bcserver to 172.27.196.94 in host hosts file

Files:
http://bcserver:8080/ALLanguage.vsix

Container Total Physical Memory is 15.7Gb
Container Free Physical Memory is 4.7Gb

Initialization took 74 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Creating Desktop Shortcuts for bcserver
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again

Creating container took 288 seconds
  _____                   _                                    _____                           _____            
 |  __ \                 (_)                 /\               / ____|                         / ____|           
 | |__) |   _ _ __  _ __  _ _ __   __ _     /  \   _ __  _ __| (___   ___  _   _ _ __ ___ ___| |     ___  _ __  
 |  _  / | | | '_ \| '_ \| | '_ \ / _` |   / /\ \ | '_ \| '_ \\___ \ / _ \| | | | '__/ __/ _ \ |    / _ \| '_ \ 
 | | \ \ |_| | | | | | | | | | | | (_| |  / ____ \| |_) | |_) |___) | (_) | |_| | | | (__  __/ |____ (_) | |_) |
 |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | /_/    \_\ .__/| .__/_____/ \___/ \__,_|_|  \___\___|\_____\___/| .__/ 
                                   __/ |          | |   | |                                              | |    
                                  |___/           |_|   |_|                                              |_|    
Extracting D:\bccontainerhelper\9d97f2c7-8175-4a1f-b56f-3c1fbe19dfdf\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
Analyzing: Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
Using affixes: iMS
Downloading d:\bccontainerhelper\191eda5a-2110-4354-bc5a-28cbe5b004fe\appsource.default.ruleset.json
AppSourceCop.json content:
{
    "mandatoryAffixes":  [
                             "iMS"
                         ]
}
Ruleset.json content:
{
    "name":  "Run-AlCops RuleSet",
    "description":  "Generated by Run-AlCops",
    "includedRuleSets":  [
                             {
                                 "path":  "C:\\ProgramData\\BcContainerHelper\\191eda5a-2110-4354-bc5a-28cbe5b004fe\\appsource.default.ruleset.json",
                                 "action":  "Default"
                             }
                         ]
}
Using Symbols Folder: d:\bccontainerhelper\1d79dbaa-59eb-4151-bb7c-4516c8762439
Copying System.app from Container
Copying Microsoft_Application_17.4.21491.22171.app from Container
Copying Microsoft_Base Application_17.4.21491.22171.app from Container
Copying Microsoft_System Application_17.4.21491.22171.app from Container
Compiling...
.\alc.exe /project:"C:\ProgramData\BcContainerHelper\191eda5a-2110-4354-bc5a-28cbe5b004fe" /packagecachepath:"C:\ProgramData\BcContainerHelper\1d79dbaa-59eb-4151-bb7c-4516c876
2439" /out:"C:\ProgramData\BcContainerHelper\191eda5a-2110-4354-bc5a-28cbe5b004fe\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app" /analyzer:C:\build\vsix\extension\bin\Analyze
rs\Microsoft.Dynamics.Nav.AppSourceCop.dll /ruleset:C:\ProgramData\BcContainerHelper\191eda5a-2110-4354-bc5a-28cbe5b004fe\ruleset.json /assemblyprobingpaths:"C:\Program Files 
(x86)\Microsoft Dynamics NAV\170\RoleTailored Client","C:\Program Files\Microsoft Dynamics NAV\170\Service","C:\Program Files (x86)\Open XML SDK\V2.5\lib","c:\Windows\Microsof
t.NET\Assembly","C:\Test Assemblies\Mock Assemblies"
Microsoft (R) AL Compiler version 6.4.6.9919
Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'iMS Finance Tools' containing '22' files at '10:24:59.778'.

Compilation ended at '10:25:4.30'.

d:\bccontainerhelper\191eda5a-2110-4354-bc5a-28cbe5b004fe\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app successfully created in 25 seconds
Ignoring warnings
Extracting D:\bccontainerhelper\9d97f2c7-8175-4a1f-b56f-3c1fbe19dfdf\Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
Analyzing: Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
Using affixes: iMS
Downloading d:\bccontainerhelper\72a39925-c19c-4072-a172-c63c09e434f3\appsource.default.ruleset.json
AppSourceCop.json content:
{
    "mandatoryAffixes":  [
                             "iMS"
                         ]
}
Ruleset.json content:
{
    "name":  "Run-AlCops RuleSet",
    "description":  "Generated by Run-AlCops",
    "includedRuleSets":  [
                             {
                                 "path":  "C:\\ProgramData\\BcContainerHelper\\72a39925-c19c-4072-a172-c63c09e434f3\\appsource.default.ruleset.json",
                                 "action":  "Default"
                             }
                         ]
}
Using Symbols Folder: d:\bccontainerhelper\1d79dbaa-59eb-4151-bb7c-4516c8762439
Copying System.app from Container
Copying Microsoft_Application_17.4.21491.22171.app from Container
Copying Microsoft_Base Application_17.4.21491.22171.app from Container
Copying Microsoft_System Application_17.4.21491.22171.app from Container
Downloading symbols: Microsoft_Library Assert_17.0.0.0.app
Url : http://172.27.196.94:7049/BC/dev/packages?publisher=Microsoft&appName=Library Assert&versionText=17.0.0.0&tenant=default
Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )
at Compile-AppInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Compile-AppInNavContainer.ps1: line 366
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 68
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 212
at Run-AlCops, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 112
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 495
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 478
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 393
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 367
at Run-AlValidation, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 365
at <ScriptBlock>, D:\Repos\evolveims\FinTools\scripts\Al-validation.ps1: line 48

  _____                           _                _____            _        _                 
 |  __ \                         (_)              / ____|          | |      (_)                
 | |__) |___ _ __ ___   _____   ___ _ __   __ _  | |     ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
 |  _  // _ \ '_ ` _ \ / _ \ \ / / | '_ \ / _` | | |    / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | | \ \  __/ | | | | | (_) \ V /| | | | | (_| | | |____ (_) | | | | |_ (_| | | | | |  __/ |   
 |_|  \_\___|_| |_| |_|\___/ \_/ |_|_| |_|\__, |  \_____\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
                                           __/ |                                               
                                          |___/                                                

Removing container bcserver
Removing bcserver from host hosts file
Removing bcserver-* from host hosts file
Removing d:\bccontainerhelper\Extensions\bcserver

Removing container took 7 seconds
  _____       _                      _                         _   _  __           _       
 |  __ \     | |                    (_)                       | | (_)/ _|         | |      
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __   ___    __ _ _ __| |_ _| |_ __ _  ___| |_ ___ 
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \ / _ \  / _` | '__| __| |  _/ _` |/ __| __/ __|
 | |__| |  __/ |_  __/ |  | | | | | | | | | |  __/ | (_| | |  | |_| | || (_| | (__| |_\__ \
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|\___|  \__,_|_|   \__|_|_| \__,_|\___|\__|___/

Found https://bcartifacts.azureedge.net/sandbox/17.0.17126.22050/gb
Using https://bcartifacts.azureedge.net/sandbox/17.0.17126.22050/gb

   _____                _   _                               _        _                 
  / ____|              | | (_)                             | |      (_)                
 | |     _ __ ___  __ _| |_ _ _ __   __ _    ___ ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
 | |    | '__/ _ \/ _` | __| | '_ \ / _` |  / __/ _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | |____| | |  __/ (_| | |_| | | | | (_| | | (__ (_) | | | | |_ (_| | | | | |  __/ |   
  \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \___\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
                                     __/ |                                             
                                    |___/                                              

Creating container for country gb
BcContainerHelper is version 2.0.5
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - 20H2
Docker Client Version is 20.10.2
Docker Server Version is 20.10.2
Downloading application artifact /sandbox/17.0.17126.22050/gb
Downloading C:\Users\micro\AppData\Local\Temp\5d2d89cb-16a8-4559-904e-85f2e28b70b5.zip
Could not download from https://bcartifacts.azureedge.net/..., retrying from https://bcartifacts.blob.core.windows.net/...
Unpacking application artifact to tmp folder using 7zip
Downloading platform artifact /sandbox/17.0.17126.22050/platform
Downloading C:\Users\micro\AppData\Local\Temp\8a166358-1baa-4fc0-a54b-997159caef4e.zip
Unpacking platform artifact to tmp folder using 7zip
Downloading Prerequisite Components
Downloading d:\bcartifacts.cache\sandbox\17.0.17126.22050\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
Downloading d:\bcartifacts.cache\sandbox\17.0.17126.22050\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading d:\bcartifacts.cache\sandbox\17.0.17126.22050\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
Fetching all docker images
Using image mcr.microsoft.com/businesscentral:10.0.19042.804
Creating Container bcserver
Version: 17.0.17126.22050-GB
Style: sandbox
Multitenant: No
Platform: 17.0.17020.22022
Generic Tag: 1.0.1.3
Container OS Version: 10.0.19042.804 (20H2)
Host OS Version: 10.0.19042.804 (20H2)
Using process isolation
Using locale en-GB
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file D:\License\BC17License.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in d:\bccontainerhelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.19042.804
c2ebc91c1ea8bed81d2f57bd2cc92b59eb1d34d047ed62e5d9ff9d3b7ffea638
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/17.0.17126.22050/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
Copying PowerShell Scripts
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\17.0.17126.22050\gb\BusinessCentral-GB.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
Copying Client Files
Copying ModernDev Files
Copying additional files
Copying ConfigurationPackages
Copying Test Assemblies
Copying Extensions
Copying Applications
Copying Applications.GB
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 175 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.192.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 2C0C2F2C48FE6F73085A9A01E825C47660F77D92
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Enabling Financials User Experience
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.27.192.129
Container Hostname  : bcserver
Container Dns Name  : bcserver
Web Client          : http://bcserver/BC/
Dev. Server         : http://bcserver
Dev. ServerInstance : BC
Setting bcserver to 172.27.192.129 in host hosts file

Files:
http://bcserver:8080/ALLanguage.vsix

Container Total Physical Memory is 15.7Gb
Container Free Physical Memory is 3.7Gb

Initialization took 70 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Creating Desktop Shortcuts for bcserver
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again

Creating container took 824 seconds
  _____                   _                                    _____                           _____            
 |  __ \                 (_)                 /\               / ____|                         / ____|           
 | |__) |   _ _ __  _ __  _ _ __   __ _     /  \   _ __  _ __| (___   ___  _   _ _ __ ___ ___| |     ___  _ __  
 |  _  / | | | '_ \| '_ \| | '_ \ / _` |   / /\ \ | '_ \| '_ \\___ \ / _ \| | | | '__/ __/ _ \ |    / _ \| '_ \ 
 | | \ \ |_| | | | | | | | | | | | (_| |  / ____ \| |_) | |_) |___) | (_) | |_| | | | (__  __/ |____ (_) | |_) |
 |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | /_/    \_\ .__/| .__/_____/ \___/ \__,_|_|  \___\___|\_____\___/| .__/ 
                                   __/ |          | |   | |                                              | |    
                                  |___/           |_|   |_|                                              |_|    
Extracting D:\bccontainerhelper\0037f099-fb9e-4dc5-9004-4149dd1b21ca\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
Analyzing: Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app
Using affixes: iMS
Downloading d:\bccontainerhelper\57e177f7-a195-42dc-8d3f-905bb4d61cd1\appsource.default.ruleset.json
AppSourceCop.json content:
{
    "mandatoryAffixes":  [
                             "iMS"
                         ]
}
Ruleset.json content:
{
    "name":  "Run-AlCops RuleSet",
    "description":  "Generated by Run-AlCops",
    "includedRuleSets":  [
                             {
                                 "path":  "C:\\ProgramData\\BcContainerHelper\\57e177f7-a195-42dc-8d3f-905bb4d61cd1\\appsource.default.ruleset.json",
                                 "action":  "Default"
                             }
                         ]
}
Using Symbols Folder: d:\bccontainerhelper\e3e6af8a-7245-4802-91ef-65cd29262c26
Copying System.app from Container
Copying Microsoft_Application_17.0.17126.22050.app from Container
Copying Microsoft_Base Application_17.0.17126.22050.app from Container
Copying Microsoft_System Application_17.0.17126.22050.app from Container
Compiling...
.\alc.exe /project:"C:\ProgramData\BcContainerHelper\57e177f7-a195-42dc-8d3f-905bb4d61cd1" /packagecachepath:"C:\ProgramData\BcContainerHelper\e3e6af8a-7245-4802-91ef-65cd2926
2c26" /out:"C:\ProgramData\BcContainerHelper\57e177f7-a195-42dc-8d3f-905bb4d61cd1\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app" /analyzer:C:\build\vsix\extension\bin\Analyze
rs\Microsoft.Dynamics.Nav.AppSourceCop.dll /ruleset:C:\ProgramData\BcContainerHelper\57e177f7-a195-42dc-8d3f-905bb4d61cd1\ruleset.json /assemblyprobingpaths:"C:\Program Files 
(x86)\Microsoft Dynamics NAV\170\RoleTailored Client","C:\Program Files\Microsoft Dynamics NAV\170\Service","C:\Program Files (x86)\Open XML SDK\V2.5\lib","c:\Windows\Microsof
t.NET\Assembly","C:\Test Assemblies\Mock Assemblies"
Microsoft (R) AL Compiler version 6.0.5.33503
Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'iMS Finance Tools' containing '22' files at '10:39:20.431'.

Compilation ended at '10:39:24.694'.

d:\bccontainerhelper\57e177f7-a195-42dc-8d3f-905bb4d61cd1\Evolve iMS Ltd._iMS Finance Tools_17.0.0.0.app successfully created in 24 seconds
Ignoring warnings
Extracting D:\bccontainerhelper\0037f099-fb9e-4dc5-9004-4149dd1b21ca\Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
Analyzing: Evolve iMS Ltd._iMS Finance Tools Tests_17.0.0.0.app
Using affixes: iMS
Downloading d:\bccontainerhelper\da7b96f6-d3a8-4744-85dd-3b29b7173b29\appsource.default.ruleset.json
AppSourceCop.json content:
{
    "mandatoryAffixes":  [
                             "iMS"
                         ]
}
Ruleset.json content:
{
    "name":  "Run-AlCops RuleSet",
    "description":  "Generated by Run-AlCops",
    "includedRuleSets":  [
                             {
                                 "path":  "C:\\ProgramData\\BcContainerHelper\\da7b96f6-d3a8-4744-85dd-3b29b7173b29\\appsource.default.ruleset.json",
                                 "action":  "Default"
                             }
                         ]
}
Using Symbols Folder: d:\bccontainerhelper\e3e6af8a-7245-4802-91ef-65cd29262c26
Copying System.app from Container
Copying Microsoft_Application_17.0.17126.22050.app from Container
Copying Microsoft_Base Application_17.0.17126.22050.app from Container
Copying Microsoft_System Application_17.0.17126.22050.app from Container
Downloading symbols: Microsoft_Library Assert_17.0.0.0.app
Url : http://172.27.192.129:7049/BC/dev/packages?publisher=Microsoft&appName=Library Assert&versionText=17.0.0.0&tenant=default
Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )
at Compile-AppInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Compile-AppInNavContainer.ps1: line 366
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 68
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 212
at Run-AlCops, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlCops.ps1: line 112
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 495
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 478
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 393
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 367
at Run-AlValidation, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.5\AppHandling\Run-AlValidation.ps1: line 365
at <ScriptBlock>, D:\Repos\evolveims\FinTools\scripts\Al-validation.ps1: line 48

  _____                           _                _____            _        _                 
 |  __ \                         (_)              / ____|          | |      (_)                
 | |__) |___ _ __ ___   _____   ___ _ __   __ _  | |     ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
 |  _  // _ \ '_ ` _ \ / _ \ \ / / | '_ \ / _` | | |    / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | | \ \  __/ | | | | | (_) \ V /| | | | | (_| | | |____ (_) | | | | |_ (_| | | | | |  __/ |   
 |_|  \_\___|_| |_| |_|\___/ \_/ |_|_| |_|\__, |  \_____\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
                                           __/ |                                               
                                          |___/                                                

Removing container bcserver
Removing bcserver from host hosts file
Removing bcserver-* from host hosts file
Removing d:\bccontainerhelper\Extensions\bcserver

Removing container took 8 seconds

AL Validation finished in 1186 seconds
 __      __   _ _     _       _   _               _____                _ _       
 \ \    / /  | (_)   | |     | | (_)             |  __ \              | | |      
  \ \  / /_ _| |_  __| | __ _| |_ _  ___  _ __   | |__) |___ ___ _   _| | |_ ___ 
   \ \/ / _` | | |/ _` |/ _` | __| |/ _ \| '_ \  |  _  // _ \ __| | | | | __/ __|
    \  / (_| | | | (_| | (_| | |_| | (_) | | | | | | \ \  __\__ \ |_| | | |_\__ \
     \/ \__,_|_|_|\__,_|\__,_|\__|_|\___/|_| |_| |_|  \_\___|___/\__,_|_|\__|___/

Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )
Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )
  _____                          ___      __   _ _     _       _   _               ______    _ _                
 |  __ \                   /\   | \ \    / /  | (_)   | |     | | (_)             |  ____|  (_) |               
 | |__) |   _ _ __ ______ /  \  | |\ \  / /_ _| |_  __| | __ _| |_ _  ___  _ __   | |__ __ _ _| |_   _ _ __ ___ 
 |  _  / | | | '_ \______/ /\ \ | | \ \/ / _` | | |/ _` |/ _` | __| |/ _ \| '_ \  |  __/ _` | | | | | | '__/ _ \
 | | \ \ |_| | | | |    / ____ \| |  \  / (_| | | | (_| | (_| | |_| | (_) | | | | | | | (_| | | | |_| | | |  __/
 |_|  \_\__,_|_| |_|   /_/    \_\_|   \/ \__,_|_|_|\__,_|\__,_|\__|_|\___/|_| |_| |_|  \__,_|_|_|\__,_|_|  \___|

Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )
Unexpected error while validating app. Error is: The remote server returned an error: (404) Not Found. No published package matches the provided arguments. (ms-correlation-x =
 )

PS D:\Repos\evolveims\FinTools\scripts> 

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

Additional context

Full output of scripts

NavContainerHelper is version 0.6.5.7
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 2004
Docker Client Version is 19.03.8
Docker Server Version is 19.03.8
...

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

Additional context

freddydk commented 3 years ago

My assumption is that the problem is in your network, I see it very very seldom in my pipelines. AzureEdge is a CDN, from which downloading is much faster than directly from the blob storage. I don't know why it sometimes fails, but I added the retry in order to make sure that the entire pipeline doesn't fail due to a CDN download fail - and when it retries, it retries from the blob storage. It would be fairly simple to add one retry from the CDN before reverting to blob storage - not sure whether that would take more time though. If you want to test whether a second download from CDN works, you can modify this line: https://github.com/microsoft/navcontainerhelper/blob/7cb1bf561c6dfe8f68a9430256f36cfdaf816748/Misc/Download-File.ps1#L66 to just use $sourceUrl instead of $newSourceUrl - then it would retry from CDN Let me know if that works?

freddydk commented 3 years ago

I see failures when downloading from CDN once a week (after looking at logs) and from looking at other issues with people downloading from CDN, an immediate retry from CDN is not a solution.

I do realize that this problem might be more outspoken on some networks, but it isn't something I can fix, the problem is in your network or on your machine.'

If you want to avoid the retry and always just go for the blob download, you can set the fully qualified storage account when getting the artifact url:

Get-BCArtifactUrl -storageAccount 'bcartifacts.blob.core.windows.net' -country us

Then it will not retry, but it will download from blob storage directly, which is somewhat slower than CDN.