0

I am running Spring Cloud Skipper behind the NGINX proxy. When I try connecting to the Skipper server using the local shell running on laptop using proxy url,

I get the error: Could not extract response: no suitable HttpMessageConverter found for response type [org.springframework.hateoas.Resources<org.springframework.cloud.skipper.domain.Deployer>] and content type [text/html]
Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.

I have tried the Skipper NGINX proxy urls like . https://example.com/skipper/api/about and https://example.com/skipper/api/deployers on browser and browser developer tools shows that response header is content-type: application/hal+json;charset=UTF-8

Running skipper directly on the host where Skipper server is running with localhost url works fine. Error only happens when accessing through NGINX proxy url.

Could not extract response: no suitable HttpMessageConverter found for response type [org.springframework.hateoas.Resources<org.springframework.cloud.skipper.domain.Deployer>] and content type [text/html]
Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.

org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [org.springframework.hateoas.Resources<org.springframework.cloud.skipper.domain.Deployer>] and content type [text/html]
        at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:121)
        at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:995)
        at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:978)
        at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:737)
        at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710)
        at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:628)
        at org.springframework.hateoas.client.Traverson$TraversalBuilder.toObject(Traverson.java:344)
        at org.springframework.cloud.skipper.client.DefaultSkipperClient.listDeployers(DefaultSkipperClient.java:335)
        at org.springframework.cloud.skipper.shell.command.PlatformCommands.list(PlatformCommands.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:246)
        at org.springframework.shell.Shell.evaluate(Shell.java:180)
        at org.springframework.shell.Shell.run(Shell.java:142)
        at org.springframework.shell.jline.InteractiveShellApplicationRunner.run(InteractiveShellApplicationRunner.java:84)
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804)
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:794)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
        at org.springframework.cloud.skipper.shell.ShellApplication.main(ShellApplication.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) 
lahiruk
  • 433
  • 3
  • 13
Sekhar T
  • 41
  • 6

2 Answers2

1

Root cause for this issue: TLS terminates at the Proxy and Spring Cloud Skipper is running on "http" port behind Nginx proxy. So, spring cloud skipper hateoas generates "http" links instead of "https". When the shell tries to "GET" on the URLS (http) returned by Spring Cloud Skipper hateoas, Proxy is requesting a redirect to https with 308 which is causing the exception.

For time being I have turned off the redirect at Kubernetes Nginx ingress resource level with annotation "nginx.ingress.kubernetes.io/ssl-redirect: false".

I will post more details later when I figure out how to configure the proxy headers to generate "https" urls instead http in Spring Cloud Skipper.

Or another solution could be configure TLS passthrough in Proxy and terminate the TLS at Skipper by enabling TLS in Skipper.

Sekhar T
  • 41
  • 6
  • hi Sekhar . i am hit with the exact same issue . TRied forward-headers= true doesnt seem to help .Were you asble to configure teh proxy headers to genreate https or enable TLS in skipper ? Thanks – Ajith Kannan Nov 03 '19 at 21:27
1

Setting the following property application.yml resolved the issue.

      server:
        use-forward-headers: true
Sekhar T
  • 41
  • 6