Closed lktraser closed 7 months ago
Could you provide a dump of the build when using BcContainerHelper version 5?
Certainly:
Setting sqlMemoryLimit = 8G
Setting GenerateImages = False
Setting memoryLimit =
Setting isolation = process
Setting sandboxContainersAreMultitenantByDefault = False
TraserBCHelper version 1.20240216.1
BcContainerHelper version 5.0.3
Setting sandboxContainersAreMultitenantByDefault = False
BC.HelperFunctions emits usage statistics telemetry to Microsoft
*** Download to symbols folder output ***
using 7zip
Using Symbols Folder: C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Enumerating Apps in CompilerFolder C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\symbols
Enumerating Apps in Symbols Folder C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Processing dependency Microsoft_Application_21.2.49946.49990 ()
Dependency App not found
Copying C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\symbols\Microsoft_Application.app to C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Adding dependency to System Application from Microsoft
Adding dependency to Base Application from Microsoft
Processing dependency Microsoft_System_21.0.49939.49984 ()
Dependency App not found
Copying C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\symbols\System.app to C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Processing dependency orderbase consulting GmbH_orderbase Base Library_23.4.36.198 (a09be25f-97a6-44a9-8203-f252ad7efbb9)
Dependency App exists
Processing dependency orderbase consulting GmbH_orderbase Time Management Library_23.4.48.412 (6c9adc1f-301e-433f-96fd-56af29b1a71f)
Dependency App exists
Processing dependency orderbase consulting GmbH_orderbase Time Management - PDA Service_23.4.20.252 (a3414767-55fc-4ef5-a053-c3172ebf5aee)
Dependency App exists
Processing dependency TRASER Software GmbH_TRASER Storage_2001.230900.20231128.1 (bb6e9331-210f-4241-b3e1-5f8d2acc79e8)
Dependency App exists
Processing dependency TRASER Software GmbH_TRASER Core_2102.231100.20231213.1 (f661ac2d-92c0-472c-810a-ec8ea3044603)
Dependency App exists
Processing dependency TRASER Software GmbH_TRASER DMS Machine_2102.230900.20231201.1 (25e7d5c1-1369-4018-8344-78cc87b8d440)
Dependency App exists
Processing dependency TRASER Software GmbH_TRASER DMS_2103.230900.20231130.1 (5602a8b3-2c2f-40c6-865b-4250c316f125)
Dependency App exists
Processing dependency Microsoft_System Application_21.2.49946.49990 (63ca2fa4-4f03-4f2b-a480-172fef340d3f)
Dependency App not found
Copying C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\symbols\Microsoft_System Application.app to C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Processing dependency Microsoft_Base Application_21.2.49946.49990 (437dbf0e-84ff-417a-965d-ed2bb9650972)
Dependency App not found
Copying C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\symbols\Microsoft_Base Application.app to C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e
Platform version: 21.0.49939.49984
Modifying Dependencies
Dependency: Id=a09be25f-97a6-44a9-8203-f252ad7efbb9, Publisher=orderbase consulting GmbH, Name=orderbase Base Library, Version=23.4.36.198
Dependency: Id=6c9adc1f-301e-433f-96fd-56af29b1a71f, Publisher=orderbase consulting GmbH, Name=orderbase Time Management Library, Version=23.4.48.412
Dependency: Id=a3414767-55fc-4ef5-a053-c3172ebf5aee, Publisher=orderbase consulting GmbH, Name=orderbase Time Management - PDA Service, Version=23.4.20.252
Dependency: Id=bb6e9331-210f-4241-b3e1-5f8d2acc79e8, Publisher=TRASER Software GmbH, Name=TRASER Storage, Version=2001.230900.20231128.1
Dependency: Id=f661ac2d-92c0-472c-810a-ec8ea3044603, Publisher=TRASER Software GmbH, Name=TRASER Core, Version=2102.231100.20231213.1
Dependency: Id=25e7d5c1-1369-4018-8344-78cc87b8d440, Publisher=TRASER Software GmbH, Name=TRASER DMS Machine, Version=2102.230900.20231201.1
Dependency: Id=5602a8b3-2c2f-40c6-865b-4250c316f125, Publisher=TRASER Software GmbH, Name=TRASER DMS, Version=2103.230900.20231130.1
Application Dependency 21.2.49946.49990
Platform Dependency 21.0.49939.49984
Compiling...
.\alc.exe /project:"C:\hub3agent04\A1\_work\237\s\Time Management Traser" /packagecachepath:"C:\Users\Administrator\AppData\Local\Temp\a3cbeac2-283f-4496-be4a-0c9ec826572e" /out:"C:\hub3agent04\A1\_work\237\a\TRASER Software GmbH_TRASER DMS 365 x orderbase Time Management PDA_2102.240100.20240221.1.app" /analyzer:C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\compiler\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll /analyzer:C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\compiler\extension\bin\Analyzers\Microsoft.Dynamics.Nav.UICop.dll /assemblyprobingpaths:C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\dlls\OpenXML,C:\Windows\Microsoft.NET\Assembly,C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\dlls\Service,C:\ProgramData\BcContainerHelper\compiler\e68a683b-194d-4cf5-b07d-0c01bcacd785\dlls\Mock Assemblies
Microsoft (R) AL Compiler version 10.2.10.59069
Copyright (C) Microsoft Corporation. All rights reserved
*** Compiler Output ***
Compilation ended at '18:59:12.216'.
Hi @freddydk, I just read about the new changes to generic images on yammer and the deadline of the 25th is already drawing pretty close. This issue is keeping us from upgrading to latest bccontainerhelper. I'm afraid we will be completely blocked if it's not resolved.
Sorry - I will have a look at this tomorrow. Thanks for raising the flag.
Sorry, I cannot repro this
This file: TraserBCHelper\PSModule\AppHandling\Compile-ALAppWithCompileFolder.ps1:82:56 is your own (not part of ContainerHelper)
It looks like you are using Get-ChildItem -Recurse | Remove-Item -Recurse -Force
That is a double recurse and might be what causes the problem for you. It might be that the structure is different, but the failing code seems to be your own.
Hi Freddy, while it is my own script I posted the containing code above and it's basically just creating and removing the symbols folder before and after
$compilefolder = New-BcCompilerFolder -artifactUrl $artifactUrl $output = Compile-AppWithBcCompilerFolder @compileparameters -compilerFolder $compilefolder
My remove is just
Remove-Item -Path $appSymbolsFolder -Recurse -Force
why do you suspect I use
Get-ChildItem -Recurse | Remove-Item -Recurse -Force
Further help would be appreciated, this is important to us so our build server isn't flooded with build leftovers.
I will be out next week (from today at 3pm) - but we can grab a Teams call this morning to troubleshoot?
Before the Teams call - I would like to get a copy of your scripts to see if anything springs into mind - and maybe modify it to identify what the problem actually is and through that figure out whether I need to change anything.
I am open at 11am - feel free to invite freddyk at microsoft dot com.
Thanks
Also, the difference between this:
Get-ChildItem $appSymbolsFolder -Recurse | Remove-Item -Recurse -Force
and
Remove-Item $appSymbolsFolder -Recurse -Force
is that the first one is trying to empty the folder - the second is trying to delete the folder.
I would empty the folder without the first -recurse
Get-ChildItem -Path $appSymbolsFolder -Include * | Remove-Item -Recurse -Force
Hi Freddy, I think I can save you time. I upgraded to 6.0.11 just now to make sure nothing has changed in the meantime and from what I can tell the issue is resolved. I didn't change my script but it seems like something changed about the locking process between 6.0.4 and 6.0.11. I'll run the buildserver that way for now.
I'll keep an eye out for it and worst case I'll remove my cleanup code temporarily.
Also thanks for the advice on the cleanup code I'll incorporate that if the issue turns up again.
Thanks as always for your time.
Sadly I was too hasty in calling it off afterall. The issue returned on 6.0.11. I tried all different versions of Remove-Item but all turn up the same problem.
Get-ChildItem -Path $appSymbolsFolder -Include * | Remove-Item -Force
Compilation ended at '16:18:14.153'.
***\Product\TraserBCHelper\out\TRASER Software ***.app successfully created in 7 seconds
Remove-Item : Cannot remove item ***\AppData\Local\Temp\8f13a913-fc47-458f-85cc-1697f0f05978\Continia
Software_Continia OPplus_23.2.1.531556_RUNTIME-23.0.app: The process cannot access the file
'***\AppData\Local\Temp\8f13a913-fc47-458f-85cc-1697f0f05978\Continia Software_Continia
OPplus_23.2.1.531556_RUNTIME-23.0.app' because it is being used by another process.
At ***\Product\TraserBCHelper\PSModule\AppHandling\Compile-ALAppWithCompileFolder.ps1:78 char:60
+ ... Get-ChildItem -Path $appSymbolsFolder -Include * | Remove-Item -Force
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\Users\LeonKn...UNTIME-23.0.app:FileInfo) [Remove-Item], IOException
+ FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
I really can only isolate it to bccontainerhelper 6 + runtime packages in the appSymbolsFolder. To reduce variables I've also reduced it to pure bccontainerhelper and manual delete with windows explorer.
So the script is simply:
$output = Compile-AppWithBcCompilerFolder -compilerFolder $compilefolder -appProjectFolder (Resolve-Path '.** - App\') -appSymbolsFolder '***\Desktop\symbols'
And leads to:
I'll revert to version 5 for now as I will be on vacation too.
I will need a repro with everything in order to fix this. I have tried in various ways to create runtime packages, compile and delete - and I cannot repro this, So basically, I will need a .zip file with a test project or like, on which I can run a command that reproduces this - else I cannot fix the issue. and please note, BcContainerHelper 5 will stop working next week (maybe not with compilerfolders - but definitely with containers)
Describe the issue When using bccontainerhelper >6.0.0 my build pipelines fail when they try to cleanup the symbols folder after compiling with a compile folder. I suspect this has something to do with how the app.json cache is created since this is only an issue when runtime packages are involved.
Rough outline of the script used as I can't post the entire script
Full output of scripts
Additional context