Thiago R.
Thiago R.
Explore posts from servers
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
thank you all for checking the post, btw
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
I had to explicitly add an ASPNETCORE_ENVIRONMENT to the docker-compose.yml file
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
I found out that the environment was set to Production after some debugging
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
so, it was actually an IDE thing. Running the containers using the IDE's UI would actually set the environment to development and enable Swagger, for example
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
Actually, I've tried to run busybox and appropriate images for fetching data inside the network, but looks like the response is the same:
docker run --rm --network trsaints-frontend-api_trsaints-network appropriate/curl http://172.18.0.3:8080/swagger

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
docker run --rm --network trsaints-frontend-api_trsaints-network appropriate/curl http://172.18.0.3:8080/swagger

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
curl http://172.18.0.3:8082
telnet 172.18.0.3 8082

curl: (7) Failed to connect to 172.18.0.3 port 8082 after 0 ms: Couldn't connect to server
Trying 172.18.0.3...
telnet: Unable to connect to remote host: Connection refused
curl http://172.18.0.3:8082
telnet 172.18.0.3 8082

curl: (7) Failed to connect to 172.18.0.3 port 8082 after 0 ms: Couldn't connect to server
Trying 172.18.0.3...
telnet: Unable to connect to remote host: Connection refused
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
As the output suggests, the container's address is 172.18.0.3, but any tool that attempts to connect externally just gets refused and fails
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
Docker networking docker network inspect for that docker-compose network is as follows. I just removed the MacAddress parts for security reasons:
[
{
"Name": "trsaints-frontend-api_trsaints-network",
"Id": "233688ab8a5770f3d111211532b94c44d1aba571082730ce255a2d28907fb62a",
"Created": "2024-08-17T11:13:17.240077754-03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"6c88858fcf034d3884d06e6938c1e4a58502611f0f477d95d28e070cd90cacdc": {
"Name": "trsaints-frontend-api-webapi-1",
"EndpointID": "eb2bdfd7b767d1db6d85d6d4181953edd24d5a3f41a53dae69b92e6193c40f52",
"MacAddress": "[Removed from post for security reasons]",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"6ddd6e368a0abd3671753083dc67aaed0be6f543c963c51b6d63c4cc01c3d6de": {
"Name": "trsaints-frontend-api-db-1",
"EndpointID": "6bbb83ee9689601cd27a40eb4e315832405d9ffbb0bc136364da9c1da5298482",
"MacAddress": "[Removed from post for security reasons]",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "trsaints-network",
"com.docker.compose.project": "trsaints-frontend-api",
"com.docker.compose.version": "2.29.1"
}
}
]
[
{
"Name": "trsaints-frontend-api_trsaints-network",
"Id": "233688ab8a5770f3d111211532b94c44d1aba571082730ce255a2d28907fb62a",
"Created": "2024-08-17T11:13:17.240077754-03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"6c88858fcf034d3884d06e6938c1e4a58502611f0f477d95d28e070cd90cacdc": {
"Name": "trsaints-frontend-api-webapi-1",
"EndpointID": "eb2bdfd7b767d1db6d85d6d4181953edd24d5a3f41a53dae69b92e6193c40f52",
"MacAddress": "[Removed from post for security reasons]",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"6ddd6e368a0abd3671753083dc67aaed0be6f543c963c51b6d63c4cc01c3d6de": {
"Name": "trsaints-frontend-api-db-1",
"EndpointID": "6bbb83ee9689601cd27a40eb4e315832405d9ffbb0bc136364da9c1da5298482",
"MacAddress": "[Removed from post for security reasons]",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "trsaints-network",
"com.docker.compose.project": "trsaints-frontend-api",
"com.docker.compose.version": "2.29.1"
}
}
]
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
in the docker-compose file? no effect at all
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
no effect ;/
15 replies
CC#
Created by Thiago R. on 8/17/2024 in #help
Local machine refuses to connect to an ASP.NET Core Web API container
Source Code this is the API source code: https://github.com/trsaints/trsaints-frontend-api The api container's http port is mapping to 8082 becaues I have an apache server running on the host's 8080 port. But that shouldn't be an issue at all, as far as I know. What I've tried until then Also, I've tried the following suggestions from forum posts with related issues: * Checking iptables rules to assure the container address is not being blocked by the host's firewall: sudo iptables -L -v -n | grep 808:
0 0 ACCEPT 6 -- !br-233688ab8a57 br-233688ab8a57 0.0.0.0/0 172.18.0.3 tcp dpt:8080
0 0 ACCEPT 6 -- !br-233688ab8a57 br-233688ab8a57 0.0.0.0/0 172.18.0.3 tcp dpt:8081
0 0 ACCEPT 6 -- !br-233688ab8a57 br-233688ab8a57 0.0.0.0/0 172.18.0.3 tcp dpt:8080
0 0 ACCEPT 6 -- !br-233688ab8a57 br-233688ab8a57 0.0.0.0/0 172.18.0.3 tcp dpt:8081
* Disabling ufw temporarily * Setting ASPNETCORE_URLS to http://+:8080/ * Adding Kestrel:EndPoints:Http:Url=http://+:8080 to docker-compose.yml * Delete the container's and its images to clear any previous data None of the options above had any effect.
15 replies