Closed sirhc101 closed 3 years ago
accept_eula and accept_outdated are switches - not boolean parameters. You need to remove the $true after these.
New-BcContainer `
-accept_eula `
-accept_outdated `
-artifactUrl $artifact `
-containerName $containerName `
-auth NavUserPassword `
-Credential $credential `
-includeCSide `
-licenseFile $licenseFile.FullName `
-memoryLimit "4G" `
-updateHosts `
-enableSymbolLoading `
-useBestContainerOS
Did this fix the issue?
I will try today with the customer. Keep you informed.
Thank you so far
Container creation looks good, even the image name. Thanks... but it fails in further processing anyway. I fails in using Import-ObjectsToNavContainer
.
2021-07-01T09:53:11.4053974Z ##[section]Starten: Create Container
2021-07-01T09:53:11.4065154Z ==============================================================================
2021-07-01T09:53:11.4065771Z Task : PowerShell
2021-07-01T09:53:11.4066205Z Description : Führen Sie ein PowerShell-Skript unter Windows, macOS oder Linux aus.
2021-07-01T09:53:11.4066617Z Version : 2.140.2
2021-07-01T09:53:11.4066941Z Author : Microsoft Corporation
2021-07-01T09:53:11.4067390Z Help : [Weitere Informationen](https://go.microsoft.com/fwlink/?LinkID=613736)
2021-07-01T09:53:11.4067889Z ==============================================================================
2021-07-01T09:53:12.3473460Z Skript wird erstellt.
2021-07-01T09:53:12.3556001Z Formatierter Befehl: . 'C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1'
2021-07-01T09:53:12.4124596Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent\_work\_temp\404e4148-9f3e-497d-a1a7-c6699c0b2077.ps1'"
2021-07-01T09:53:12.7081400Z App Version: 14.24.20210701.31
2021-07-01T09:53:12.9563795Z BcContainerHelper version 2.0.14
2021-07-01T09:53:15.2993327Z Artifacts found: https://bcartifacts.azureedge.net/onprem/14.24.46857.0/de
2021-07-01T09:53:15.3795467Z License file: BC14_20210615.flf
2021-07-01T09:53:16.7541816Z BcContainerHelper is version 2.0.14
2021-07-01T09:53:16.7548193Z BcContainerHelper is running as administrator
2021-07-01T09:53:16.7569026Z Host is Microsoft Windows Server 2019 Standard - ltsc2019
2021-07-01T09:53:16.8813909Z Docker Client Version is 20.10.5
2021-07-01T09:53:16.8837445Z Docker Server Version is 20.10.5
2021-07-01T09:53:17.2488914Z Fetching all docker images
2021-07-01T09:53:17.3752925Z Fetching all docker volumes
2021-07-01T09:53:17.4849338Z ArtifactUrl and ImageName specified
2021-07-01T09:53:17.6832948Z Image 14.24.46857.0:onprem-14.24.46857.0-de already exists
2021-07-01T09:53:18.0232577Z Using image 14.24.46857.0:onprem-14.24.46857.0-de
2021-07-01T09:53:18.1832613Z Creating Container ci
2021-07-01T09:53:18.2015963Z Version: 14.24.46857.0-de
2021-07-01T09:53:18.2023104Z Style: onprem
2021-07-01T09:53:18.2029199Z Multitenant: No
2021-07-01T09:53:18.2050702Z Platform: 14.0.46844.0
2021-07-01T09:53:18.2056898Z Generic Tag: 1.0.1.7
2021-07-01T09:53:18.2084598Z Container OS Version: 10.0.17763.1935 (ltsc2019)
2021-07-01T09:53:18.2092036Z Host OS Version: 10.0.17763.1935 (ltsc2019)
2021-07-01T09:53:18.2135558Z Using process isolation
2021-07-01T09:53:18.2186821Z Using locale de-DE
2021-07-01T09:53:18.2211588Z Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
2021-07-01T09:53:18.2278114Z Using license file \\xxx\BC14_20210615.flf
2021-07-01T09:53:18.2877472Z Files in C:\ProgramData\BcContainerHelper\Extensions\ci\my:
2021-07-01T09:53:18.2981886Z - AdditionalOutput.ps1
2021-07-01T09:53:18.2989283Z - AdditionalSetup.ps1
2021-07-01T09:53:18.2996314Z - license.flf
2021-07-01T09:53:18.3003160Z - MainLoop.ps1
2021-07-01T09:53:18.3009954Z - SetupVariables.ps1
2021-07-01T09:53:18.3016761Z - updatehosts.ps1
2021-07-01T09:53:18.3023425Z Creating container ci from image 14.24.46857.0:onprem-14.24.46857.0-de
2021-07-01T09:53:18.4907162Z 398aeab4532a7aff9d9cb96c6b3acd6420425dbbebdfe31c94422f5353c929da
2021-07-01T09:53:20.3116704Z Waiting for container ci to be ready
2021-07-01T09:53:22.5778172Z Initializing...
2021-07-01T09:53:22.5778927Z Setting host.containerhelper.internal to 172.22.64.1 in container hosts file
2021-07-01T09:53:22.5779424Z Starting Container
2021-07-01T09:53:22.5779674Z Hostname is ci
2021-07-01T09:53:23.7040495Z PublicDnsName is ci
2021-07-01T09:53:24.8428844Z Using NavUserPassword Authentication
2021-07-01T09:53:25.9823287Z Starting Local SQL Server
2021-07-01T09:53:27.1110094Z Starting Internet Information Server
2021-07-01T09:53:28.2384366Z Creating Self Signed Certificate
2021-07-01T09:53:28.2386771Z Self Signed Certificate Thumbprint 10017DF3B449DEB127212AFE82ADA91B6289FE13
2021-07-01T09:53:28.2387335Z Modifying Service Tier Config File with Instance Specific Settings
2021-07-01T09:54:05.1606673Z Starting Service Tier
2021-07-01T09:54:05.1607743Z Registering event sources
2021-07-01T09:54:14.5617323Z Creating DotNetCore Web Server Instance
2021-07-01T09:54:14.5619292Z Using license file 'c:\run\my\license.flf'
2021-07-01T09:54:14.5621041Z Import License
2021-07-01T09:54:14.5622911Z Creating http download site
2021-07-01T09:54:15.7205343Z Setting SA Password and enabling SA
2021-07-01T09:54:17.2459638Z Creating admin as SQL User and add to sysadmin
2021-07-01T09:54:17.2460697Z Creating SUPER user
2021-07-01T09:54:17.2461247Z WARNING: The password that you entered does not meet the minimum requirements.
2021-07-01T09:54:17.2461851Z It should be at least 8 characters long and contain at least one uppercase
2021-07-01T09:54:44.0872234Z letter, one lowercase letter, and one number.
2021-07-01T09:54:44.0873043Z Container IP Address: 172.22.64.255
2021-07-01T09:54:44.0873399Z Container Hostname : ci
2021-07-01T09:54:44.0873700Z Container Dns Name : ci
2021-07-01T09:54:44.0874042Z Web Client : http://ci/NAV/
2021-07-01T09:54:44.0874383Z Dev. Server : http://ci
2021-07-01T09:54:44.0874693Z Dev. ServerInstance : NAV
2021-07-01T09:54:44.0875049Z Setting ci to 172.22.64.255 in host hosts file
2021-07-01T09:54:44.0875314Z
2021-07-01T09:54:44.0875519Z Files:
2021-07-01T09:54:44.0875830Z http://ci:8080/ALLanguage.vsix
2021-07-01T09:54:44.0876075Z
2021-07-01T09:54:44.0876350Z Container Total Physical Memory is 16.0Gb
2021-07-01T09:54:44.0876695Z Container Free Physical Memory is 10.3Gb
2021-07-01T09:54:44.0876939Z
2021-07-01T09:54:44.0877199Z Initialization took 81 seconds
2021-07-01T09:54:44.0877488Z Ready for connections!
2021-07-01T09:54:44.0892736Z Reading CustomSettings.config from ci
2021-07-01T09:54:46.3130068Z Creating Desktop Shortcuts for ci
2021-07-01T09:54:47.5894667Z Container ci successfully created
2021-07-01T09:54:47.5897248Z
2021-07-01T09:54:47.5903513Z Use:
2021-07-01T09:54:47.5916598Z Get-BcContainerEventLog -containerName ci to retrieve a snapshot of the event log from the container
2021-07-01T09:54:47.5928297Z Get-BcContainerDebugInfo -containerName ci to get debug information about the container
2021-07-01T09:54:47.5940112Z Enter-BcContainer -containerName ci to open a PowerShell prompt inside the container
2021-07-01T09:54:47.5951997Z Remove-BcContainer -containerName ci to remove the container again
2021-07-01T09:54:47.5964046Z docker logs ci to retrieve information about URL's again
2021-07-01T09:54:47.5969922Z DLLs found:
2021-07-01T09:54:47.6226949Z -FileHelper.dll
2021-07-01T09:54:48.6654406Z Copy C:\agent\_work\1\s\Base\.netpackages\FileHelper.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\FileHelper.dll)
2021-07-01T09:54:49.0697856Z -JsonHelper.dll
2021-07-01T09:54:49.3592859Z Copy C:\agent\_work\1\s\Base\.netpackages\JsonHelper.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\JsonHelper.dll)
2021-07-01T09:54:49.7471232Z -MigraDoc.DocumentObjectModel.dll
2021-07-01T09:54:50.0606638Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\MigraDoc.DocumentObjectModel.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.DocumentObjectModel.dll)
2021-07-01T09:54:50.9805161Z -MigraDoc.Rendering.dll
2021-07-01T09:54:52.0686794Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\MigraDoc.Rendering.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.Rendering.dll)
2021-07-01T09:54:52.6037816Z -MigraDoc.RtfRendering.dll
2021-07-01T09:54:52.9047220Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\MigraDoc.RtfRendering.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.RtfRendering.dll)
2021-07-01T09:54:53.5161713Z -PdfSharp.Charting.dll
2021-07-01T09:54:53.8108604Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\PdfSharp.Charting.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\PdfSharp.Charting.dll)
2021-07-01T09:54:54.2745476Z -PdfSharp.dll
2021-07-01T09:54:54.5797180Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\PdfSharp.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\PdfSharp.dll)
2021-07-01T09:54:55.1072033Z -MigraDoc.DocumentObjectModel.resources.dll
2021-07-01T09:54:55.4251352Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\de\MigraDoc.DocumentObjectModel.resources.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.DocumentObjectModel.resources.dll)
2021-07-01T09:54:55.8155217Z -MigraDoc.Rendering.resources.dll
2021-07-01T09:54:56.1354665Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\de\MigraDoc.Rendering.resources.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.Rendering.resources.dll)
2021-07-01T09:54:56.4666812Z -MigraDoc.RtfRendering.resources.dll
2021-07-01T09:54:56.7764696Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\de\MigraDoc.RtfRendering.resources.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\MigraDoc.RtfRendering.resources.dll)
2021-07-01T09:54:57.1149713Z -PdfSharp.Charting.resources.dll
2021-07-01T09:54:57.4239859Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\de\PdfSharp.Charting.resources.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\PdfSharp.Charting.resources.dll)
2021-07-01T09:54:57.7706356Z -PdfSharp.resources.dll
2021-07-01T09:54:58.0905129Z Copy C:\agent\_work\1\s\Verkauf\.netpackages\PDFsharp\de\PdfSharp.resources.dll to container ci (C:\Program Files\Microsoft Dynamics NAV\140\Service\Add-Ins\PdfSharp.resources.dll)
2021-07-01T09:54:58.4514060Z Importing C/AL object dependencies . . .
2021-07-01T09:54:58.4625326Z -BC14Changes.fob
2021-07-01T09:54:59.1876258Z Copy C:\agent\_work\1\s\.devOps\.dependencies\BC14Changes.fob to container ci (c:\run\BC14Changes.fob)
2021-07-01T09:54:59.6206691Z Importing Objects from c:\run\BC14Changes.fob (container path)
2021-07-01T09:55:02.1089352Z Vom Hintergrundvorgang wurde ein Fehler mit der folgenden Meldung ausgegeben: "Der Named Pipe-Zielprozess wurde beendet.".
2021-07-01T09:55:02.1116873Z bei Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.14\ContainerHandling\Invoke-ScriptInNavContainer.ps1: Zeile 39
2021-07-01T09:55:02.1118489Z bei Import-ObjectsToNavContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.14\ObjectHandling\Import-ObjectsToNavContainer.ps1: Zeile 44
2021-07-01T09:55:02.1119576Z bei <ScriptBlock>, C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1: Zeile 73
2021-07-01T09:55:02.1120356Z bei <ScriptBlock>, C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1: Zeile 70
2021-07-01T09:55:02.1121029Z bei <ScriptBlock>, C:\agent\_work\_temp\404e4148-9f3e-497d-a1a7-c6699c0b2077.ps1: Zeile 2
2021-07-01T09:55:02.1121518Z bei <ScriptBlock>, <Keine Datei>: Zeile 1
2021-07-01T09:55:02.1137472Z bei Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.14\ContainerHandling\Invoke-ScriptInNavContainer.ps1: Zeile 44
2021-07-01T09:55:02.1143141Z bei Import-ObjectsToNavContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.14\ObjectHandling\Import-ObjectsToNavContainer.ps1: Zeile 44
2021-07-01T09:55:02.1151046Z bei <ScriptBlock>, C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1: Zeile 73
2021-07-01T09:55:02.1157038Z bei <ScriptBlock>, C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1: Zeile 70
2021-07-01T09:55:02.1161411Z bei <ScriptBlock>, C:\agent\_work\_temp\404e4148-9f3e-497d-a1a7-c6699c0b2077.ps1: Zeile 2
2021-07-01T09:55:02.1168287Z bei <ScriptBlock>, <Keine Datei>: Zeile 1
2021-07-01T09:55:02.2773106Z Get-ChildItem : Vom Hintergrundvorgang wurde ein Fehler mit der folgenden Meldung ausgegeben: "Der Named Pipe-Zielprozess wurde beendet.".
2021-07-01T09:55:02.2774852Z In C:\agent\_work\1\s\.devOps\scripts\Create-Container.ps1:70 Zeichen:1
2021-07-01T09:55:02.2775519Z + Get-ChildItem -Path ".devOps\.dependencies" -Recurse -Filter "*.fob" ...
2021-07-01T09:55:02.2776148Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-01T09:55:02.2776936Z + CategoryInfo : OperationStopped: (Vom Hintergrund...urde beendet.".:String) [Get-ChildItem], RuntimeExc
2021-07-01T09:55:02.2777651Z eption
2021-07-01T09:55:02.2778430Z + FullyQualifiedErrorId : Vom Hintergrundvorgang wurde ein Fehler mit der folgenden Meldung ausgegeben: "Der Named
2021-07-01T09:55:02.2779340Z Pipe-Zielprozess wurde beendet.".,Microsoft.PowerShell.Commands.GetChildItemCommand
2021-07-01T09:55:02.2779826Z
2021-07-01T09:55:02.3859371Z ##[error]PowerShell wurde beendet mit dem Code "1".
2021-07-01T09:55:02.4250562Z ##[section]Async Command Start: Buildnummer aktualisieren
2021-07-01T09:55:02.4251379Z Buildnummer auf 14.24.20210701.31 für den Build 31 aktualisieren
2021-07-01T09:55:02.4251880Z ##[section]Async Command End: Buildnummer aktualisieren
2021-07-01T09:55:02.4253358Z ##[section]Abschließen: Create Container
When copying files into a container, some times it takes some time before the file is accessible.
If you add ".devOps.dependencies" as a share to the container, then it doesn't need to do the copy - it will just take it from the folder.
-additionalparameters @("--volume ""C:\agent\_work\1\s\.devOps\.dependencies:c:\dependencies""")
should do the trick
did this do the trick?
I think it did, but we're still struggling with similar error messages while importing fob files into the container.
Right now I cannot describe it, because if we run the same pipeline 10 times it happens approx. only 7 times.
I currently do try all steps manually to find out what's wrong and will come back here, after it's a little more clear.
Thanks so far
It looks like a combination of volume mapping, as you suggested and memory limit. After adding the volumes ("s"(ources) directory and "a"(rtifacts) directory from agent work folder) it failed only sometimes. After a lot of testing, I set the container memory limit from 4GB to 8GB and now it seems to work everytime.
Thank you very much. Case closed :-)
Describe the issue I've a customer, using BC 14.24, and we want to setup CI/CD for their development process. We need to do some specific stuff, therefor we created our own scripts to do so, based on BcContainerHelper.
Unfortunately something goes very wrong and I cannot figure out what's going on. Hope you can help.
The script results in a container image which is labeled
true
:onprem-14.24.46857.0-de and it seems that further usage of the container is not possible. Additionally further cmds likeCompile-AppInBcContainer
failed, due to the "true" in the label.Get-BcContainerPlatformversion -containerOrImageName $containerName
returns only true andCompile-AppInBcContainer
failed because "true" is no valid version.It also fails even to import C/AL objects (fob files)
Scripts used to create container and cause the issue
Full output of scripts
General information
BC Version: 14.24.46857.0 de DevOps Version: Azure DevOps Server Version 17.143.28621.4