Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-BcContainerAppRuntimePackage in Run-ALPipeline #3801

Open
RalleSP86 opened this issue Jan 13, 2025 · 10 comments
Open

Get-BcContainerAppRuntimePackage in Run-ALPipeline #3801

RalleSP86 opened this issue Jan 13, 2025 · 10 comments

Comments

@RalleSP86
Copy link

Hi,

I have allready a problem with debugging when I create runtime packages over the command Run-ALPipeline.
There ist no possibilty to set parameter IncludeSourceInPackageFile.
What can I do, to create debuggable runtime packages over the Run-ALPipeLine command?
In our app.json the parameter allowDebugging and includeSourceInSymbolFile are set to true.

Originally posted by @RalleSP86 in #3160

@freddydk
Copy link
Contributor

The generation of a runtime package within Run-AlPipeline should never have been made, since this will only generate a runtime package for a single version of BC.
You should use Convert-BcAppsToRuntimePackages when you have an .app file - or (if you really want to stick with run-alpipeline) add -keepContainer and then manually call Get-BcContainerAppRuntimePackage with the right parameters.

@RalleSP86
Copy link
Author

RalleSP86 commented Jan 14, 2025

Hi Freddy,

thanks for your answer.
I tried to use the command Convert-BcAppsToRuntimePackages. I used the following params:
Convert-BcAppsToRuntimePackages -artifactUrl $ArtifactUrl -licenseFile $licenseFile -apps "C:\temp\apps" -destinationFolder "C:\temp\apps\runtime" -includeSourceInPackageFile 1 -publishApps "C:\temp\apps"

I executed the command on a local maschine and get the following error.

Image

It looks like a problem when publishing apps.

@freddydk
Copy link
Contributor

I think apps parameter needs to be an app path or array of app paths - not a folder.

@RalleSP86
Copy link
Author

RalleSP86 commented Jan 15, 2025

I tried this with a path to a Appfile:
Convert-BcAppsToRuntimePackages -artifactUrl $ArtifactUrl -licenseFile $licenseFile -apps "C:\temp\apps\TestappXY.app" -destinationFolder "C:\temp\RuntimeOnPrem" -includeSourceInPackageFile 1

The same error occurs. I think the app file will not copied correctly in container.

The same error was already mentioned in the following issue:
#1446

@freddydk
Copy link
Contributor

Please provide the full output from your command (not as a screenshot).

@RalleSP86
Copy link
Author

BcContainerHelper version 6.0.30
WinRM service is not running, will not try to use WinRM sessions
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on Windows, PowerShell 5.1.22621.4391
BcContainerHelper is version 6.0.30
BcContainerHelper is running as administrator
HyperV is Enabled
Host is Microsoft Windows 11 Enterprise - 10.0.22631.4602
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is never
UseSslForWinRmSession is True
Docker Client Version is 27.4.0
Docker Server Version is 27.4.0
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
Image my:onprem-25.2.27733.27999-de already exists
Using image my:onprem-25.2.27733.27999-de
Creating Container bcserver
Style: onprem
Multitenant: No
Version: 25.2.27733.27999
Platform: 25.2.27927.0
Generic Tag: 1.0.2.53
Container OS Version: 10.0.20348.2966 (ltsc2022)
Host OS Version: 10.0.22631.4602 (23H2)
Container and host OS are 20348 or above, not using SSL, recommended isolation mode is process.
Using process isolation
Using locale de-DE
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Users\RalphSchütze\Sonapro Informationssysteme GmbH\Entwicklung - Dokumente\Lizenzen\Entwicklerlizenz_BC25\BC25_DEV_20241125.bclicense
Additional Parameters:
--volume "C:\Users\RalphSchütze\AppData\Local\Temp\176ffc98-d714-4d8f-9b53-aa4e3b4f2220:c:\apps"
--volume "C:\temp\RuntimeOnPrem:c:\dest"
--env WebClient=N
--env httpSite=N
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- HelperFunctions.ps1
- license.bclicense
- MainLoop.ps1
- SetupVariables.ps1
- updatecontainerhosts.ps1
Creating container bcserver from image my:onprem-25.2.27733.27999-de
0b7b21225c56702924d5c0a62946ac5d2a22fbc8ba974348a3dc2ac9f4c0885f
Waiting for container bcserver to be ready
Initializing...
Setting host.containerhelper.internal to 172.18.64.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Starting Local SQL Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint A9E1258133C713A7BCB139B555685DFFF9C3161F
DNS identity bcserver
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Using license file 'c:\run\my\license.bclicense'
Import License
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.18.65.106
Container Hostname  : bcserver
Container Dns Name  : bcserver

Container Total Physical Memory is 31.6Gb
Container Free Physical Memory is 12.5Gb

Initialization took 104 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Cleanup old dotnet core assemblies
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again
Publishing 
Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

Container Free Physical Memory: 12.4Gb
Disk C: Free 126Gb from 127Gb

Services in container bcserver:
Removing Session bcserver
Removing container bcserver
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver
Convert-BcAppsToRuntimePackages Telemetry Correlation Id: 0c0d59fc-434a-4415-a94b-9e27706868b3
Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
In C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.30\ContainerHandling\Invoke-ScriptInNavContainer.ps1:301 Zeichen:25
+                         throw $errorMessage
+                         ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Cannot validate... command again.:String) [], RuntimeException
    + FullyQualifiedErrorId : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command a 
   gain.
 

@freddydk
Copy link
Contributor

Not sure what is wrong, but the command works just fine with a single app without dependencies:

PS C:\WINDOWS\system32> Convert-BcAppsToRuntimePackages -artifactUrl $ArtifactUrl -apps "C:\Users\freddyk\Downloads\Freddy Kristiansen_BingMaps_16.0.app" -destinationFolder "C:\temp\dest" -includeSourceInPackageFile 1 -skipVerification

Default parameter dns = hostdns
Default parameter updateHosts = True
Default parameter isolation = hyperv
Default parameter memoryLimit = 16G
BcContainerHelper is version 6.0.31-dev
BcContainerHelper is running as administrator
HyperV is Enabled
Host is Microsoft Windows 11 Pro - 10.0.26100.2605
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is allow
UseSslForWinRmSession is True
Docker Client Version is 27.1.2
Docker Server Version is 27.1.2
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
Image my:sandbox-25.2.27733.28948-us already exists
Using image my:sandbox-25.2.27733.28948-us
Adding DNS Servers from host: 192.168.0.1
Creating Container bcserver
Style: sandbox
Multitenant: No
Version: 25.2.27733.28948
Platform: 25.2.28907.0
Generic Tag: 1.0.2.53
Container OS Version: 10.0.20348.2966 (ltsc2022)
Host OS Version: 10.0.26100.2605 (24H2)
Using hyperv isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Additional Parameters:
--volume "C:\Users\freddyk\AppData\Local\Temp\4738d921-239e-4396-b94b-97c88758b732:c:\apps"
--volume "C:\temp\dest:c:\dest"
--env WebClient=N
--env httpSite=N
--expose 5986
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- HelperFunctions.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image my:sandbox-25.2.27733.28948-us
a91a1c0630366ecec355f0c2c7a0226439411661998ef385fa4130fee59db221
Waiting for container bcserver to be ready
Initializing...
Setting host.containerhelper.internal to 172.17.0.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Starting Local SQL Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 111AE6B2847B4126725BD8EFEF930667AFF5F786
DNS identity bcserver
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Enable PSRemoting and setup user for winrm
Creating self-signed certificate for winrm
Container IP Address: 172.17.1.60
Container Hostname  : bcserver
Container Dns Name  : bcserver
Setting bcserver to 172.17.1.60 in host hosts file

Container Total Physical Memory is 16.5Gb
Container Free Physical Memory is 13.9Gb

Initialization took 56 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Cleanup old dotnet core assemblies
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again
Publishing Freddy Kristiansen_BingMaps_16.0.app
Creating Runtime Package Freddy Kristiansen_BingMaps_15.0.71.0.runtime-25.2.27733.28948-us.app
C:\temp\dest
Removing Session bcserver
Removing container bcserver
Removing entries from hosts
Removing bcserver from container hosts file
Removing bcserver-* from container hosts file
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver

Maybe remove the licensefile - that isn't needed anyway

@RalleSP86
Copy link
Author

I tried now the same appfile on a different maschine wich is running windows server 2019 and older version of docker (Docker Client Version 19.03.5, Docker Server Version 19.03.5)
On this maschine the runtime package was created successful.
Maybe is there any problem with current docker version 27.4.0 or a problem with docker desktop on windows 11 enterprise?
Can you check this?
On my local maschine running win 11 enterprise the the error still occurs.

@freddydk
Copy link
Contributor

Windows 11 has problems with process isolation (which I can see you are running) - that might be the issue.
you could try to run this before the command:

$bcContainerHelperConfig.defaultNewContainerParameters = [PSCustomObject]@{"isolation" = "hyperv"}

@RalleSP86
Copy link
Author

thanks for this info.
I tried the hyperV isolation on my local maschine.
This doesn't work. I get the following error:

Default parameter isolation = hyperv
BcContainerHelper is version 6.0.30
BcContainerHelper is running as administrator
HyperV is Enabled
Host is Microsoft Windows 11 Enterprise - 10.0.22631.4602
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is allow
UseSslForWinRmSession is True
Docker Client Version is 27.4.0
Docker Server Version is 27.4.0
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
Image my:onprem-25.2.27733.27999-de already exists
Using image my:onprem-25.2.27733.27999-de
Creating Container bcserver
Style: onprem
Multitenant: No
Version: 25.2.27733.27999
Platform: 25.2.27927.0
Generic Tag: 1.0.2.53
Container OS Version: 10.0.20348.2966 (ltsc2022)
Host OS Version: 10.0.22631.4602 (23H2)
WARNING: You have specified isolation mode hyperv. Container and host OS are 20348 or above, not using SSL, recommended isolation mode is process. If you encounter issues you could t
ry to specify -isolation process (or remove the -isolation parameter).
Using hyperv isolation
Using locale de-DE
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Additional Parameters:
--volume "C:\Users\RalphSchütze\AppData\Local\Temp\95de86af-0ec8-4b62-bddf-f8fdfe83209b:c:\apps"
--volume "C:\temp\RuntimeOnPrem:c:\dest"
--env WebClient=N
--env httpSite=N
--expose 5986
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- HelperFunctions.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatecontainerhosts.ps1
Creating container bcserver from image my:onprem-25.2.27733.27999-de
9220b99faace6ac8c36a455259453c5b67755f69772e4ac333250a1586e45190
New-BcContainer Telemetry Correlation Id: 3aa29f51-087c-4c47-b04b-02eb2d85f590
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver
Convert-BcAppsToRuntimePackages Telemetry Correlation Id: 872e34cd-0dcd-4746-b91d-b032f2c0d230
DockerDo : docker: Error response from daemon: container 9220b99faace6ac8c36a455259453c5b67755f69772e4ac333250a1586e45190 encountered an error during hcs::System::Start: failure in 
a Windows system call: The virtual machine or container exited unexpectedly. (0xc0370106).
ExitCode: 125
Commandline: docker run --env licenseFile="" --name bcserver --hostname bcserver --env auth=NavUserPassword --env username="admin" --env ExitOnError=N --env locale=de-DE --env 
databaseServer="" --env databaseInstance="" --volume "C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper" --volume 
"C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:C:\Run\my" --isolation hyperv --restart unless-stopped --env filesOnly=False --memory 8G --env enableApiServices=Y --env 
useSSL=N --env securePassword=76492d1116743f0423413b16050a5345MgB8AEgANwBqAHYAeABLAEQAcgBLADgAagArAFAAKwBLAGwARgBzAE8AQQAxAFEAPQA9AHwANAA0ADMAYgA2AGQAYQAxAGQAMAAxADUAOQAyAGIAZQBhAGU
AMQBkADAANABlADYANwBhADcAYgAzADQAMgBjADYAZQA5AGMANgBlADcAMgBkAGYAMQAwAGEANABkAGYANAA5ADAAMQAzADMAMgBjAGYAMABlADUANwBhADUAZAA= --env passwordKeyFile="c:\run\my\aes.key" --env 
removePasswordKeyFile=Y --volume "C:\Users\RalphSchütze\AppData\Local\Temp\95de86af-0ec8-4b62-bddf-f8fdfe83209b:c:\apps" --volume "C:\temp\RuntimeOnPrem:c:\dest" --env WebClient=N 
--env httpSite=N --expose 5986 --env accept_eula=Y --env accept_outdated=Y --detach my:onprem-25.2.27733.27999-de
In C:\Program Files\WindowsPowerShell\Modules\bccontainerhelper\6.0.30\ContainerHandling\New-NavContainer.ps1:1862 Zeichen:15
+ ...       if (!(DockerDo -accept_eula -accept_outdated:$accept_outdated - ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants