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

[QUESTION] Problem connecting to an SQL Express database on the docker host #3671

Open
ChrisChristophers opened this issue Sep 18, 2024 · 5 comments

Comments

@ChrisChristophers
Copy link

ChrisChristophers commented Sep 18, 2024

Hi

I am having issues to setup BC with an SQL Express DB on the docker host.
I am using following script:

New-BCContainer `
    -accept_eula `
    -containerName $containerName `
    -multitenant:$multitenant `
    -updateHosts `
    -artifactUrl $20ArtifactUrl `
    -memoryLimit 10G `
    -EnableTaskScheduler:$false `
    -licenseFile $partnerLicense `
    -auth NavUserPassword `
    -Credential $databaseCredential `
    -databaseServer '172.31.64.1' `
    -databaseInstance 'SQLEXPRESS' `
    -databaseName $databaseName `
    -databaseCredential $databaseCredential `
    -accept_outdated `
    -shortcuts None `
    -alwaysPull `  

This is the Host & SQL Info:

image

image

image

This is the Error Msg.

image

Help would be appreciated.

@KristofKlein
Copy link

I would start with:
can you ping the host from within the container on that IP?
else with bccontainerhelper you get a dns entry within the container that you can use :
host.containerhelper.internal try to use that instead.

Furthermore you can check in the logs of the SQL server if the container service is even reaching the DB ?
if the container reached a running state you might also connect into it and make use of invoke-sqlcmd to try out the accessibility with that.

@ChrisChristophers
Copy link
Author

If i start a cronus container , i can ping the host. I also tried setting -databaseServer 'host.containerhelper.internal' ` , unfortunately to no avail. Maybe for whatever reason the service has trouble connecting to the SQLEXPRESS instance?

Also , i have a database on another machine ( not the host ) to which i can connect without any issues. The difference is that it's a regular SQL Server without a instance name so i can omit it.

@KristofKlein
Copy link

well, if it is a service issue: event log or try to play with invoke-sqlcmd and see if you can connect to the DB at all and maybe get some more meaningful error from it .

@left-code
Copy link
Contributor

I would try to set -databaseServer '172.31.64.1\SQLEXPRESS' and omit instance name as parameter.

@freddydk
Copy link
Contributor

freddydk commented Sep 30, 2024

Did you manually restore your database to the database server on the host?
Does the database with $databaseName already exist?

If you want BcContainerHelper to generate the database for you, you need to specify -replaceExternalDatabases !

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

No branches or pull requests

4 participants