microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
379 stars 243 forks source link

Using NewBCcontainerWizard error displayed "The term 'c:\Run\navinstall.ps1' is not recognized..." #3060

Open Vicstar15 opened 1 year ago

Vicstar15 commented 1 year ago

Hello, I'm new with Git and Docker, I'm sorry in advance if I don't explain myself well or say something silly... Trying to create a container with New-BCContainerWizard, the first time it creates the container perfectly and without problem. When I want to create a different container with the same script I always get the following error.

Scripts used to create container and cause the issue

$containerName = 'bctestdevops2'
$auth = 'UserPassword'
$credential = New-Object pscredential 'User', (ConvertTo-SecureString -String 'Password' -AsPlainText -Force)
$artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -country 'es' -select 'Latest'
$licenseFile = "C:\Visual Studio\Proyectos\Licencia_BC\license.bclicense" 
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -memoryLimit 8G `
    -includeTestToolkit `
    -isolation hyperv `
    -updateHosts `

Full output of scripts

BcContainerHelper is version 5.0.2
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
Host is Microsoft Windows 10 Pro - 10.0.19044.2965
Docker Client Version is 23.0.5
Docker Server Version is 23.0.5
Removing entries from hosts
Removing bconprem2 from container hosts file
Removing bconprem2-* from container hosts file
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\bconprem2
Fetching all docker images
Fetching all docker volumes
INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container bconprem2
Style: onprem
Multitenant: No
Version: 22.1.55890.56216
Platform: 22.0.56191.0
Generic Tag: 1.0.2.14
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.2965 (21H2)
Using hyperv isolation
Using locale es-ES
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Visual Studio\Proyectos\Licencia_BC\license.bclicense
Files in C:\ProgramData\BcContainerHelper\Extensions\bconprem2\my:
- AdditionalOutput.ps1
- license.bclicense
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bconprem2 from image mcr.microsoft.com/businesscentral:10.0.19041.1415
8157135a4dd7aa918659c1165b3d799251b08d2d42807722048bfebd2a53cf4f
Waiting for container bconprem2 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/22.1.55890.56216/es
Using installer from C:\Run\210-new
The term 'c:\Run\navinstall.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at <ScriptBlock>, C:\Run\start.ps1: line 242
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/22.1.55890.56216/es
Using installer from C:\Run\210-new
The term 'c:\Run\navinstall.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at <ScriptBlock>, C:\Run\start.ps1: line 242
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: 8e8a5248-b4a2-44ef-810c-167f3fd4b7c7
Initialization of container bconprem2 failed
En C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\5.0.2\ContainerHandling\Wait-NavContainerReady.ps1: 42 Carácter: 17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...conprem2 failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bconprem2 failed
...

Screenshots

Additional context The first time it works perfectly, then the only way to make it work is to factory reset docker. But I can't do that every time I need to create a container.

freddydk commented 1 year ago

The script looks fine. With the symptoms you are talking about, you are likely looking at some problem with Docker and your machine. Are you running Docker Desktop? there might be a new version available? Is the machine OK on diskspace and memory? Is the machine capable of running Windows 11, then that is highly recommended.

Vicstar15 commented 1 year ago

Hi Freddy, Thanks a lot for your time.

I review event log and see these user/password error, the script create the user and password in docker right? Don't know what username/pass is asking for:

exec's CreateProcess() failed [error=container 98d08ac38f2a320db8cc5c111025f8bea875f4eefe5891f3bf86951e3bae19ee encountered an error during hcs::System::CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e) [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF79AF6A40B: (caller: 00007FF79AF25C8B) Exception(2772) tid(398) 8007052E The user name or password is incorrect. CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] Provider: 00000000-0000-0000-0000-000000000000] module=libcontainerd namespace=moby container=98d08ac38f2a320db8cc5c111025f8bea875f4eefe5891f3bf86951e3bae19ee exec=e74690ead46faecde30a816e1aefb5490239909606044fb211abf2718ab02c1a]

Thanks in advance again,