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

Error while compiling Apps in Run-ALPipeline #3511

Open HinnackX1 opened 4 months ago

HinnackX1 commented 4 months ago

Hi,

we are running the Run-ALPipeline command on an agent on a virtual machine via Azure DevOps Build Pipelines. When compiling the apps, we get the following error message: ERROR Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to the remote server"

Scripts used to create container and cause the issue

Run-AlPipeline `
    -containerName $DockerContainerName `
    -keepContainer `
    -credential $DockerContainerUserCredentials `
    -artifact $DockerContainerBCArtifact `
    -baseFolder $BuildBaseFolder `
    -appFolders $AppsFolderList `
    -testFolders $TestAppsFolderList `
    -installApps $ThirdPartyAppFileList `
    -enablePerTenantExtensionCop `
    -appVersion ($BuildVersion.Major.ToString() + "." + $BuildVersion.Minor.ToString())  `
    -appBuild $BuildVersion.Build `
    -appRevision $BuildVersion.Revision `
    -buildArtifactFolder $BuildArtifactsFolder `
    -azureDevOps `
    -installTestFramework `
    -installTestLibraries `
    -testResultsFormat "JUnit" `
    -testResultsFile "testresults" `
    -PublishBcContainerApp $publishBcContainerApp `
    -companyName "My Company" `
    -NewBcContainer $newBcContainer

Full output of scripts

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

Using Version 23.5.20240425.1

Compiling C:\agent\_work\254\s\GP Master Data Extensions\app
Copying DLLs from C:\Program Files\Microsoft Dynamics NAV\230\Service to assemblyProbingPath
Removing dotnet Framework Assemblies
Using Symbols Folder: C:\agent\_work\254\s\.packages
Processing dependency Microsoft_Application_23.0.0.0 ()
Downloading symbols: Microsoft_Application_23.5.16502.16887.app
Url : http://172.30.65.89:7049/BC/dev/packages?publisher=Microsoft&appName=Application&versionText=23.0.0.0&tenant=default
Downloading using WebClient
ERROR Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to the remote server"
Compile-AppInBcContainer Telemetry Correlation Id: 6ae7b740-6359-4dd3-8d31-6efc4182273d
Run-AlPipeline Telemetry Correlation Id: dae7690c-a244-45cd-95b3-f663862486f8
Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to the remote server"
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.15\AppHandling\Compile-AppInNavContainer.ps1:492 
char:25
+                         throw (GetExtendedErrorMessage $_)
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Exception calli... remote server":String) [], RuntimeException
    + FullyQualifiedErrorId : Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to the remote  
   server"

##[error]PowerShell exited with code '1'.

...

Screenshots

Additional context

freddydk commented 4 months ago

Not sure what the cause of this is, but since you say that it works on local agents and not on a VM, there probably isn't anything with the script I would delete and recreate the VM (I would use aka.ms/getbuildagent) and see if the problem resolves itself.