Containers cannot talk each other

Currently reading
Containers cannot talk each other

7
0
NAS
DS218+
I have two containers: ASP.NET Core app (name: DockerApp) and an MSSQL Server (name: DockerSQLServer). They are on the same custom network (name: backend).
But when DockerApp tries connect to the DockerSQLServer it encounters an error:

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

The connection string is correct, I suppose: Server=DockerSQLServer,1433;Database={database};MultipleActiveResultSets=true;User Id=sa;Password={password}

If I do the same in Windows 10 Docker, it works well.
 
I have two containers: ASP.NET Core app (name: DockerApp) and an MSSQL Server (name: DockerSQLServer). They are on the same custom network (name: backend).
But when DockerApp tries connect to the DockerSQLServer it encounters an error:

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

The connection string is correct, I suppose: Server=DockerSQLServer,1433;Database={database};MultipleActiveResultSets=true;User Id=sa;Password={password}

If I do the same in Windows 10 Docker, it works well.
Do you get the same error with Server=NASIPADDRESS?
 
Do you get the same error with Server=NASIPADDRESS?
No, I don't.
Additional information, the DockerSQLServer was created like this:
docker run -d --name DockerSQLServer--network=backend --restart=unless-stopped -v sqlvolume:/var/opt/mssql -e "ACCEPT_EULA=Y" -e "SA_PASSWORD={password}" -e "MSSQL_PID=Express" -p 1434:1433 -d mcr.microsoft.com/mssql/server:2019-latest
 
Well ofc. That’s the port sql container is running on your nas. What other port did you expect?
Right, I shouldn't expect other port. But I assume that DockerApp should be able to connect to DockerSQLServer inside the Docker on port 1433. Or am I wrong?
 
Well docker internal DNS is probably working fine, so this leaves port problem (doubt it considering they are in the same isolated network) or something that's more likely and that would be SQL configuration.

Would suggest to try enabling both named pipes and tcpip in sql server or set and configure a host file on your APP container that will point a name of your choice for that SQL container to its IP address. See if that will help.

This is a common problem when it comes to SQL instance resolution (named pipes and tcpip).
 
Well docker internal DNS is probably working fine, so this leaves port problem (doubt it considering they are in the same isolated network) or something that's more likely and that would be SQL configuration.

Would suggest to try enabling both named pipes and tcpip in sql server or set and configure a host file on your APP container that will point a name of your choice for that SQL container to its IP address. See if that will help.

This is a common problem when it comes to SQL instance resolution (named pipes and tcpip).
Thx for te help.
"Would suggest to try enabling both named pipes and tcpip in sql server "
How could i do this in the container? I dont't find any solution.
 
Thx for te help.
"Would suggest to try enabling both named pipes and tcpip in sql server "
How could i do this in the container? I dont't find any solution.
Running it via CLI should run. Powershell command/script could work. Consult some links and methods discussed here.

 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Oh, I see! That does appear to be a lot easier. Thanks for your reply! (y)
Replies
8
Views
3,076
Well, that's the reason as you already noticed. So you haven't migrated the @docker content? Do you have...
Replies
5
Views
1,965
ye, feels like routing issue. Internet connection is working until tunnel is up. After that tunnel seems...
Replies
26
Views
5,275
Well, I just took a dive into the steps because I used the automated script and I think Pullio bricked...
Replies
6
Views
3,876
Question! maybe someone know if it is possible... At the moment I'm using VDSM as a VPN Gateway for my...
Replies
8
Views
6,605
I want to be able to deploy Docker containers on a seperate Ubuntu VM I have running on my DS718+ . But I...
Replies
0
Views
3,550

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top