microsoft / navcontainerhelper

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

Initialization of container $containername failed #3202

Closed walkerjono closed 1 year ago

walkerjono commented 1 year ago

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

Describe the issue I have an Azure DevOps pipeline that has been running happily. It uses a mixture of https://github.com/kine/NVRAppDevOps and navcontainerhelper Powershell commands, and runs on a hosted agent only.

One of the team notified me that builds started failing on 2023-10-02, we quickly identified that the BC license had expired the previous day. The license was renewed and updated in the pipeline, however builds continued to fail when creating the docker container.

Through much trial and error, I think something has changed in the underlying BC artifact that is causing the build to fail when creating the docker container.

I say this as I can replicate and workaround the issue by running the exact same build, but pinning the build to a specific BC Artifact version that was working as of Friday 29 September, and it will create the docker container and compile the extension successfully. If I take the latest v22.x BC artifact it will fail when creating the docker container, with nothing else changed.

Pinned Version (docker container created and compiles successfully) Get-BCArtifactUrl -country nz -version 22.5.59966.60900

... 10 other versions ...

Latest v22.x Version (docker container creation fails) Get-BCArtifactUrl -country nz -version 22

Based on the above, the only things that have changed are:

  1. The renewed license file, however the build succeeds with this license fail and pinned -version 22.5.59966.60900
  2. The updated BC Artifact (22.5.59966.61037) returned by -version 22

If you need further information or would like me to re-attempt any builds, please let me know and I'd be happy to provide the info. Thank you!   Scripts used to create container and cause the issue I understand that the following is an abstraction over New-NavContainer using NVRAppDevOps . If required, I can convert this to the actual New-NavContainer command, however, I don't see how this would make a difference, but I'd be happy to attempt it if you think it would be helpful?

  # the following is set in a previous DevOps task and used when creating the docker container using the command below.
  $artifactURL = Get-BCArtifactUrl -country nz -version 22

  # Create Docker container
  # https://github.com/kine/navertical_tasks/blob/master/createdockerTask/v5/task.json
  # https://github.com/microsoft/navcontainerhelper/blob/master/ContainerHandling/New-NavContainer.ps1
  - task: CreateBCContainer@5
    displayName: Create Docker Container
    inputs:
      containername: devtest
      ram: ${{ parameters.ram }}
      auth: NavUserPassword
      username: ${{ parameters.userName }}
      password: ${{ parameters.password }}
      artifactUrl: $(artifactURL)
      licensefile: $(Build.SourcesDirectory)\${{ parameters.buildTemplatePath }}\${{ parameters.licenseFilename }}
      includeCSide: false
      alwaysPull: true

Full output of scripts

Pinned Version (docker container created and compiles successfully) Get-BCArtifactUrl -country nz -version 22.5.59966.60900

2023-10-04T11:53:42.0920195Z ##[section]Starting: Create Docker Container
2023-10-04T11:53:42.1052849Z ==============================================================================
2023-10-04T11:53:42.1053017Z Task         : Business Central - Create docker container
2023-10-04T11:53:42.1053098Z Description  : Create container for Dynamics 365 Business Central
2023-10-04T11:53:42.1053190Z Version      : 5.7.0
2023-10-04T11:53:42.1053248Z Author       : Kine
2023-10-04T11:53:42.1053325Z Help         : 
2023-10-04T11:53:42.1053372Z ==============================================================================
2023-10-04T11:53:42.9445236Z Importing module NVRAppDevOps
2023-10-04T11:53:43.0996147Z BcContainerHelper version 5.0.7
2023-10-04T11:53:43.3583211Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2023-10-04T11:53:45.7757517Z WARNING: The names of some imported commands from the module 'BcContainerHelper' include unapproved verbs that might 
2023-10-04T11:53:45.7758566Z make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the 
2023-10-04T11:53:45.7759295Z Verbose parameter. For a list of approved verbs, type Get-Verb.
2023-10-04T11:53:46.0375965Z TF_BUILD set, running under agent, enforcing Build flag
2023-10-04T11:53:46.0385123Z Build is true
2023-10-04T11:53:46.0397807Z Using passed password and NavUserPassword authentication
2023-10-04T11:53:48.1636053Z BcContainerHelper is version 5.0.7
2023-10-04T11:53:48.1646048Z BcContainerHelper is running as administrator
2023-10-04T11:53:49.0712593Z HyperV is Enabled
2023-10-04T11:53:49.0737979Z UsePsSession is True
2023-10-04T11:53:49.0760486Z Host is Microsoft Windows Server 2022 Datacenter - 10.0.20348.1970
2023-10-04T11:53:57.7538902Z Docker Client Version is 24.0.6
2023-10-04T11:53:57.7553013Z Docker Server Version is 24.0.6
2023-10-04T11:53:57.9307732Z Removing Desktop shortcuts
2023-10-04T11:53:58.0678079Z Downloading artifact /sandbox/22.5.59966.60900/nz
2023-10-04T11:53:58.0902614Z Downloading C:\Users\VssAdministrator\AppData\Local\Temp\95772bf1-6fb3-455e-afe5-fb72e0ce1ce3.zip
2023-10-04T11:53:58.1029456Z Downloading using WebClient
2023-10-04T11:59:27.8834858Z Unpacking artifact to tmp folder using 7zip
2023-10-04T11:59:34.8941511Z Downloading platform artifact /sandbox/22.5.59966.60900/platform
2023-10-04T11:59:34.8975450Z Downloading C:\Users\VssAdministrator\AppData\Local\Temp\dd4bf001-7dd1-4fa4-a1d5-2e24e8d47f71.zip
2023-10-04T11:59:34.8982248Z Downloading using WebClient
2023-10-04T12:06:07.9587225Z Unpacking platform artifact to tmp folder using 7zip
2023-10-04T12:06:23.4739391Z Downloading Prerequisite Components
2023-10-04T12:06:23.4893836Z Downloading c:\bcartifacts.cache\sandbox\22.5.59966.60900\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
2023-10-04T12:06:23.4906542Z Downloading using WebClient
2023-10-04T12:06:28.3916761Z Downloading c:\bcartifacts.cache\sandbox\22.5.59966.60900\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
2023-10-04T12:06:28.3926229Z Downloading using WebClient
2023-10-04T12:06:35.7888488Z Fetching all docker images
2023-10-04T12:06:36.0346190Z Fetching all docker volumes
2023-10-04T12:06:38.0714393Z Pulling image mcr.microsoft.com/businesscentral:10.0.20348.1906
2023-10-04T12:06:40.5170883Z 10.0.20348.1906: Pulling from businesscentral
2023-10-04T12:06:40.6970732Z 7c76e5cf7755: Already exists
2023-10-04T12:06:40.9470253Z 22a441455ace: Pulling fs layer
2023-10-04T12:06:40.9481729Z 158b79dd1f5c: Pulling fs layer
2023-10-04T12:06:40.9490526Z c71edc7a1547: Pulling fs layer
2023-10-04T12:06:40.9499410Z 59f7350c856c: Pulling fs layer
2023-10-04T12:06:40.9507367Z 92e0d318a35c: Pulling fs layer
2023-10-04T12:06:40.9516256Z ef485af973c3: Pulling fs layer
2023-10-04T12:06:40.9524529Z 4e1d5c6ee165: Pulling fs layer
2023-10-04T12:06:40.9533090Z 84de218c9f9a: Pulling fs layer
2023-10-04T12:06:40.9541564Z c405de89078b: Pulling fs layer
2023-10-04T12:06:40.9549987Z 30628ff07013: Pulling fs layer
2023-10-04T12:06:40.9558405Z e643dd0e14ef: Pulling fs layer
2023-10-04T12:06:40.9566732Z cdb4f9bf9ab7: Pulling fs layer
2023-10-04T12:06:40.9575014Z df69cf8627e5: Pulling fs layer
2023-10-04T12:06:40.9583158Z 9857d2162923: Pulling fs layer
2023-10-04T12:06:40.9639107Z 84de218c9f9a: Waiting
2023-10-04T12:06:40.9648234Z c405de89078b: Waiting
2023-10-04T12:06:40.9658995Z 30628ff07013: Waiting
2023-10-04T12:06:40.9667398Z cdb4f9bf9ab7: Waiting
2023-10-04T12:06:40.9678910Z df69cf8627e5: Waiting
2023-10-04T12:06:40.9684219Z 9857d2162923: Waiting
2023-10-04T12:06:40.9695202Z e643dd0e14ef: Waiting
2023-10-04T12:06:40.9701541Z 59f7350c856c: Waiting
2023-10-04T12:06:40.9736437Z 92e0d318a35c: Waiting
2023-10-04T12:06:40.9744610Z ef485af973c3: Waiting
2023-10-04T12:06:40.9753457Z 4e1d5c6ee165: Waiting
2023-10-04T12:06:41.1655166Z 158b79dd1f5c: Verifying Checksum
2023-10-04T12:06:41.1666061Z 158b79dd1f5c: Download complete
2023-10-04T12:06:41.3462167Z 59f7350c856c: Verifying Checksum
2023-10-04T12:06:41.3501230Z 59f7350c856c: Download complete
2023-10-04T12:06:41.6421178Z 92e0d318a35c: Verifying Checksum
2023-10-04T12:06:41.6430840Z 92e0d318a35c: Download complete
2023-10-04T12:06:41.7524749Z c71edc7a1547: Verifying Checksum
2023-10-04T12:06:41.7535110Z c71edc7a1547: Download complete
2023-10-04T12:06:41.8041126Z ef485af973c3: Verifying Checksum
2023-10-04T12:06:41.8080414Z ef485af973c3: Download complete
2023-10-04T12:06:41.9732830Z 4e1d5c6ee165: Verifying Checksum
2023-10-04T12:06:41.9741871Z 4e1d5c6ee165: Download complete
2023-10-04T12:06:42.1925898Z c405de89078b: Verifying Checksum
2023-10-04T12:06:42.1937972Z c405de89078b: Download complete
2023-10-04T12:06:44.7451667Z 22a441455ace: Verifying Checksum
2023-10-04T12:06:44.7480731Z 22a441455ace: Download complete
2023-10-04T12:06:45.0721616Z e643dd0e14ef: Verifying Checksum
2023-10-04T12:06:45.0731862Z e643dd0e14ef: Download complete
2023-10-04T12:06:45.3587450Z cdb4f9bf9ab7: Verifying Checksum
2023-10-04T12:06:45.3597164Z cdb4f9bf9ab7: Download complete
2023-10-04T12:06:45.6283705Z df69cf8627e5: Verifying Checksum
2023-10-04T12:06:45.6293303Z df69cf8627e5: Download complete
2023-10-04T12:06:45.7848512Z 9857d2162923: Verifying Checksum
2023-10-04T12:06:45.7858029Z 9857d2162923: Download complete
2023-10-04T12:06:48.7409951Z 30628ff07013: Verifying Checksum
2023-10-04T12:06:48.7421974Z 30628ff07013: Download complete
2023-10-04T12:06:54.8338998Z 84de218c9f9a: Verifying Checksum
2023-10-04T12:06:54.8339532Z 84de218c9f9a: Download complete
2023-10-04T12:10:39.1075217Z 22a441455ace: Pull complete
2023-10-04T12:10:39.4925107Z 158b79dd1f5c: Pull complete
2023-10-04T12:10:44.9141068Z c71edc7a1547: Pull complete
2023-10-04T12:10:45.5154684Z 59f7350c856c: Pull complete
2023-10-04T12:10:45.8428588Z 92e0d318a35c: Pull complete
2023-10-04T12:10:46.1715343Z ef485af973c3: Pull complete
2023-10-04T12:10:46.5098657Z 4e1d5c6ee165: Pull complete
2023-10-04T12:11:35.5539010Z 84de218c9f9a: Pull complete
2023-10-04T12:11:35.9947384Z c405de89078b: Pull complete
2023-10-04T12:12:07.9336441Z 30628ff07013: Pull complete
2023-10-04T12:12:08.2767992Z e643dd0e14ef: Pull complete
2023-10-04T12:12:09.0025553Z cdb4f9bf9ab7: Pull complete
2023-10-04T12:12:09.3581732Z df69cf8627e5: Pull complete
2023-10-04T12:12:09.8263415Z 9857d2162923: Pull complete
2023-10-04T12:12:09.8807335Z Digest: sha256:9a12bd9733c4bd49affddf5a8dbc0bf408551b50eb4a85a8f60efab4301184f4
2023-10-04T12:12:09.8843015Z Status: Downloaded newer image for mcr.microsoft.com/businesscentral:10.0.20348.1906
2023-10-04T12:12:09.9028097Z mcr.microsoft.com/businesscentral:10.0.20348.1906
2023-10-04T12:12:10.2788530Z Using image mcr.microsoft.com/businesscentral:10.0.20348.1906
2023-10-04T12:12:13.8384453Z Creating Container devtest
2023-10-04T12:12:13.8396893Z Style: sandbox
2023-10-04T12:12:13.8404782Z Multitenant: Yes
2023-10-04T12:12:13.8418491Z Version: 22.5.59966.60900
2023-10-04T12:12:13.8426877Z Platform: 22.0.60864.0
2023-10-04T12:12:13.9182558Z Generic Tag: 1.0.2.14
2023-10-04T12:12:13.9218166Z Container OS Version: 10.0.20348.1906 (ltsc2022)
2023-10-04T12:12:13.9225633Z Host OS Version: 10.0.20348.1970 (ltsc2022)
2023-10-04T12:12:14.0682879Z Using process isolation
2023-10-04T12:12:14.2605553Z Using locale en-NZ
2023-10-04T12:12:14.5095655Z Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
2023-10-04T12:12:14.6803436Z Using license file D:\a\1\s\buildtemplates\_current.bclicense
2023-10-04T12:12:14.8619672Z Additional Parameters:
2023-10-04T12:12:14.9595415Z --volume "D:\a\1:C:\app"
2023-10-04T12:12:14.9610411Z -e CustomNavSettings=ServicesUseNTLMAuthentication=true
2023-10-04T12:12:14.9619506Z --env useSSL=N
2023-10-04T12:12:14.9626680Z Files in C:\ProgramData\BcContainerHelper\Extensions\devtest\my:
2023-10-04T12:12:14.9937581Z - AdditionalOutput.ps1
2023-10-04T12:12:14.9953324Z - license.bclicense
2023-10-04T12:12:14.9955468Z - MainLoop.ps1
2023-10-04T12:12:14.9965585Z - SetupNavUsers.ps1
2023-10-04T12:12:14.9973787Z - SetupVariables.ps1
2023-10-04T12:12:14.9982143Z - updatehosts.ps1
2023-10-04T12:12:14.9990118Z Creating container devtest from image mcr.microsoft.com/businesscentral:10.0.20348.1906
2023-10-04T12:12:16.8334976Z 2a7af7ff272642ed8852b82b76c78ce231276e511a220afc9b5252912a881463
2023-10-04T12:12:32.3335362Z Waiting for container devtest to be ready
2023-10-04T12:12:45.9989720Z Using artifactUrl https://bcartifacts.azureedge.net/sandbox/22.5.59966.60900/nz
2023-10-04T12:12:45.9990069Z Using installer from C:\Run\210-new
2023-10-04T12:12:45.9992005Z Installing Business Central
2023-10-04T12:12:45.9992256Z Installing from artifacts
2023-10-04T12:12:52.7647815Z Starting Local SQL Server
2023-10-04T12:12:52.7648769Z WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
2023-10-04T12:12:52.7649497Z start...
2023-10-04T12:12:55.7082922Z Starting Internet Information Server
2023-10-04T12:12:55.7083174Z Copying Service Tier Files
2023-10-04T12:12:58.5276904Z c:\dl\sandbox\22.5.59966.60900\platform\ServiceTier\Program Files
2023-10-04T12:12:58.5277350Z c:\dl\sandbox\22.5.59966.60900\platform\ServiceTier\System64Folder
2023-10-04T12:12:58.5277517Z Copying PowerShell Scripts
2023-10-04T12:12:58.5283907Z c:\dl\sandbox\22.5.59966.60900\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
2023-10-04T12:12:58.5284326Z c:\dl\sandbox\22.5.59966.60900\platform\WindowsPowerShellScripts\WebSearch
2023-10-04T12:12:58.5284495Z Copying Web Client Files
2023-10-04T12:13:02.3935856Z c:\dl\sandbox\22.5.59966.60900\platform\WebClient\Microsoft Dynamics NAV
2023-10-04T12:13:02.3936856Z Copying ModernDev Files
2023-10-04T12:13:02.3947245Z c:\dl\sandbox\22.5.59966.60900\platform
2023-10-04T12:13:10.2660942Z c:\dl\sandbox\22.5.59966.60900\platform\ModernDev\program files\Microsoft Dynamics NAV
2023-10-04T12:13:10.2661679Z Copying additional files
2023-10-04T12:13:10.2662160Z Copying ConfigurationPackages
2023-10-04T12:13:10.2662521Z C:\dl\sandbox\22.5.59966.60900\nz\ConfigurationPackages
2023-10-04T12:13:10.2662962Z Copying Test Assemblies
2023-10-04T12:13:10.2663322Z C:\dl\sandbox\22.5.59966.60900\platform\Test Assemblies
2023-10-04T12:13:10.2663893Z Copying Extensions
2023-10-04T12:13:10.2664366Z C:\dl\sandbox\22.5.59966.60900\nz\Extensions
2023-10-04T12:13:10.2669134Z Copying Applications
2023-10-04T12:13:10.2670205Z C:\dl\sandbox\22.5.59966.60900\platform\Applications
2023-10-04T12:13:10.2670759Z Copying Applications.NZ
2023-10-04T12:13:10.2672018Z C:\dl\sandbox\22.5.59966.60900\nz\Applications.NZ
2023-10-04T12:13:10.2678403Z Copying dependencies
2023-10-04T12:13:25.5406700Z Copying ReportBuilder
2023-10-04T12:13:28.8659970Z Importing PowerShell Modules
2023-10-04T12:13:37.2019226Z Restoring CRONUS Demo Database
2023-10-04T12:13:38.2480009Z Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
2023-10-04T12:14:08.9770087Z Exporting Application to CRONUS
2023-10-04T12:14:15.3504643Z Removing Application from tenant
2023-10-04T12:14:15.3505859Z Modifying Business Central Service Tier Config File for Docker
2023-10-04T12:14:15.3523229Z Creating Business Central Service Tier
2023-10-04T12:14:15.3524336Z Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
2023-10-04T12:14:25.6583998Z Starting Business Central Service Tier
2023-10-04T12:14:25.6591009Z Importing license file
2023-10-04T12:14:25.6591290Z Copying Database on localhost\SQLEXPRESS from tenant to default
2023-10-04T12:14:25.6591456Z Taking database tenant offline
2023-10-04T12:14:38.0576276Z Copying database files
2023-10-04T12:14:38.0577012Z Attaching files as new Database default
2023-10-04T12:14:38.0577506Z Putting database tenant back online
2023-10-04T12:14:38.0577986Z Mounting tenant database
2023-10-04T12:15:58.7134153Z Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
2023-10-04T12:16:01.2796132Z Sync'ing Tenant
2023-10-04T12:16:01.2796607Z Tenant is Operational
2023-10-04T12:16:01.2796802Z Stopping Business Central Service Tier
2023-10-04T12:16:01.2797009Z Installation took 195 seconds
2023-10-04T12:16:01.2801741Z Installation complete
2023-10-04T12:16:02.4834354Z Initializing...
2023-10-04T12:16:02.4835145Z Setting host.containerhelper.internal to 172.25.80.1 in container hosts file
2023-10-04T12:16:02.4835838Z Starting Container
2023-10-04T12:16:02.4836308Z Hostname is devtest
2023-10-04T12:16:03.6099626Z PublicDnsName is devtest
2023-10-04T12:16:03.6099971Z Using NavUserPassword Authentication
2023-10-04T12:16:07.4967297Z Creating Self Signed Certificate
2023-10-04T12:16:07.4967743Z Self Signed Certificate Thumbprint EC41AF7579463ADE08BBC6C948C2C269D2E53B5F
2023-10-04T12:16:07.4967913Z DNS identity devtest
2023-10-04T12:16:07.4968124Z Modifying Service Tier Config File with Instance Specific Settings
2023-10-04T12:16:07.4968392Z Modifying Service Tier Config File with settings from environment variable
2023-10-04T12:16:09.7728570Z Setting ServicesUseNTLMAuthentication to true
2023-10-04T12:16:15.6007571Z Starting Service Tier
2023-10-04T12:16:15.6008393Z Registering event sources
2023-10-04T12:16:15.6009036Z Creating DotNetCore Web Server Instance
2023-10-04T12:16:17.0749805Z Using application pool name: BC
2023-10-04T12:16:17.0761060Z Using default container name: NavWebApplicationContainer
2023-10-04T12:16:21.5058170Z Copy files to WWW root C:\inetpub\wwwroot\BC
2023-10-04T12:16:25.3421524Z Create the application pool BC
2023-10-04T12:16:30.4039979Z Create website: NavWebApplicationContainer without SSL
2023-10-04T12:16:30.4136801Z Update configuration: navsettings.json
2023-10-04T12:16:30.4137234Z Done Configuring Web Client
2023-10-04T12:16:30.4139536Z Enabling Financials User Experience
2023-10-04T12:16:30.4146264Z Using license file 'c:\run\my\license.bclicense'
2023-10-04T12:16:30.4146796Z Import License
2023-10-04T12:16:30.4166988Z Dismounting Tenant
2023-10-04T12:16:30.4167567Z Mounting Tenant
2023-10-04T12:16:31.6374684Z Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
2023-10-04T12:16:31.6375655Z Sync'ing Tenant
2023-10-04T12:16:33.1234586Z Tenant is Operational
2023-10-04T12:16:33.1235133Z Creating http download site
2023-10-04T12:16:33.1235561Z Setting SA Password and enabling SA
2023-10-04T12:16:37.1667506Z Creating admin as SQL User and add to sysadmin
2023-10-04T12:16:37.1671962Z Creating SUPER user
2023-10-04T12:16:38.7939310Z Assign Premium plan for ADMIN
2023-10-04T12:16:38.7939948Z Container IP Address: 172.25.84.82
2023-10-04T12:16:38.7940623Z Container Hostname  : devtest
2023-10-04T12:16:38.7941066Z Container Dns Name  : devtest
2023-10-04T12:16:38.7941449Z Web Client          : http://devtest/BC/?tenant=default
2023-10-04T12:16:38.7942372Z Dev. Server         : http://devtest
2023-10-04T12:16:38.7942733Z Dev. ServerInstance : BC
2023-10-04T12:16:38.7944861Z Dev. Server Tenant  : default
2023-10-04T12:16:39.9741185Z Setting devtest to 172.25.84.82 in host hosts file
2023-10-04T12:16:39.9748597Z Setting devtest-default to 172.25.84.82 in host hosts file
2023-10-04T12:16:39.9749243Z Setting devtest-default to 172.25.84.82 in container hosts file
2023-10-04T12:16:39.9749335Z 
2023-10-04T12:16:39.9749479Z Files:
2023-10-04T12:16:39.9827006Z http://devtest:8080/ALLanguage.vsix
2023-10-04T12:16:39.9827176Z 
2023-10-04T12:16:39.9827440Z Container Total Physical Memory is 7.0Gb
2023-10-04T12:16:39.9827728Z Container Free Physical Memory is 1.8Gb
2023-10-04T12:16:39.9827800Z 
2023-10-04T12:16:39.9827917Z Initialization took 39 seconds
2023-10-04T12:16:39.9828091Z Ready for connections!
2023-10-04T12:16:42.4145290Z Reading CustomSettings.config from devtest
2023-10-04T12:16:43.0244710Z Cleanup old dotnet core assemblies
2023-10-04T12:16:44.0630371Z Container devtest successfully created
2023-10-04T12:16:44.1862651Z 
2023-10-04T12:16:44.1871510Z Use:
2023-10-04T12:16:44.1890405Z Get-BcContainerEventLog -containerName devtest to retrieve a snapshot of the event log from the container
2023-10-04T12:16:44.1904879Z Get-BcContainerDebugInfo -containerName devtest to get debug information about the container
2023-10-04T12:16:44.1918789Z Enter-BcContainer -containerName devtest to open a PowerShell prompt inside the container
2023-10-04T12:16:44.1937139Z Remove-BcContainer -containerName devtest to remove the container again
2023-10-04T12:16:44.1950907Z docker logs devtest to retrieve information about URL's again
2023-10-04T12:16:45.5339579Z ##[section]Finishing: Create Docker Container

Latest v22.x Version (docker container creation fails) Get-BCArtifactUrl -country nz -version 22

Additional context

freddydk commented 1 year ago

Could you use Get-BcContainerEventLog to see if the event log reveals any reason why BC cannot import the license? (I do think importing the license is the problem and maybe the servicetier crashes as a result of this - testing myself now)

freddydk commented 1 year ago

Tested the version you have above and my license works fine. Need the eventlog to continue, thanks

walkerjono commented 1 year ago

Thanks very much for the quick reply.

I've actually never retrieved the event log from the docker container in an Azure DevOps pipeline. I've successfully added the additional task to call the Get-BcContainerEventLog, but realised that the event log is in .evtx format (after reading the docs)

If you can point me in the right direction to retrieve the contents of the event log from the pipeline that would be very much appreciated. If not, I understand and will continue to figure it out and revert back.

Thanks again

freddydk commented 1 year ago

Can't you publish the .evtx file as an artifact and download it from Azure DevOps? You might also be able to add -dumpEventLog to your New-BcContainer and then use docker logs containername to get the logs - which should include the eventlog then.

freddydk commented 1 year ago

This is a bug in the Service Tier, due to this setting: -e CustomNavSettings=ServicesUseNTLMAuthentication=true

What is the reason for that setting?

walkerjono commented 1 year ago

Thanks very much.

That setting is set by:

Why, I'm unsure. I'll raise it with the developer of the library.

I'll also switch the container creation to use the New-NavContainer without the NVRAppDevOps abstraction and report back.

Thanks again for your assistance

kine commented 1 year ago

Thanks for the info, I was just looking into this yesterday and today and I am lucky I found this Issue. Code in NVRAppDevOps was adjusted and this parameter is no longer used by default in v2.4.0.

walkerjono commented 1 year ago

Amazing, thanks for the updated library @kine .

I've successfully re-run my pipeline with the update libarary and the previously failing artifact now passes:

thanks very much for the assistance guys, its much appreciated!