Closed jacquelinebuettner closed 1 year ago
We've again checked for the firewall and disabled everything without any difference. We also changed $databaseServer = 'host.containerhelper.internal' to $databaseServer = '.' (and 'localhost'). However, the error message remains the same.
Try $databaseServer = 'host.containerhelper.internal' $databaseInstance = 'MSSQLSERVER01'
Thanks for the hint. Unfortunately this doesn't change the error message.
Ok, so I started from scratch with different image and container names. I changed the databse user, deactivated the firewall again and lastly tried to ping "host.containerhelper.internal". That name however cannot be found. From the script it reads: Setting host.containerhelper.internal to 172.21.32.1 in container hosts file I can ping host.docker.internal, gateway.docker.internal and kubernetes.docker.internal and I find all of these in my hosts file. There ist however no entry host.containerhelper.internal. Should there be one?
For testing purposes I simply added the suspect line to the hosts file.
The Output now changed to
at
at
at
at
Adding BUSINESSCENTRAL to hosts file
Initializing...
Cannot find path 'C:\run\my\aes.key' because it does not exist.
at
at
as a long shot - could you try to add -isolation hyperv?
Hi Freddy, I'm having the same issue. Already tried a lot of things I found, like disabling the Firewall and Windows Defender, activated TCP/IP, started the previously deactivated SQL Browser and finally -isolation hyperv. Unfortunatel I'm still getting the error. Here is my script and the output:
`$accept_eula = $true $containername = 'bc-dev' $licenseFile = '' $auth = 'UserPassword' $usessl = $false $updateHosts = $true $assignPremiumPlan = $false $shortcuts = 'Desktop' $password = ConvertTo-SecureString "X" -AsPlainText -Force $dbPassword = ConvertTo-SecureString "X" -AsPlainText -Force $integrationUserCreds = New-Object System.Management.Automation.PSCredential ("X", $password) $databaseCreds = New-Object System.Management.Automation.PSCredential ("sa", $dbPassword)
$artifactUrl = Get-BcArtifactUrl -country 'DE' -select 'Latest'
New-BcContainer -accept_eula:$accept_eula -replaceExternalDatabases
-containername $containername -artifactUrl $artifactUrl
-auth $auth -Credential $integrationUserCreds
-usessl:$usessl -updateHosts:$updateHosts
-licenseFile $licenseFile -assignPremiumPlan:$assignPremiumPlan
-isolation Process -shortcuts $shortcuts
-databaseServer 'host.containerhelper.internal' -databaseInstance "SQLExpress"
-databasePrefix "$containerName-" -databaseName "DB"
-databaseCredential $databaseCreds -multitenant: $true
`Using artifactUrl https://bcartifacts.azureedge.net/sandbox/21.2.49946.51081/de Using installer from C:\Run\210-new Installing Business Central Installing from artifacts Starting Local SQL Server Starting Internet Information Server Copying Service Tier Files c:\dl\sandbox\21.2.49946.51081\platform\ServiceTier\Program Files c:\dl\sandbox\21.2.49946.51081\platform\ServiceTier\System64Folder Copying PowerShell Scripts c:\dl\sandbox\21.2.49946.51081\platform\WindowsPowerShellScripts\Cloud\NAVAdministration c:\dl\sandbox\21.2.49946.51081\platform\WindowsPowerShellScripts\WebSearch Copying Web Client Files c:\dl\sandbox\21.2.49946.51081\platform\WebClient\Microsoft Dynamics NAV Copying ModernDev Files c:\dl\sandbox\21.2.49946.51081\platform c:\dl\sandbox\21.2.49946.51081\platform\ModernDev\program files\Microsoft Dynamics NAV Copying additional files Copying ConfigurationPackages C:\dl\sandbox\21.2.49946.51081\de\ConfigurationPackages Copying Test Assemblies C:\dl\sandbox\21.2.49946.51081\platform\Test Assemblies Copying Extensions C:\dl\sandbox\21.2.49946.51081\de\Extensions Copying Applications C:\dl\sandbox\21.2.49946.51081\platform\Applications Copying Applications.DE C:\dl\sandbox\21.2.49946.51081\de\Applications.DE Copying dependencies Copying ReportBuilder Importing PowerShell Modules Skipping restore of Cronus database Modifying Business Central Service Tier Config File for Docker Creating Business Central Service Tier Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll' Installation took 27 seconds Installation complete Initializing... Setting host.docker.internal to 192.168.0.101 in container hosts file (copy from host hosts file) Setting gateway.docker.internal to 192.168.0.101 in container hosts file (copy from host hosts file) Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file) Setting host.containerhelper.internal to 172.21.112.1 in container hosts file Starting Container Hostname is bc-dev PublicDnsName is bc-dev Using NavUserPassword Authentication Waiting for database creation to finish Success Import Encryption Key Es kann keine Verbindung mit SQL Server/der SQL-Datenbank hergestellt werden.
Dies kann unter anderem folgende Gr├╝nde haben:
Versuchen Sie es später erneut, oder wenden Sie sich an den Systemadministrator.
at
+ CategoryInfo : OperationStopped: (Initialization ...r bc-dev failed:String) [], RuntimeException
+ FullyQualifiedErrorId : Initialization of container bc-dev failed`
We came to the conclusion that our network / firewall setup is the cause of the problems. It seems that the database must be avaialable openly from the internet (intranet is not sufficient). Which we really do not want, if we host the database server on the developers machine. Therefore we set up a server with less restrictions and now start the containers from there. Not what we yielded at, but no other way worked.
I got it working now. The missing piece was that SQL Server Express 2019 was not listening on port 1433. After setting that port for IPAll in the SQL Server Configuration Manager it did work!
Cannot connect to SQL Server We want to start an instance of Business Central (onprem) with a database hosted locally. We are running a SQL Server 2019 with a database restored from a backup file. The database server has TCP/IP activated and is configured for mixed mode authentication. I can connect to the database directly and via a command like: Invoke-SQLcmd -ServerInstance ".\MSSQLSERVER01" -Database "mydb" -Query "Select * from [Company]" -Username "someuser" -Password "aPasswd"
However, we get "Cannot connect to SQL Server". We are setting this up for the first time. We would appreciate any hint what we might be missing.
Scripts used to create container and cause the issue
Full output of scripts