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

[fetchers] gravitee-fetcher-http does not work with Envoy #2380

Closed
piotrekfilip opened this issue Jun 17, 2019 · 1 comment

Comments

@piotrekfilip
Copy link

commented Jun 17, 2019

"Create an API" with "IMPORT FROM LINK", does not work with link poiniting to server behind envoy proxy.

Expected Behavior

Gravitee-fetcher-http successfully fetches content from server behind envoy proxy.

Current Behavior

"Create an API" with "IMPORT FROM LINK", does not work with link poiniting to server behind envoy proxy.
It throws following exception:

19:18:31.371 [gravitee-listener-36] ERROR i.g.m.service.impl.PageServiceImpl - An error occurs while trying to create Page{name='Swagger', type='SWAGGER', order='1', homepage='false', lastContributor='null'}
io.gravitee.fetcher.api.FetcherException: Unable to fetch Http content (Unable to fetch Http content 'http://127.0.0.1:8080/swagger-ui/petstore.json': no content)
(...)
Caused by: io.gravitee.fetcher.api.FetcherException: Unable to fetch Http content (Unable to fetch Http content 'http://127.0.0.1:8080/swagger-ui/petstore.json': no content)
	at io.gravitee.fetcher.http.HttpFetcher.fetch(HttpFetcher.java:95)
	at io.gravitee.management.service.impl.PageServiceImpl.fetchPage(PageServiceImpl.java:338)
	... 119 common frames omitted
Caused by: io.gravitee.fetcher.api.FetcherException: Unable to fetch Http content 'http://127.0.0.1:8080/swagger-ui/petstore.json': no content
	at io.gravitee.fetcher.http.HttpFetcher.fetch(HttpFetcher.java:89)
	... 120 common frames omitted

I can open the same link with browsers, curl etc. without problems, but gravitee-fetcher-http makes a little bit different request: it sends absolute URI, and envoy returns 404:

envoy_1    | [2019-06-17T19:16:41.962Z] "GET /swagger-ui/petstore.json HTTP/1.1" 200 - 0 3221 0 0 "-" "Apache-HttpClient/Swagger" "309a4659-e293-4694-bfee-39147a46df71" "127.0.0.1:8080" "172.18.0.3:8080"
envoy_1    | [2019-06-17T19:18:31.007Z] "GET /swagger-ui/petstore.json HTTP/1.1" 200 - 0 3221 0 0 "-" "Apache-HttpClient/Swagger" "5fd2cf42-4aeb-4ee7-90f7-9dfad101c8db" "127.0.0.1:8080" "172.18.0.3:8080"
envoy_1    | [2019-06-17T19:18:31.343Z] "GET http://127.0.0.1:8080/swagger-ui/petstore.json HTTP/1.1" 404 - 0 0 21 - "-" "-" "-" "127.0.0.1:8080" "-"

Possible Solution

Make requests with relative URI.

Steps to Reproduce (for bugs)

  1. Download files from gist https://gist.github.com/piotrekfilip/8974bf7a88de663f367d0cd089af02bf
  2. Run them with docker-compose up
  3. Go to gravitee http://MANAGEMENT_UI_SERVER_DOMAIN/#!/management/apis/new, choose "Import from link", enter http://127.0.0.1:8080/swagger-ui/petstore.json and click IMPORT.

Context

Trying to use Gravitee.io with Istio/Envoy.

Your Environment

  • Version used: docker, tag 1.26.1

brasseld added a commit to gravitee-io/gravitee-fetcher-http that referenced this issue Jun 17, 2019

fix(http): Use relative URI instead of the absolute since host and po…
…rt are settled by default at the client level.

Closes gravitee-io/issues#2380

@brasseld brasseld self-assigned this Jun 17, 2019

@brasseld brasseld added this to the APIM - 1.27.0 milestone Jun 17, 2019

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 17, 2019

Nice shot @piotrekfilip !

Will be fixed in upcoming 1.27.0

aelamrani added a commit to gravitee-io/gravitee-fetcher-http that referenced this issue Jun 18, 2019

fix(http): Use relative URI instead of the absolute since host and po…
…rt are settled by default at the client level.

Closes gravitee-io/issues#2380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.