HodorNV / ALOps

ALOps
59 stars 24 forks source link

re-exec error: exit status 1: output: hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3) #636

Closed Arthurvdv closed 1 year ago

Arthurvdv commented 1 year ago

Describe the bug When creating a the Docker container it sometimes throws this error. When I rerun the pipeline for a second time on exact the same BuildServer a few minutes later, it doesn't throw an error :-|

Not sure if this is a Docker, Security software, BcContainerHelper or ALOps issue, so I though I'll start here.

the used yaml please provide the yaml that you used. It helps you put the yaml like this:

  parameters:
    artifacttype: 'Sandbox'
    artifactversion: ''
    artifactcountry: 'BE'
    licensefile: '<redacted>'
    versionselect: 'Daily'
    includetesttoolkit: true
    includetestframeworkonly: true

  - task: ALOpsDockerCreate@1
    displayName: 'Create Docker Image'
    inputs:
      artifacttype: ${{ parameters.artifacttype }}
      artifactversion: ${{ parameters.artifactversion }}
      artifactcountry: ${{ parameters.artifactcountry }}
      versionselect: '$(appcompiler-versionselect)'
      includetesttoolkit: ${{ parameters.includetesttoolkit }}
      includetestframeworkonly: ${{ parameters.includetestframeworkonly }}
      licensefile: ${{ parameters.licensefile }}

the output Also the complete output is necessary for us to see what is going on. Also use backtics:

2023-05-11T15:03:02.5697103Z ##[section]Starting: Create Docker Image
2023-05-11T15:03:02.5888939Z ==============================================================================
2023-05-11T15:03:02.5889037Z Task         : ALOps Docker Create
2023-05-11T15:03:02.5889082Z Description  : Create Docker image from Business Central Artifacts
2023-05-11T15:03:02.5889143Z Version      : 1.455.3607
2023-05-11T15:03:02.5889184Z Author       : Hodor
2023-05-11T15:03:02.5889227Z Help         : Create Docker image based on NAV/BC Artifacts.
2023-05-11T15:03:02.5889277Z ==============================================================================
2023-05-11T15:03:04.3409070Z *** Validate configuration
2023-05-11T15:03:04.4826474Z *** Task Inputs:
2023-05-11T15:03:04.4880181Z 
2023-05-11T15:03:04.4957144Z name                      value                                                                                        
2023-05-11T15:03:04.4959689Z ----                      -----                                                                                        
2023-05-11T15:03:04.4959871Z artifactspecification     Specific                                                                                     
2023-05-11T15:03:04.4959979Z artifactversion                                                                                                        
2023-05-11T15:03:04.4961246Z artifacttype              Sandbox                                                                                      
2023-05-11T15:03:04.4961791Z artifactcountry           BE                                                                                           
2023-05-11T15:03:04.4962404Z versionselect             Daily                                                                                        
2023-05-11T15:03:04.4964200Z artifacthint                                                                                                           
2023-05-11T15:03:04.4964961Z multitenant               False                                                                                        
2023-05-11T15:03:04.4965391Z memory                    8G                                                                                           
2023-05-11T15:03:04.4967495Z imageprefix               myImage                                                                                      
2023-05-11T15:03:04.4967634Z dockerregistry                                                                                                         
2023-05-11T15:03:04.4967975Z dockerusername                                                                                                         
2023-05-11T15:03:04.4969086Z dockerpassword                                                                                                         
2023-05-11T15:03:04.4970420Z storageaccount                                                                                                         
2023-05-11T15:03:04.4971761Z sastoken                                                                                                               
2023-05-11T15:03:04.4973086Z forcecreateimage          False                                                                                        
2023-05-11T15:03:04.4974401Z myscripts                                                                                                              
2023-05-11T15:03:04.4975897Z imagenametemplate         %IMAGE_PREFIX%:%ARTIFACT_TYPE%-%ARTIFACT_VERSION%-%ARTIFACT_COUNTRY%-%OS_VERSION%-%OS_LTSC%  
2023-05-11T15:03:04.4985975Z licensefile               https://vrabadevops.blob.core.windows.net/default/bc-vanroey-dev-license.bclicense?sp=r&st...
2023-05-11T15:03:04.4986654Z includetesttoolkit        True                                                                                         
2023-05-11T15:03:04.4987249Z includetestlibrariesonly  False                                                                                        
2023-05-11T15:03:04.4987830Z includetestframeworkonly  True                                                                                         
2023-05-11T15:03:04.4988934Z includeperformancetoolkit False                                                                                        
2023-05-11T15:03:04.4988981Z 
2023-05-11T15:03:04.5001869Z 
2023-05-11T15:03:04.5012183Z 
2023-05-11T15:03:04.5144994Z *** For documentation, please visit   : https://www.alops.be/documentation
2023-05-11T15:03:04.5153910Z 
2023-05-11T15:03:05.0140507Z *** ALOps License:
2023-05-11T15:03:05.0157853Z   * Licensed To: Van Roey (Collection License)
2023-05-11T15:03:05.0167347Z 
2023-05-11T15:03:05.0337296Z *** Importing required PS-Functions
2023-05-11T15:03:05.0624781Z *** Install/Update BCContainerHelper [https://github.com/microsoft/navcontainerhelper]
2023-05-11T15:03:05.0664828Z *** Check BcContainerHelper
2023-05-11T15:03:05.1029601Z *** Load BcContainerHelper
2023-05-11T15:03:05.1922711Z BcContainerHelper version 5.0.1
2023-05-11T15:03:05.3743541Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2023-05-11T15:03:08.0362206Z 
2023-05-11T15:03:08.0362799Z ModuleType Version    Name                                ExportedCommands                                             
2023-05-11T15:03:08.0363443Z ---------- -------    ----                                ----------------                                             
2023-05-11T15:03:08.0363685Z Script     5.0.1      BcContainerHelper                   {Add-FontsToBcContainer, Add-GitToAlProjectFolder, AddTele...
2023-05-11T15:03:08.0363769Z 
2023-05-11T15:03:08.0363798Z 
2023-05-11T15:03:08.0363832Z 
2023-05-11T15:03:08.0372758Z 
2023-05-11T15:03:08.0402172Z *** Get Artifact Url for Version [] / Country [BE] / Type [Sandbox]: Daily
2023-05-11T15:03:08.0469941Z ##[command]"Get-BCArtifactUrl" 
2023-05-11T15:03:08.0470151Z Name                           Value                                                                                   
2023-05-11T15:03:08.0470403Z ----                           -----                                                                                   
2023-05-11T15:03:08.0470508Z select                         Daily                                                                                   
2023-05-11T15:03:08.0470834Z type                           Sandbox                                                                                 
2023-05-11T15:03:08.0471113Z country                        be                                                                                      
2023-05-11T15:03:08.0471157Z 
2023-05-11T15:03:08.0471186Z 
2023-05-11T15:03:08.0471223Z 
2023-05-11T15:03:25.3940059Z *** Artifact Url: [https://bcartifacts.azureedge.net/sandbox/22.1.55890.56507/be]
2023-05-11T15:03:25.3951180Z *** Build new Image based on [https://bcartifacts.azureedge.net/sandbox/22.1.55890.56507/be]
2023-05-11T15:03:25.3984280Z *** Artifact Type   : [sandbox]
2023-05-11T15:03:25.3994945Z *** Artifact Version: [22.1.55890.56507]
2023-05-11T15:03:25.4003647Z *** Artifact Country: [be]
2023-05-11T15:03:25.4791343Z *** OS: [2022]
2023-05-11T15:03:26.1278742Z *** OS version: [10.0.20348.1668]
2023-05-11T15:03:26.1290773Z *** Image Template: [%IMAGE_PREFIX%:%ARTIFACT_TYPE%-%ARTIFACT_VERSION%-%ARTIFACT_COUNTRY%-%OS_VERSION%-%OS_LTSC%]
2023-05-11T15:03:26.1319177Z *** ImageName: [myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022]
2023-05-11T15:03:26.1345762Z *** Set Pipeline variable $(ALOPS_BC_IMAGE) = 'myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022'
2023-05-11T15:03:26.1852212Z Error: No such image: myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022
2023-05-11T15:03:26.1908017Z *** No 'MyScripts' specified, skipping parse.
2023-05-11T15:03:26.1924041Z *** Create Image: myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022
2023-05-11T15:03:26.1956062Z ##[command]"New-BcImage" 
2023-05-11T15:03:26.1956215Z Name                           Value                                                                                   
2023-05-11T15:03:26.1957096Z ----                           -----                                                                                   
2023-05-11T15:03:26.1957206Z includePerformanceToolkit      False                                                                                   
2023-05-11T15:03:26.1957331Z artifactUrl                    https://bcartifacts.azureedge.net/sandbox/22.1.55890.56507/be                           
2023-05-11T15:03:26.1957544Z licenseFile                    https://vrabadevops.blob.core.windows.net/default/bc-vanroey-dev-license.bclicense?sp...
2023-05-11T15:03:26.1957674Z includeTestToolkit             True                                                                                    
2023-05-11T15:03:26.1957779Z memory                         8G                                                                                      
2023-05-11T15:03:26.1957878Z includeTestFrameworkOnly       True                                                                                    
2023-05-11T15:03:26.1957987Z multitenant                    False                                                                                   
2023-05-11T15:03:26.1958187Z imageName                      myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022                            
2023-05-11T15:03:26.1958321Z includeTestLibrariesOnly       False                                                                                   
2023-05-11T15:03:26.1958370Z 
2023-05-11T15:03:26.1958399Z 
2023-05-11T15:03:26.1958425Z 
2023-05-11T15:03:26.5340634Z Downloading application artifact /sandbox/22.1.55890.56507/be
2023-05-11T15:03:26.5437665Z Downloading C:\Windows\TEMP\6f9f1423-6754-4755-a153-8605551dfba4.zip
2023-05-11T15:03:26.5485440Z Downloading using WebClient
2023-05-11T15:03:52.8946345Z Unpacking application artifact to tmp folder using Expand-Archive
2023-05-11T15:04:01.4720004Z Building image myimage:sandbox-22.1.55890.56507-be-10.0.20348.1668-ltsc2022 based on mcr.microsoft.com/businesscentral:10.0.20348.1668 with https://bcartifacts.azureedge.net/sandbox/22.1.55890.56507/be
2023-05-11T15:04:01.4732098Z Pulling latest image mcr.microsoft.com/businesscentral:10.0.20348.1668
2023-05-11T15:04:01.7923266Z 10.0.20348.1668: Pulling from businesscentral
2023-05-11T15:04:01.7942566Z Digest: sha256:c0e1897fb708f9372d0314b8f4ec26bdb8421ba68df1925e8845286b96a1d3d0
2023-05-11T15:04:01.8631468Z Generic Tag: 1.0.2.14
2023-05-11T15:04:01.9216704Z Container OS Version: 10.0.20348.1668 (ltsc2022)
2023-05-11T15:04:01.9225919Z Host OS Version: 10.0.20348.1668 (ltsc2022)
2023-05-11T15:04:01.9239293Z Using process isolation
2023-05-11T15:04:01.9304221Z Using license file https://vrabadevops.blob.core.windows.net/default/bc-vanroey-dev-license.bclicense
2023-05-11T15:04:01.9370725Z Downloading c:\bcartifacts.cache\hwy5pwld.jqb\my\license.bclicense
2023-05-11T15:04:01.9386372Z Downloading using WebClient
2023-05-11T15:04:02.2291792Z Files in c:\bcartifacts.cache\hwy5pwld.jqb\my:
2023-05-11T15:04:02.2372415Z - license.bclicense
2023-05-11T15:04:02.2414833Z Copying Platform Artifacts
2023-05-11T15:04:02.2438675Z c:\bcartifacts.cache\sandbox\22.1.55890.56507\platform
2023-05-11T15:04:12.1576213Z Copying Database
2023-05-11T15:04:12.4024408Z Copying Licensefile
2023-05-11T15:04:12.4185580Z Copying ConfigurationPackages
2023-05-11T15:04:12.4203867Z C:\bcartifacts.cache\sandbox\22.1.55890.56507\be\ConfigurationPackages
2023-05-11T15:04:12.5008840Z Copying Extensions
2023-05-11T15:04:12.5034043Z C:\bcartifacts.cache\sandbox\22.1.55890.56507\be\Extensions
2023-05-11T15:04:12.7354854Z Copying Applications.BE
2023-05-11T15:04:12.7371858Z C:\bcartifacts.cache\sandbox\22.1.55890.56507\be\Applications.BE
2023-05-11T15:04:13.2741348Z c:\bcartifacts.cache\hwy5pwld.jqb
2023-05-11T15:04:32.2849349Z Sending build context to Docker daemon  2.557GB
2023-05-11T15:04:32.2869805Z 
2023-05-11T15:04:32.3831656Z Step 1/6 : FROM mcr.microsoft.com/businesscentral:10.0.20348.1668
2023-05-11T15:04:32.3850598Z  ---> 8e310f667bf7
2023-05-11T15:04:32.3868953Z Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=Y artifactUrl=https://bcartifacts.azureedge.net/sandbox/22.1.55890.56507/be filesOnly=False
2023-05-11T15:04:32.9384225Z  ---> Running in 833eeb10e98a
2023-05-11T15:04:33.8139345Z Removing intermediate container 833eeb10e98a
2023-05-11T15:04:33.8158951Z  ---> 80868a46a6b8
2023-05-11T15:04:33.8199640Z Step 3/6 : COPY my /run/
2023-05-11T15:04:34.2235988Z  ---> 577628ef9898
2023-05-11T15:04:34.2255592Z Step 4/6 : COPY NAVDVD /NAVDVD/
2023-05-11T15:05:38.1560178Z  ---> 5fa9ef24a81f
2023-05-11T15:05:38.1579480Z Step 5/6 : RUN \Run\start.ps1 -installOnly -includeTestToolkit -includeTestFrameworkOnly
2023-05-11T15:05:38.2261025Z  ---> Running in d2fcf9acb1a7
2023-05-11T15:05:41.1216587Z c:\run\my folder doesn't exist, creating it
2023-05-11T15:05:41.3072535Z Using installer from C:\Run\210-new
2023-05-11T15:05:41.6705284Z Installing Business Central
2023-05-11T15:05:41.6771289Z Installing from DVD
2023-05-11T15:05:41.6846889Z Starting Local SQL Server
2023-05-11T15:05:47.9618313Z Starting Internet Information Server
2023-05-11T15:05:48.2903989Z Copying Service Tier Files
2023-05-11T15:05:48.2972149Z C:\NAVDVD\ServiceTier\Program Files
2023-05-11T15:05:49.9627192Z C:\NAVDVD\ServiceTier\System64Folder
2023-05-11T15:05:50.0207031Z Copying PowerShell Scripts
2023-05-11T15:05:50.0230189Z C:\NAVDVD\WindowsPowerShellScripts\Cloud\NAVAdministration
2023-05-11T15:05:50.0535231Z C:\NAVDVD\WindowsPowerShellScripts\WebSearch
2023-05-11T15:05:50.0721531Z Copying Web Client Files
2023-05-11T15:05:50.0745612Z C:\NAVDVD\WebClient\Microsoft Dynamics NAV
2023-05-11T15:05:51.9113928Z Copying ModernDev Files
2023-05-11T15:05:51.9134573Z C:\NAVDVD
2023-05-11T15:05:51.9238000Z C:\NAVDVD\ModernDev\program files\Microsoft Dynamics NAV
2023-05-11T15:05:52.7043003Z Copying additional files
2023-05-11T15:05:52.7103719Z Copying ConfigurationPackages
2023-05-11T15:05:52.7123721Z C:\NAVDVD\ConfigurationPackages
2023-05-11T15:05:52.7405179Z Copying Test Assemblies
2023-05-11T15:05:52.7432211Z C:\NAVDVD\Test Assemblies
2023-05-11T15:05:52.7830902Z Copying Extensions
2023-05-11T15:05:52.7850842Z C:\NAVDVD\Extensions
2023-05-11T15:05:52.9171902Z Copying Applications
2023-05-11T15:05:52.9191749Z C:\NAVDVD\Applications
2023-05-11T15:05:53.6371802Z Copying Applications.BE
2023-05-11T15:05:53.6407839Z C:\NAVDVD\Applications.BE
2023-05-11T15:05:53.9270546Z Copying dependencies
2023-05-11T15:05:53.9468108Z Copying ReportBuilder
2023-05-11T15:06:02.5590248Z Importing PowerShell Modules
2023-05-11T15:06:03.9780804Z Restoring CRONUS Demo Database
2023-05-11T15:06:07.8440902Z Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
2023-05-11T15:06:08.4177043Z Modifying Business Central Service Tier Config File for Docker
2023-05-11T15:06:08.4405008Z Creating Business Central Service Tier
2023-05-11T15:06:08.4766180Z Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
2023-05-11T15:06:08.6711035Z Starting Business Central Service Tier
2023-05-11T15:07:50.2661539Z Importing CRONUS license file
2023-05-11T15:07:51.6716694Z Any is already published
2023-05-11T15:07:51.6735792Z Synchronizing Any
2023-05-11T15:07:52.1539406Z Installing Any
2023-05-11T15:08:04.5719447Z Library Assert is already published
2023-05-11T15:08:04.5737984Z Synchronizing Library Assert
2023-05-11T15:08:04.5979239Z Installing Library Assert
2023-05-11T15:08:04.6910724Z Permissions Mock is already published
2023-05-11T15:08:04.6929658Z Synchronizing Permissions Mock
2023-05-11T15:08:04.7181067Z Installing Permissions Mock
2023-05-11T15:08:04.8144736Z Library Variable Storage is already published
2023-05-11T15:08:04.8163592Z Synchronizing Library Variable Storage
2023-05-11T15:08:04.8417801Z Installing Library Variable Storage
2023-05-11T15:08:04.9392497Z Test Runner is already published
2023-05-11T15:08:04.9412155Z Synchronizing Test Runner
2023-05-11T15:08:05.1245698Z Installing Test Runner
2023-05-11T15:08:05.4781010Z Stopping Business Central Service Tier
2023-05-11T15:08:05.7440623Z Installation took 144 seconds
2023-05-11T15:08:05.7459859Z Installation complete
2023-05-11T15:10:33.2450983Z re-exec error: exit status 1: output: hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)
2023-05-11T15:10:44.8468208Z BcContainerHelper\New-BcImage Telemetry Correlation Id: 6c4baadb-4056-4b82-990e-cf1f230ed974
2023-05-11T15:10:45.0691480Z ##[error]Docker Build failed with exit code 1
2023-05-11T15:10:45.1073422Z ##[section]Finishing: Create Docker Image

Screenshots image

waldo1001 commented 1 year ago

We use BCCH New-BcImage with the provided parameters you seen in the pipeline for creating an image (as we should, since we're dependent from the artifacts).

May be one thing: Did you try to clear all cache?

Arthurvdv commented 1 year ago

Thank you for pointing me in the right direction and looks like this was a Docker issue. In the end needed a docker-ci-zap to resolve the issue.

waldo1001 commented 1 year ago

Ah .. the zap .. nice one! thanks for the feedback!