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 247 forks source link

Export-ModifiedObjectsAsDeltas fails with Could not find a part of the path. #2423

Closed kimnoer closed 2 years ago

kimnoer commented 2 years ago

Describe the issue When running Export-ModifiedObjectsAsDeltas it fails with following

Export-ModifiedObjectsAsDeltas -containerName ba Export Objects with filter 'Modified=1' to C:\ProgramData\BcContainerHelper\Extensions\ba\modified\objects.txt (container path) Split C:\ProgramData\BcContainerHelper\Extensions\ba\modified\objects.txt to C:\ProgramData\BcContainerHelper\Extensions\ba\modified (container paths) Copy original objects to C:\ProgramData\BcContainerHelper\Extensions\ba\original for all objects that are modified (container path) Compare modified objects with original objects in C:\ProgramData\BcContainerHelper\Extensions\ba\original and create Deltas in C:\ProgramData\BcContainerHelper\Extensions\ba\delta (container paths) Rename new objects to .TXT Could not find a part of the path. at , : line 46 at , : line 40 at Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 43 at Create-MyDeltaFolder, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.4\ObjectHandling\Create-MyDeltaFolder.ps1: line 41 at Export-ModifiedObjectsAsDeltas, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.4\ObjectHandling\Export-ModifiedObjectsAsDeltas.ps1: line 88 at , : line 1 Export-ModifiedObjectsAsDeltas Telemetry Correlation Id: 64fa0149-b496-47e0-a770-a5e67fb5734d Could not find a part of the path. At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1:44 char:13

Scripts used to create container and cause the issue $version = '11.0.27667.0' # platform $artifacturl = Get-BCArtifactUrl -type OnPrem -version $version -country dk New-BCContainer -useBestContainerOS -accept_eula -containerName $containerName -artifactUrl $artifacturl -auth UserPassword -Credential $credential -updateHosts -alwaysPull -includeCSide -shortcuts DesktopFolder -licenseFile C:\work\License\nav2018.flf -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/SelfSignedCertificateEx/SetupCertificate.ps1")

Import-ObjectsToNavContainer -containerName ba -objectsFile C:\ba.fob -SynchronizeSchemaChanges Force -ImportAction Overwrite Export-ModifiedObjectsAsDeltas -containerName $containerName

Full output of scripts BcContainerHelper is version 3.0.4 BcContainerHelper is running as administrator Host is Microsoft Windows 11 Pro - 21H2 Docker Client Version is 20.10.13 Docker Server Version is 20.10.13 Removing container ba Removing ba from container hosts file Removing ba-* from container hosts file Removing C:\ProgramData\BcContainerHelper\Extensions\ba Fetching all docker images Fetching all docker volumes Pulling image mcr.microsoft.com/businesscentral:10.0.20348.643 10.0.20348.643: Pulling from businesscentral Digest: sha256:6109e8021486b29fae895410629867541a0f0515bd6228a06129f61a99906445 Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.20348.643 mcr.microsoft.com/businesscentral:10.0.20348.643 Using image mcr.microsoft.com/businesscentral:10.0.20348.643 Creating Container ba Style: onprem Multitenant: No Version: 11.0.27667.0 Platform: 11.0.27667.0 Generic Tag: 1.0.2.1 Container OS Version: 10.0.20348.643 (ltsc2022) Host OS Version: 10.0.22000.613 (21H2) Using process isolation Using locale da-DK Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable) Downloading C:\ProgramData\BcContainerHelper\Extensions\ba\my\SetupCertificate.ps1 Using license file C:\work\License\nav2018.flf Files in C:\ProgramData\BcContainerHelper\Extensions\ba\my:

Files: http://ba:8080/ALLanguage.vsix

Container Total Physical Memory is 31.7Gb Container Free Physical Memory is 8.1Gb

Initialization took 33 seconds Ready for connections! remove C:\NAVDVD Reading CustomSettings.config from ba Creating Desktop Shortcuts for ba Container ba successfully created

Additional context It happens all the time,

kimnoer commented 2 years ago

This problem also repeats it self on a BC 14 container with Convert-ModifiedObjectsToAl - exactly the same issue. I believe it is caused by the objects. But exporting as text, importing as text + compile, doesn't change any change. Same error.

Puzzling indeed.

freddydk commented 2 years ago

Would it be possible to send the ba.fob to me (freddyk at microsoft dot com) for repro?

freddydk commented 2 years ago

I tried without - no problem

freddydk commented 2 years ago

please reopen with repro files if I am to investigate this, thanks