spring-microservices-v2 icon indicating copy to clipboard operation
spring-microservices-v2 copied to clipboard

Open-feign not working with docker, only on local machine

Open ThiagoAnd opened this issue 4 years ago • 4 comments

Hi @in28minutes, I manage to get all the services, naming-server, api-gateway, working together on the local machine. But when I try to run with docker I can't connect the two services. The two services show on naming-server(currency-exchange and currency-conversion), I able to call service inside each one(I did a hello word GET, and can call the alone endpoint on currency-exchange).This also is happening with api-gateway

But when I try to call an endpoint that uses open feign it gives me the error(wait for almost 30 minutes):

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Mar 15 15:57:35 UTC 2021 There was an unexpected error (type=Internal Server Error, status=500).

My docker compose:

version: '3.7'

services: currency-exchange: image: thiagoandradeit/microservicosin28minutes-currency-exchange-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8000:8000" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

currency-conversion: image: thiagoandradeit/microservicosin28minutes-currency-conversion-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8100:8100" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

naming-server: image: thiagoandradeit/microservicosin28minutes-naming-server:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8761:8761" networks: - currency-exchange

networks: currency-exchange:

ThiagoAnd avatar Mar 15 '21 16:03 ThiagoAnd

I faced the same problem and I found out that I was setting: eureka.instance.hostname=localhost in all the application.properties files. After I removed this line and rebuilt the image, the problem disappeared.

dsalehazab avatar Jan 23 '22 18:01 dsalehazab

How you were able to build docker image, because I am not able to create the image and getting build failure as the goal is getting failed.

amitava9018 avatar Feb 26 '23 01:02 amitava9018

Hi @in28minutes, I manage to get all the services, naming-server, api-gateway, working together on the local machine. But when I try to run with docker I can't connect the two services. The two services show on naming-server(currency-exchange and currency-conversion), I able to call service inside each one(I did a hello word GET, and can call the alone endpoint on currency-exchange).This also is happening with api-gateway

But when I try to call an endpoint that uses open feign it gives me the error(wait for almost 30 minutes):

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Mar 15 15:57:35 UTC 2021 There was an unexpected error (type=Internal Server Error, status=500).

My docker compose:

version: '3.7'

services: currency-exchange: image: thiagoandradeit/microservicosin28minutes-currency-exchange-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8000:8000" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

currency-conversion: image: thiagoandradeit/microservicosin28minutes-currency-conversion-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8100:8100" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

naming-server: image: thiagoandradeit/microservicosin28minutes-naming-server:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8761:8761" networks: - currency-exchange

networks: currency-exchange:

Hi @in28minutes, I manage to get all the services, naming-server, api-gateway, working together on the local machine. But when I try to run with docker I can't connect the two services. The two services show on naming-server(currency-exchange and currency-conversion), I able to call service inside each one(I did a hello word GET, and can call the alone endpoint on currency-exchange).This also is happening with api-gateway

But when I try to call an endpoint that uses open feign it gives me the error(wait for almost 30 minutes):

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Mar 15 15:57:35 UTC 2021 There was an unexpected error (type=Internal Server Error, status=500).

My docker compose:

version: '3.7'

services: currency-exchange: image: thiagoandradeit/microservicosin28minutes-currency-exchange-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8000:8000" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

currency-conversion: image: thiagoandradeit/microservicosin28minutes-currency-conversion-service:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8100:8100" networks: - currency-exchange depends_on: - naming-server environment: EUREKA.CLIENT.SERVICE-URL.DEFAULTZONE: http://naming-server:8761/eureka

naming-server: image: thiagoandradeit/microservicosin28minutes-naming-server:0.0.1-SNAPSHOT mem_limit: 700m ports: - "8761:8761" networks: - currency-exchange

networks: currency-exchange:

Did you find the error?

inazumaaa avatar Feb 28 '23 12:02 inazumaaa

I'm struggling with this right now but do not know the solution yet

dancho393 avatar Aug 19 '23 07:08 dancho393