Closed ti-jalopez closed 3 years ago
Very strange, this bug should be fixed here: https://github.com/microsoft/navcontainerhelper/pull/1171 How do you configure the HostHelperFolder? Could you share your bcContainerHelper.config.json?
Thanks
Ok, so your hostHelperFolder is not set. Also you are trying to copy the folder and not the filename as it looks (Copy C:\temp_Datanet to container BC17LATEST (C:\Program Files\Microsoft Dynamics NAV\170\Service\Add-Ins_Datanet_Datanet) )
In order to set the hosthelperfolder, it must be specified in c:\programdata\bccontainerhelper\bccontainerhelper.config.json - that file does not move and hosthelperfolder cannot be set at runtime. https://freddysblog.com/2020/10/10/bccontainerhelper-configuration/
This is the content of C:\ProgramData\BcContainerHelper\BcContainerHelper.config.json The hostHelperFolder is setup ok, because when I create containers the extension subforders are create in C:\ContainerHelper\Extensions
{
"use7zipIfAvailable": true,
"digestAlgorithm": "SHA256",
"mapCountryCode": {
"ae": "w1",
"br": "w1",
"co": "w1",
"ee": "w1",
"fo": "dk",
"gl": "dk",
"hk": "w1",
"hr": "w1",
"hu": "w1",
"id": "w1",
"ie": "w1",
"jp": "w1",
"kr": "w1",
"lt": "w1",
"lv": "w1",
"my": "w1",
"pe": "w1",
"ph": "w1",
"pl": "w1",
"rs": "w1",
"ro": "w1",
"sg": "w1",
"si": "w1",
"th": "w1",
"tw": "w1",
"vn": "w1",
"za": "w1"
},
"hostHelperFolder": "C:\\ContainerHelper",
"timeStampServer": "http://timestamp.digicert.com",
"bcartifactsCacheFolder": "c:\\bcartifacts.cache",
"containerHelperFolder": "C:\\ProgramData\\BcContainerHelper",
"genericImageName": "mcr.microsoft.com/businesscentral:{0}",
"sandboxContainersAreMultitenantByDefault": true,
"defaultContainerName": "bcserver",
"usePsSession": true,
"defaultNewContainerParameters": { }
}
Ok, so your hostHelperFolder is not set. Also you are trying to copy the folder and not the filename as it looks (Copy C:\temp_Datanet to container BC17LATEST (C:\Program Files\Microsoft Dynamics NAV\170\Service\Add-Ins_Datanet_Datanet) )
This is true, _Datanet is a folder, but I think somethink is wrong, because the folder in the error message 'C:\ProgramData\BcContainerHelper' should be "C:\ContainerHelper". I tested it without folders and it run fine, so maybe only have a strange behavior about the folder name. I think you can close this case, since I do your proposal in https://github.com/microsoft/navcontainerhelper/issues/1673#issuecomment-771475675 to replace Copy-FileToBCContainer by a shared folder for add-ins.
Thanks 👍
The reason for this is that the error comes from inside the container and since your containerHelperFolder is still c:\programdata\bccontainerhelper, then you get this error. Mystery solved.
Ok, I understand, the folder "c:\programdata\bccontainerhelper" is the name inside the container, not the local folder in containerHelperFolder on host machine
👍
Describe the issue BcContainerHelper version 2.0.3 I've changed BcContainerHelper.config.json to change hostHelperFolder to "C:\ContainerHelper" instead of default value "c:\ProgramData\BcContainerHelper".
When I use Copy-FileToBCContainer an error occurs: "Access to the path 'C:\ProgramData\BcContainerHelper\662029ee-c613-4bc2-b4a1-82dc8e692388' is denied. at, : line 9".
I think the problem is "Copy-FileToBCContainer" uses the default hostHelperFolder instead of the new value changed.
This script ran successfully with NavContainerHelper and default hostHelperFolder in my old laptop.
Scripts used to create container and cause the issue
The source folder only contains a subfolder and a file. I think it run fine before change my laptop and install bccontainerhelper instead of navcontainerhelper, and I change the default hostHelperFolder
Full output of scripts
Screenshots If applicable, add screenshots to help explain your problem.
Additional context