microsoft / navcontainerhelper

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

File Newtonsoft.Json.dll not found when copying item for OnPrem 6.0.20-preview1216 #3617

Closed FilipSmets closed 2 months ago

FilipSmets commented 2 months ago

When using 6.0.20-preview1216 , our pipeline fails on script CompilerFolderHandling/New-BcCompilerFolder.ps1, line: Copy-Item -Path (Join-Path $testAssembliesFolder 'Newtonsoft.Json.dll') -Destination $testAssembliesDestination -Force because the Path $testAssembliesFolder does not contain the .dll

Code seems pushed with commit: https://github.com/microsoft/navcontainerhelper/commit/480254c917ef58b4f142da0fc0ec72e48c63b131#diff-6abe147c19d8292f1e685a5787a348a02810b2ec6ea29aede3d19b09dffbb26aR134

We do not know if this issue is due to Microsoft removing the .dll from the image or the file was never located in the directory, nevertheless it seems the script could need an update in case the file is not or no longer present.

This happened for following versions we know of:

##[error]Copy-Item : Cannot find path 'C:\bcartifacts.cache\onprem\19.3.34541.35002\platform\Test Assemblies\Newtonsoft.Json.dll
##[error]Copy-Item : Cannot find path 'C:\bcartifacts.cache\onprem\20.3.42673.43026\platform\Test Assemblies\Newtonsoft.Json.dll

raw log (cleaned):

2024-08-13T06:20:12.4151426Z ##[section]Starting: Run Pipeline
2024-08-13T06:20:12.4278010Z ==============================================================================
2024-08-13T06:20:12.4278413Z Task         : PowerShell
2024-08-13T06:20:12.4278584Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-08-13T06:20:12.4278999Z Version      : 2.242.1
2024-08-13T06:20:12.4279132Z Author       : Microsoft Corporation
2024-08-13T06:20:12.4279349Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-08-13T06:20:12.4279837Z ==============================================================================
2024-08-13T06:20:13.4164814Z Generating script.
2024-08-13T06:20:13.4664931Z Formatted command: . 'C:\Agent\_work\32\s\BuildCompileScriptsAppSource\scripts\ShortDevOps-Pipeline.ps1' -version "ci" -appBuild 2147483647 -appRevision 0 -Repo "X-v20"
2024-08-13T06:20:13.5096294Z ========================== Starting Command Output ===========================
2024-08-13T06:20:13.5279902Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\Agent\_work\_temp\2a3f2c67-2033-4160-b946-a8c04751968d.ps1'"
2024-08-13T06:20:14.3434582Z Base folder:  C:\Agent\_work\32\s
2024-08-13T06:20:14.3610565Z Set artifact = /OnPrem/20.3/be
2024-08-13T06:20:14.3658226Z Set pipelineName = X-ci
2024-08-13T06:20:14.3702226Z Set containerName = x
2024-08-13T06:20:14.3828549Z Set abbreviation = ''
2024-08-13T06:20:14.3837216Z Set installAddons = ''
2024-08-13T06:20:14.3846447Z Set installXAddons = ''
2024-08-13T06:20:14.3854819Z Set preProcessorSymbols = ''
2024-08-13T06:20:14.3878242Z Set useruleset = 'x'
2024-08-13T06:20:14.3900947Z Set useruleseturl = 'x'
2024-08-13T06:20:14.3908849Z Set navVersion = ''
2024-08-13T06:20:14.3931303Z Set installDLL = 'x'
2024-08-13T06:20:14.3962947Z Set installApps = 'x'
2024-08-13T06:20:14.3979933Z Set installTestApps = ''
2024-08-13T06:20:14.4003154Z Set previousApps = 'x'
2024-08-13T06:20:14.4025471Z Set appSourceCopMandatoryAffixes = 'x'
2024-08-13T06:20:14.4034031Z Set appSourceCopSupportedCountries = ''
2024-08-13T06:20:14.4056484Z Set appFolders = 'X/app'
2024-08-13T06:20:14.4079211Z Set testFolders = ''
2024-08-13T06:20:14.4101698Z Set memoryLimit = '10G'
2024-08-13T06:20:14.4124442Z Set additionalCountries = ''
2024-08-13T06:20:14.4132592Z Set bcptTestFolders = ''
2024-08-13T06:20:14.4141675Z Set bcptTestResultsFile = ''
2024-08-13T06:20:14.4150082Z Set genericImageName = ''
2024-08-13T06:20:14.4173594Z Set vaultNameForLocal = 'BuildVariables'
2024-08-13T06:20:14.4195855Z Set bcContainerHelperVersion = 'preview'
2024-08-13T06:20:14.4236447Z Set installTestRunner = False
2024-08-13T06:20:14.4269867Z Set installTestFramework = False
2024-08-13T06:20:14.4293826Z Set installTestLibraries = False
2024-08-13T06:20:14.4317026Z Set installPerformanceToolkit = False
2024-08-13T06:20:14.4340527Z Set enableCodeCop = True
2024-08-13T06:20:14.4387557Z Set enableAppSourceCop = False
2024-08-13T06:20:14.4451442Z Set enablePerTenantExtensionCop = False
2024-08-13T06:20:14.4471979Z Set enableUICop = True
2024-08-13T06:20:14.4500188Z Set doNotSignApps = True
2024-08-13T06:20:14.4539214Z Set doNotRunTests = False
2024-08-13T06:20:14.4550191Z Set cacheImage = True
2024-08-13T06:20:14.4653800Z Set CreateRuntimePackages = True
2024-08-13T06:20:14.4766011Z Set UpdateDependencies = False
2024-08-13T06:20:15.1478089Z BcContainerHelper version 6.0.20-preview1216
2024-08-13T06:20:15.4746472Z Setting MicrosoftTelemetryConnectionString = False
2024-08-13T06:20:15.4805880Z Setting usePsSession = False
2024-08-13T06:20:15.5180185Z Ignoring unchanged config setting use7zipIfAvailable
2024-08-13T06:20:15.9711793Z Running on Windows, PowerShell 5.1.17763.6054
2024-08-13T06:20:23.4052059Z codesignCertpfxfile  $(CodeSignCertPfxFile)
2024-08-13T06:20:23.4078545Z Using cert file $(CodeSignCertPfxFile)
2024-08-13T06:20:23.4081761Z codesignCertpfxPassword 
2024-08-13T06:20:23.4092074Z license file:  ***
2024-08-13T06:20:23.4102304Z Using license file 'x'
2024-08-13T06:20:23.4116124Z appfolder:  X/app
2024-08-13T06:20:23.4119605Z appbuild:  2147483647  and revision:  0
2024-08-13T06:20:23.4125014Z artifact:  /OnPrem/20.3/be
2024-08-13T06:20:23.4174969Z 200
2024-08-13T06:20:23.4578064Z X.ruleset.json
2024-08-13T06:20:23.4586833Z downloading if necessary
2024-08-13T06:20:23.4590014Z Downloading X
2024-08-13T06:20:23.5028601Z download ruleset complete
2024-08-13T06:20:23.5044131Z C:\Agent\_work\32\s\X.ruleset.json
2024-08-13T06:20:23.5072958Z X
2024-08-13T06:20:23.5112380Z X
2024-08-13T06:20:23.5142917Z X
2024-08-13T06:20:23.5150042Z Check dlls
2024-08-13T06:20:23.5501584Z 
2024-08-13T06:20:23.5505303Z 
2024-08-13T06:20:23.5511895Z     Directory: C:\Users\DEVOPS~1\AppData\Local\Temp
2024-08-13T06:20:23.5516262Z 
2024-08-13T06:20:23.5520421Z 
2024-08-13T06:20:23.5528906Z Mode                LastWriteTime         Length Name                                                                  
2024-08-13T06:20:23.5533123Z ----                -------------         ------ ----                                                                  
2024-08-13T06:20:23.5538698Z d-----       12/02/2024     18:09                DLL                                                                   
2024-08-13T06:20:23.7413709Z Determining artifacts to use
2024-08-13T06:20:23.8752531Z   _____                               _
2024-08-13T06:20:23.8758942Z  |  __ \                             | |
2024-08-13T06:20:23.8764725Z  | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___
2024-08-13T06:20:23.8770706Z  |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
2024-08-13T06:20:23.8775398Z  | |  | (_| | | | (_| | | | | | |  __/ |_  __/ |  \__ \
2024-08-13T06:20:23.8781323Z  |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/
2024-08-13T06:20:23.8786247Z 
2024-08-13T06:20:23.8792969Z Pipeline name                   X
2024-08-13T06:20:23.8796608Z Container name                  X
2024-08-13T06:20:23.8804484Z Image name                      bcimage
2024-08-13T06:20:23.8807026Z ArtifactUrl                     https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/20.3.42673.43026/be
2024-08-13T06:20:23.8817120Z BcAuthContext                   Not Specified
2024-08-13T06:20:23.8826016Z Environment                     
2024-08-13T06:20:23.8838701Z ReUseContainer                  False
2024-08-13T06:20:23.8846780Z KeepContainer                   False
2024-08-13T06:20:23.8857051Z useCompilerFolder               True
2024-08-13T06:20:23.8866082Z artifactCachePath               
2024-08-13T06:20:23.8876414Z useDevEndpoint                  False
2024-08-13T06:20:23.8887310Z Auth                            UserPassword
2024-08-13T06:20:23.8896161Z CompanyName                     
2024-08-13T06:20:23.8906695Z MemoryLimit                     10G
2024-08-13T06:20:23.8916802Z FailOn                          error
2024-08-13T06:20:23.8927929Z TreatTestFailuresAsWarnings     False
2024-08-13T06:20:23.8938640Z Enable Task Scheduler           False
2024-08-13T06:20:23.8949570Z Assign Premium Plan             False
2024-08-13T06:20:23.8960693Z Install Test Runner             False
2024-08-13T06:20:23.8971937Z Install Test Framework          False
2024-08-13T06:20:23.8982648Z Install Test Libraries          False
2024-08-13T06:20:23.8993790Z Install Perf. Toolkit           False
2024-08-13T06:20:23.9005076Z InstallOnlyReferencedApps       False
2024-08-13T06:20:23.9015972Z generateDependencyArtifact      False
2024-08-13T06:20:23.9027316Z CopySymbolsFromContainer        False
2024-08-13T06:20:23.9038451Z enableCodeCop                   True
2024-08-13T06:20:23.9049913Z enableAppSourceCop              True
2024-08-13T06:20:23.9061050Z enableUICop                     True
2024-08-13T06:20:23.9072095Z enablePerTenantExtensionCop     False
2024-08-13T06:20:23.9083271Z enableCodeAnalyzersOnTestApps   False
2024-08-13T06:20:23.9094321Z doNotPerformUpgrade             False
2024-08-13T06:20:23.9104998Z doNotPublishApps                True
2024-08-13T06:20:23.9115764Z uninstallRemovedApps            False
2024-08-13T06:20:23.9126923Z escapeFromCops                  False
2024-08-13T06:20:23.9137792Z doNotBuildTests                 False
2024-08-13T06:20:23.9149086Z doNotRunTests                   False
2024-08-13T06:20:23.9159911Z doNotRunBcptTests               False
2024-08-13T06:20:23.9171326Z useDefaultAppSourceRuleSet      False
2024-08-13T06:20:23.9181815Z rulesetFile                     C:\Agent\_work\32\s\X.ruleset.json
2024-08-13T06:20:23.9192129Z generateErrorLog                False
2024-08-13T06:20:23.9204450Z enableExternalRulesets          False
2024-08-13T06:20:23.9215495Z azureDevOps                     True
2024-08-13T06:20:23.9226587Z gitLab                          False
2024-08-13T06:20:23.9236980Z gitHubActions                   False
2024-08-13T06:20:23.9246309Z vsixFile                        
2024-08-13T06:20:23.9257576Z License file                    Specified
2024-08-13T06:20:23.9264719Z CodeSignCertPfxFile             Not specified
2024-08-13T06:20:23.9283311Z CodeSignCertPfxPassword         Not specified
2024-08-13T06:20:23.9327637Z CodeSignCertIsSelfSigned        False
2024-08-13T06:20:23.9334625Z KeyVaultCertPfxFile             Not specified
2024-08-13T06:20:23.9340850Z KeyVaultCertPfxPassword         Not specified
2024-08-13T06:20:23.9351326Z KeyVaultClientId                
2024-08-13T06:20:23.9359861Z BuildOutputFile                 
2024-08-13T06:20:23.9368454Z ContainerEventLogFile           
2024-08-13T06:20:23.9378830Z TestResultsFile                 C:\Agent\_work\32\s\TestResults.xml
2024-08-13T06:20:23.9388840Z BcptTestResultsFile             C:\Agent\_work\32\s\bcptTestResults.json
2024-08-13T06:20:23.9398988Z TestResultsFormat               JUnit
2024-08-13T06:20:23.9427578Z AdditionalCountries             
2024-08-13T06:20:23.9436912Z PackagesFolder                  C:\Agent\_work\32\s\.packages
2024-08-13T06:20:23.9449173Z OutputFolder                    C:\Agent\_work\32\s\.output
2024-08-13T06:20:23.9459642Z BuildArtifactFolder             C:\Agent\_work\32\a
2024-08-13T06:20:23.9470231Z CreateRuntimePackages           False
2024-08-13T06:20:23.9478960Z AppVersion                      
2024-08-13T06:20:23.9489676Z AppBuild                        2147483647
2024-08-13T06:20:23.9500381Z AppRevision                     0
2024-08-13T06:20:23.9509711Z SourceRepositoryUrl             
2024-08-13T06:20:23.9521598Z SourceCommit                    
2024-08-13T06:20:23.9530371Z BuildBy                         BcContainerHelper,6.0.20-preview1216
2024-08-13T06:20:23.9539680Z BuildUrl                        
2024-08-13T06:20:23.9551289Z Mandatory Affixes               X
2024-08-13T06:20:23.9559500Z Supported Countries             
2024-08-13T06:20:23.9569632Z ObsoleteTagMinAllowedMajorMinor 
2024-08-13T06:20:23.9574348Z Install Apps
X Y Z
2024-08-13T06:20:23.9782773Z Install Test Apps
2024-08-13T06:20:23.9788701Z - None
2024-08-13T06:20:23.9794857Z Previous Apps
2024-08-13T06:20:23.9808561Z - X
2024-08-13T06:20:23.9829312Z Application folders
2024-08-13T06:20:23.9840949Z - C:\Agent\_work\32\s\X\app
2024-08-13T06:20:23.9846944Z Test application folders
2024-08-13T06:20:23.9851468Z - None
2024-08-13T06:20:23.9858637Z BCPT Test application folders
2024-08-13T06:20:23.9863016Z - None
2024-08-13T06:20:23.9871263Z BCPT Test suites
2024-08-13T06:20:23.9875329Z - None
2024-08-13T06:20:23.9883443Z Custom CodeCops
2024-08-13T06:20:23.9886175Z - None
2024-08-13T06:20:23.9923975Z NewBccontainer override
2024-08-13T06:20:23.9952387Z  param([hashtable]$parameters)
2024-08-13T06:20:23.9961327Z   New-BcContainer @parameters
2024-08-13T06:20:23.9965360Z         Invoke-Command -ScriptBlock $InstallDLLS 
2024-08-13T06:20:23.9970507Z         
2024-08-13T06:20:24.0525310Z 
2024-08-13T06:20:24.0534897Z    _____                _   _                _____                      _ _           ______    _     _
2024-08-13T06:20:24.0539891Z   / ____|              | | (_)              / ____|                    (_) |         |  ____|  | |   | |
2024-08-13T06:20:24.0548538Z  | |     _ __ ___  __ _| |_ _ _ __   __ _  | |     ___  _ __ ___  _ __  _| | ___ _ __| |__ ___ | | __| | ___ _ __
2024-08-13T06:20:24.0552493Z  | |    | '__/ _ \/ _` | __| | '_ \ / _` | | |    / _ \| '_ ` _ \| '_ \| | |/ _ \ '__|  __/ _ \| |/ _` |/ _ \ '__|
2024-08-13T06:20:24.0560803Z  | |____| | |  __/ (_| | |_| | | | | (_| | | |___| (_) | | | | | | |_) | | |  __/ |  | | | (_) | | (_| |  __/ |
2024-08-13T06:20:24.0564753Z   \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \_____\___/|_| |_| |_| .__/|_|_|\___|_|  |_|  \___/|_|\__,_|\___|_|
2024-08-13T06:20:24.0572516Z                                      __/ |                       | |
2024-08-13T06:20:24.0575915Z                                     |___/                        |_|
2024-08-13T06:20:24.0579153Z 
2024-08-13T06:20:24.0743247Z Creating CompilerFolder
2024-08-13T06:20:24.1928506Z using 7zip
2024-08-13T06:20:35.8360702Z ##[error]Copy-Item : Cannot find path 'C:\bcartifacts.cache\onprem\20.3.42673.43026\platform\Test Assemblies\Newtonsoft.Json.dll
' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.20-preview1216\CompilerFolderHandling\New-BcCompile
rFolder.ps1:134 char:9
+         Copy-Item -Path (Join-Path $testAssembliesFolder 'Newtonsoft. ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\bcartifacts....onsoft.Json.dll:String) [Copy-Item], ItemNotFoundExce 
   ption
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
2024-08-13T06:20:35.9089715Z ##[error]PowerShell exited with code '1'.
2024-08-13T06:20:35.9402694Z ##[section]Finishing: Run Pipeline
freddydk commented 2 months ago

This is a regression unfortunately. Will issue a fix asap

freddydk commented 2 months ago

In the meantime, you can revert to 6.0.19

FilipSmets commented 2 months ago

Ok, will do that, thanks