Skip to content
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

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

Open
ThiagoAnd opened this issue Mar 15, 2021 · 4 comments
Open

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

ThiagoAnd opened this issue Mar 15, 2021 · 4 comments

Comments

@ThiagoAnd
Copy link

ThiagoAnd commented Mar 15, 2021

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:

@dsalehazab
Copy link

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.

@amitava9018
Copy link

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.

@inazumaaa
Copy link

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?

@dancho393
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants