Closed petegonnella closed 3 days ago
I think the problem here is PS5/PS7 I assume that your script also doesn't work with BC 24?
@freddydk BC24 is working fine, just tried with the https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/25.0.23364.25044/w1 artifacts.
@freddydk BC24 is working fine, just tried with the https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/25.0.23364.25044/w1 artifacts.
I also tried executing using Powershell 7.4.5 on host machine, still doesn't work for BC25
I tried this script on my machine:
$containerName = "bcserver"
$credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'mypassword' -AsPlainText -Force)
$artifactUrl = Get-BCArtifactUrl -country us -select latest
$artifactLocation = Download-Artifacts -artifactUrl $artifactUrl -includePlatform
$licenseFile = (Get-ChildItem -Path $artifactLocation[0] -Recurse -Filter '*.bclicense')[0].FullName
$databaseSecurePassword = ConvertTo-SecureString -String 'mypassword' -AsPlainText -Force
$databaseParams = @{
"databaseServer" = 'host.containerhelper.internal'
"databaseInstance" = ''
"databasePrefix" = $containerName
"databaseName" = '.containers.local'
"databaseCredential" = New-Object pscredential 'sa', $databaseSecurePassword
"multitenant" = $true
}
New-BcContainer @databaseParams -replaceExternalDatabases `
-accept_eula `
-artifactUrl $artifactUrl `
-containerName $containerName `
-auth UserPassword `
-Credential $credential `
-licenseFile $licenseFile `
-enableTaskScheduler -alwaysPull
Which works fine - so there is nothing wrong with BC25, docker and SQL on the host.
You are however restoring the databases in a different way, which might cause this. The problem might be that the SetupDatabase and SetupTenant scripts are running in PS5 inside the container - maybe you should do the database restore before creating the container and then just create a container pointing to the database.
I can see you are using an old generic image for BC - please try to all -alwayspull
The next BcContainerHelper preview will include a mechanism to add -alwaysPull if the generic image isn't at least as new as BcContainerHelper.
I can see you are using an old generic image for BC - please try to all -alwayspull
The next BcContainerHelper preview will include a mechanism to add -alwaysPull if the generic image isn't at least as new as BcContainerHelper.
thanks @freddydk this was the solution 👍
Describe the issue Error creating BC25 container with database on host machine
Scripts used to create container and cause the issue
Full output of scripts
Additional context This happens all the time when creating BC25 container with external SQL database