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
SQLSERVER connection error when creating container #3481
Comments
I'm seeing similar problem that all my existing containers that have been running since months cannot connect to my local SQLServer anymore. When I try to setup the container new, I get the same error as mentioned above also I always use $databaseinstance="" |
Hi @freddydk , |
If your existing containers started failing out of the blue, I would look at Windows Updates or updates to SQL Server. |
(almost) all-clear signal... But still my existing dockers are unhealthy ==> I'll try to restart the docker / docker engine / notebook again and see if that helps. |
In my case it has nothing to do with what you are talking about. As soon as we manage to solve it, I will let you know here. |
Hello everyone
I am having a problem trying to create a container with the New-bccontainer helper on my local server with a secondary database instance called MSSQLSERVER2019.
In my script when I leave the $databaseinstance="" parameter empty it creates the container without problems in the main instance called MSSQLSERVER.
But when I leave the parameter $databaseinstance="MSSQLSERVER2019" with the databaseinstance where I want to create the database I get this error:
"Cannot establish a connection to the SQL Server/Database.
This could be due to one of the following reasons:
The container is created and creates a SQLEXPRES inside, also the database is created but it does not connect to the databaseinstance.
From the container if I have access to the ip of the local sql and access the port.
I have checked that the password is correct
Scripts used:
$containerName = 'TestSQL19'
$hostname = $containerName
$name = $containerName
$licensefile = 'C:\license\container.bclicense'
$auth = "UserPassword"
$username = 'alexisadmon'
$password = ConvertTo-SecureString 'mysecurePass' -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($username, $password)
$databaseusername = 'sa'
$databasepassword = ConvertTo-SecureString 'mysecurePass' -AsPlainText -Force
$databasecredential = New-Object System.Management.Automation.PSCredential ($databaseusername, $databasepassword)
$artifactUrl = Get-BCArtifactUrl -country es -type OnPrem -version 22 -select Latest
get-variable -name artifactUrl -valueonly
$databaseParams = @{
"databaseServer" = 'host.containerhelper.internal'
"databaseInstance" = 'MSSQLSERVER19'
"databasePrefix" = "$containerName"
"databaseName" = '_'
"databaseCredential" = $databasecredential
"multitenant" = $false
}
#VARIABLES TRAEFIK********************************************************************************
$restPart = "/$ {name}rest/"
$soapPart = "/$ {name}soap/"
$devPart = "/$ {name}dev/"
$dlPart = "/$ {name}dl/"
$externaldns = 'myexternal.dns.example'
$webclientPart = "/$name/"
$baseUrl = "https://$externaldns"
$restUrl = $baseUrl + $restPart
$soapUrl = $baseUrl + $soapPart
$webclientUrl = $baseUrl + $webclientPart
$customNavSettings = "customnavsettings=PublicODataBaseUrl=$restUrl,PublicSOAPBaseUrl=$soapUrl,PublicWebBaseUrl=$webclientUrl"
$soapRule="PathPrefix:$ {soapPart};ReplacePathRegex: ^${soapPart}(.) /BC/WS/
$dlRule="PathPrefixStrip:$ {dlPart}"
$webclientRule="PathPrefix:$webclientPart"
$1" $restRule="PathPrefix:${restPart};ReplacePathRegex: ^${restPart}(.*) /BC/OData/
$1"$devRule="PathPrefix:${devPart};ReplacePathRegex: ^${devPart}(.) /BC/`$1"
$additionalParameters = @("--hostname $hostname",
"-e webserverinstance=$name",
"-e publicdnsname=$externaldns",
"-e $customNavSettings",
"-l
"traefik.web.frontend.rule=$webclientRule
"","-l
"traefik.web.port=80
"","-l
"traefik.soap.frontend.rule=$soapRule
"","-l
"traefik.soap.port=7047
"","-l
"traefik.rest.frontend.rule=$restRule
"","-l
"traefik.rest.port=7048
"","-l
"traefik.dev.frontend.rule=$devRule
"","-l
"traefik.dev.port=7049
"","-l
"traefik.dl.frontend.rule=$dlRule
"","-l
"traefik.dl.port=8080
"","-l
"traefik.enable=true
"","-l
"traefik.frontend.entryPoints=https
"")
#VARIABLES TRAEFIK********************************************************************************
New-BcContainer @databaseParams -replaceExternalDatabases
-accept_eula
-accept_outdated
-containerName $containerName
-artifactUrl $artifactUrl
-auth $auth
-Credential $credential
-licenseFile $licenseFile
-updateHosts
-includeAL
-imageName 'myimage'
-assignPremiumPlan
-EnableTaskScheduler:$false
-memoryLimit 6G
-additionalParameters $additionalParameters `
-myScripts @("c:\traefikforbc\my\CheckHealth.ps1")
BcContainerHelper is version 6.0.15
NavContainerHelper is running as administrator
Host is Microsoft Windows Server 2019 Version 1809 (OS Build 17763.5458)
Can someone help me?
The text was updated successfully, but these errors were encountered: