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
Ocelot Issue while host in docker #1662
Comments
Dear @Shonzon,
By other words, gateway cannot connect to the service behind the docker container ingress.
I do not recommend to use ws-protocol for versions 17-19. You can try to route ws-traffic by Ocelot v15-16 for .NET 3.1. |
Please, use the issue template while creating an issue via pressing the New Issue button! Because you create a bug, you need to:
Also, you need to give details on environment you use, aka Specifications paragraph! P.S. Start using markdown code blocks with correct language to provide nice and easy to read configs in description. |
Have you resolved your Docker issue or haven't? |
Have you find some workaround for the issue? I believe your issue is related to Docker but not to Ocelot. Let's find some workaround within one week please!
|
I'm still having the same issues running this in docker, what's the latest update? |
Solved! First step app.UseHttpsRedirection();
app.UseAuthorization(); Second step {
"Routes": [
{
"DownstreamPathTemplate": "/api/Authenticate/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "authenticationservice",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/Authenticate/{everything}",
"UpstreamHttpMethod": [ "POST", "GET" ]
}
]
} |
@abdulwahid211 Hi Abdul! Also, I doubt docker-compose config. It is always hard to find the root cause when the people copies and pastes logs, configs with bad formatting. Anyway, thanks for your eagle eye! 🦅 |
Hi @Shonzon ! I'm going to close the issue... Good luck in your endeavour with Ocelot! |
After Hosted in Docker Ocelot did not invoke microservices properly : (getting error)
Ocelot.Responder.Middleware.ResponderMiddleware[0]
requestId: 0HMR0TMTEM44N:00000003, previousRequestId: no previous request id, message: Error Code: ConnectionToDownstreamServiceError Message: Error connecting to downstream service, exception: System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (marketservice:7216)
---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Ocelot File :
{
"Routes": [
{
"DownstreamPathTemplate": "/api/Authenticate/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 7217
}
],
"UpstreamPathTemplate": "/api/Authenticate/{everything}",
"UpstreamHttpMethod": [ "POST", "GET" ]
},
{
"DownstreamPathTemplate": "/api/AmountModels/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 7217
}
],
"UpstreamPathTemplate": "/api/AmountModels/{everything}",
"UpstreamHttpMethod": [ "POST", "GET" ]
},
],
"GlobalConfiguration": {
"BaseUrl": "http://apigateway:7215/"
},
"LoadBalancerOptions": {
"Type": "LeastConnection"
}
}
Docker Compose file :
version: '3.4'
services:
marketservice:
image: ${DOCKER_REGISTRY-}marketservice
build:
context: .
dockerfile: MarketServices\Dockerfile
args:
- PROJECT=MarketServices/MarketServices.csproj
ports:
- 7216:80
environment:
- CONFIG_SERVICE_URL=file:C:\app\Shared\appsettings.shared.json
volumes:
- ./Shared:C:\app\Shared
networks:
- mynetwork
apigateway:
image: ${DOCKER_REGISTRY-}apigateway
build:
context: .
dockerfile: APIGateway\Dockerfile
args:
- PROJECT=APIGateway/APIGateway.csproj
environment:
- CONFIG_SERVICE_URL=file:C:\app\Shared\appsettings.shared.json
ports:
- 7215:80
volumes:
- ./Shared:C:\app\Shared
networks:
- mynetwork
authenticationservice:
image: ${DOCKER_REGISTRY-}authenticationservice
build:
context: .
dockerfile: AuthenticationService\Dockerfile
args:
- PROJECT=AuthenticationService/AuthenticationService.csproj
ports:
- 7217:80
environment:
- CONFIG_SERVICE_URL=file:C:\app\Shared\appsettings.shared.json
volumes:
- ./Shared:C:\app\Shared
networks:
- mynetwork
The text was updated successfully, but these errors were encountered: