Closed rvanbekkum closed 2 years ago
In the sample above (this line):
New-BCContainer -accept_eula -artifactURL $artifactUrl -containerName 'apx-filesonly' -licenseFile '<Path To My License File>' -updateHosts -alwaysPull -memoryLimit 12G -accept_outdated -dns '8.8.8.8' -Auth NavUserPassword -Credential ([PSCredential]::new("123", (ConvertTo-SecureString -String "123" -AsPlainText -Force))) -includeTestToolkit -enableTaskScheduler:$false -filesOnly
does not seem to share the folder C:\Agent\BA01_work\447\s\ with the container. I would expect that to give a series of other errors - how are you sharing this folder to the container? (are you using some parameters which isn't here?)
Yes, for when it runs on our build agent the -volume
parameter is added via the -additionalParameters
parameter to share the build agent folder. It can also be tested by using the C:\ProgramData\BcContainerHelper\Extensions\containername\my
folder which is shared with containers by default.
Does this answer your question?
You specify "C:\Agent\BA01_work\447\s\LinterCop\BusinessCentral.LinterCop.dll " as custom code cop (btw. there is a space there - not sure whether that causes problems - don't think so).
I will see that as a folder on the host and in the compile function determine where to find that file in the container (one of the containing folders needs to be shared) and add that to the ALC call:
/analyzer:C:\Agent\BA01\_work\447\s\LinterCop\BusinessCentral.LinterCop.dll
So it looks like it thinks that the host Agent folder is shared with the container with the same name - is that correct?
If the folder is shared correctly, the file should also be there.
If possible - could you get a get-bccontainerdebuginfo from a container on the build agent and send that? (either here or on email)
I had the same version problems when using Run-ALPipeline with older versions of BC. This is because I compile the LinterCop against the latest compiler dlls. Solution was to pass in -vsixFile (Get-LatestAlLanguageExtensionUrl)
. If this parameter could also be added to Compile-AppInBcContainer
it could solve the problem
@freddydk We found what actually goes wrong (@StefanMaron set me on the right path for pinning it down). It appears that if the -filesOnly
flag is used for creating the container and -vsixFile (Get-LatestAlLanguageExtensionUrl)
is passed as well, then Compile-AppInBcContainer
will still use the compiler version shipped in the BC artifacts.
To reproduce:
$artifactUrl = Get-BCArtifactUrl -country base -version 19.0
New-BCContainer -accept_eula -artifactURL $artifactUrl -containerName 'apx-filesonly' -licenseFile 'C:\temp\myLicense.flf' -updateHosts -alwaysPull -memoryLimit 12G -accept_outdated -dns '8.8.8.8' -Auth NavUserPassword -Credential ([PSCredential]::new("123", (ConvertTo-SecureString -String "123" -AsPlainText -Force))) -includeTestToolkit -enableTaskScheduler:$false -filesOnly -vsixFile (Get-LatestAlLanguageExtensionUrl)
Compile-AppInBcContainer -containerName apx-filesonly -credential ([PSCredential]::new("123", (ConvertTo-SecureString -String "123" -AsPlainText -Force))) -CopySymbolsFromContainer -appProjectFolder C:\ProgramData\BcContainerHelper\Extensions\apx-filesonly\my\MyAwesomeProject\App\ -appSymbolsFolder C:\ProgramData\BcContainerHelper\Extensions\apx-filesonly\my\.alPackages\ -CustomCodeCops @("C:\ProgramData\BcContainerHelper\Extensions\apx-filesonly\my\BusinessCentral.LinterCop.dll")
(also updated the original issue description accordingly)
This does not happen with a 'full'/normal BC container.
Also, like you asked, considering there is no personal information in the output from Get-BcContainerDebugInfo
, here it is for my own machine where I can reproduce it with a -filesOnly
container:
{
"container.logs": [
"Using artifactUrl https://bcartifacts.azureedge.net/sandbox/19.0.29894.34796/base",
"Using installer from C:\\Run\\150-new",
"Installing Business Central",
"Installing from artifacts",
"Copying Service Tier Files",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\ServiceTier\\Program Files",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\ServiceTier\\System64Folder",
"Copying PowerShell Scripts",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\WindowsPowerShellScripts\\Cloud\\NAVAdministration",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\WindowsPowerShellScripts\\WebSearch",
"Copying dependencies",
"Copying ReportBuilder",
"Importing PowerShell Modules",
"Skipping restore of Cronus database",
"Modifying Business Central Service Tier Config File for Docker",
"Installing SIP crypto provider: \u0027C:\\Windows\\System32\\NavSip.dll\u0027",
"Copying Web Client Files",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\WebClient\\Microsoft Dynamics NAV",
"Copying Client Files",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\LegacyDlls\\program files\\Microsoft Dynamics NAV",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\LegacyDlls\\program files\\Microsoft Dynamics NAV",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\LegacyDlls\\systemFolder",
"Copying ModernDev Files",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform",
"c:\\dl\\sandbox\\19.0.29894.34796\\platform\\ModernDev\\program files\\Microsoft Dynamics NAV",
"Copying additional files",
"Copying ConfigurationPackages",
"C:\\dl\\sandbox\\19.0.29894.34796\\platform\\ConfigurationPackages",
"Copying Test Assemblies",
"C:\\dl\\sandbox\\19.0.29894.34796\\platform\\Test Assemblies",
"Copying Applications",
"C:\\dl\\sandbox\\19.0.29894.34796\\platform\\Applications",
"Installation took 17 seconds",
"Installation complete",
"Ready for connections!"
],
"docker.info": [
"Client:",
" Context: desktop-windows",
" Debug Mode: false",
" Plugins:",
" buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)",
" compose: Docker Compose (Docker Inc., 2.0.0-beta.4)",
" scan: Docker Scan (Docker Inc., v0.8.0)",
"",
"Server:",
" Containers: 2",
" Running: 2",
" Paused: 0",
" Stopped: 0",
" Images: 4",
" Server Version: 20.10.7",
" Storage Driver: windowsfilter",
" Windows: ",
" Logging Driver: json-file",
" Plugins:",
" Volume: local",
" Network: ics internal l2bridge l2tunnel nat null overlay private transparent",
" Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog",
" Swarm: inactive",
" Default Isolation: hyperv",
" Kernel Version: 10.0 19043 (19041.1.amd64fre.vb_release.191206-1406)",
" Operating System: Windows 10 Enterprise Version 2009 (OS Build 19043.1415)",
" OSType: windows",
" Architecture: x86_64",
" CPUs: 8",
" Total Memory: 31.88GiB",
" Name: LT-ROB",
" ID: EDA4:PZWK:HKFR:MG6N:J2NI:QRVL:4RU2:FJTM:I5J7:EY4J:GF73:5R5A",
" Docker Root Dir: C:\\ProgramData\\Docker",
" Debug Mode: false",
" Registry: https://index.docker.io/v1/",
" Labels:",
" Experimental: false",
" Insecure Registries:",
" 127.0.0.0/8",
" Live Restore Enabled: false",
" Product License: Community Engine",
""
],
"container.labels": {
"country": "W1",
"created": "202201060433",
"eula": "https://go.microsoft.com/fwlink/?linkid=861843",
"filesonly": "yes",
"maintainer": "Dynamics SMB",
"nav": "",
"osversion": "10.0.19041.1415",
"platform": "19.0.29884.34594",
"tag": "1.0.1.9",
"version": "19.0.29894.34796"
},
"container.ping": [
"",
"Pinging apx-filesonly.local [fe80::d82a:ea06:96b8:d8f%82] with 32 bytes of data:",
"Destination host unreachable.",
"Destination host unreachable.",
"Destination host unreachable.",
"Destination host unreachable.",
"",
"Ping statistics for fe80::d82a:ea06:96b8:d8f%82:",
" Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),"
],
"container.env": [
"auth=NavUserPassword",
"username=123",
"filesOnly=True",
"accept_outdated=Y",
"enableApiServices=Y",
"passwordKeyFile=c:\\run\\my\\aes.key",
"isBcSandbox=Y",
"multitenant=Y",
"licenseFile=\u003cspecified\u003e",
"ExitOnError=N",
"locale=en-US",
"databaseInstance=",
"removePasswordKeyFile=Y",
"customNavSettings=EnableTaskScheduler=False",
"accept_eula=Y",
"databaseServer=",
"artifactUrl=https://bcartifacts.azureedge.net/sandbox/19.0.29894.34796/base",
"useSSL=N",
"securePassword=\u003cspecified\u003e",
"DOTNET_RUNNING_IN_CONTAINER=true",
"COMPLUS_NGenProtectedProcess_FeatureEnabled=0"
]
}
(EDIT: Whoops, accidentally, pasted the output for a different container in here)
Updated the title of the GitHub issue accordingly.
Ahh - now that is probably a bug - will investigate
As a work-around I am extracting the contents of the .vsix to use to C:\build\
, so, similar to how you fixed it in https://github.com/microsoft/navcontainerhelper/commit/a59321596fc89d11bc474bb06b3ecf090b9ed275 😊.
Fixed in 3.0.1
PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!
Describe the issue The
Compile-AppInBcContainer
function has a-CustomCodeCops
parameter to which you can pass additional code analyzer DLLs. This works perfectly fine when compiling against a 'regular' container, but it fails when compiling against a-filesOnly
container.Scripts used to create container and cause the issue UPDATE: Create-Container.ps1
Example for reproducing this manually:
Full output of scripts
And a compile on my own machine (where I place the files in "C:\ProgramData\BcContainerHelper\Extensions\apx-filesonly\my.....") with yet another app raises warnings like the following:
but it does work for 'normal' containers.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context
Is there a way we can resolve this? What is causing this?