These are chat archives for spring-cloud/spring-cloud

7th
Dec 2017
Tyler Thrailkill
@snowe2010
Dec 07 2017 01:07

I'm attempting to use

<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-kubernetes</artifactId>
        <version>0.2.0.RELEASE</version>
</dependency>

but i'm getting this error

WARN: zip file is empty: /Users/tylerthrailkill/.m2/repository/com/squareup/okhttp3/okhttp/3.6.0/okhttp-3.6.0.jar
java.util.zip.ZipException: zip file is empty
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    at java.util.zip.ZipFile.<init>(ZipFile.java:155)
    at java.util.zip.ZipFile.<init>(ZipFile.java:126)
    at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:53)
    at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:47)
    at com.intellij.util.io.FileAccessorCache.createHandle(FileAccessorCache.java:66)
    at com.intellij.util.io.FileAccessorCache.get(FileAccessorCache.java:52)
    at com.intellij.openapi.vfs.impl.ZipHandler.getCachedZipFileHandle(ZipHandler.java:112)
    at com.intellij.openapi.vfs.impl.ZipHandler.createEntriesMap(ZipHandler.java:87)
    at com.intellij.openapi.vfs.impl.ArchiveHandler.getEntriesMap(ArchiveHandler.java:190)
    at com.intellij.openapi.vfs.impl.jar.CoreJarHandler.<init>(CoreJarHandler.java:42)
    at com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem$1.create(CoreJarFileSystem.java:37)
    at com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem$1.create(CoreJarFileSystem.java:33)
    at com.intellij.util.containers.FactoryMap.get(FactoryMap.java:58)
    at com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem.findFileByPath(CoreJarFileSystem.java:50)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.findJarRoot(KotlinCoreEnvironment.kt:342)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.contentRootToVirtualFile(KotlinCoreEnvironment.kt:324)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.access$contentRootToVirtualFile(KotlinCoreEnvironment.kt:113)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$4.invoke(KotlinCoreEnvironment.kt:209)
I can't tell if this is a kotlin error or a spring problem.
Tyler Thrailkill
@snowe2010
Dec 07 2017 01:29
nvm my maven repo was corrupted.
Ziemowit
@Ziemowit
Dec 07 2017 12:24

Hmm after updade to spring--boot = 1.5.9 and spring-cloud = Edgware I am getting

o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
        at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:426) 
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

Anyone had similar case?

NOTHING besides versions changed on my site.
Dave Syer
@dsyer
Dec 07 2017 13:24
I never saw that. You'll have to be a bit more specific about how it happens, steps to reproduce etc.
Ziemowit
@Ziemowit
Dec 07 2017 13:27
Yeah for me it is also weird. Will try to find sth what can be a starting point O_o
Ziemowit
@Ziemowit
Dec 07 2017 13:33
Ok I have found 2 things:
  1. It might be related to this:
    With previous versions the eureka config was following:
      <port enabled="false">8765</port>
      <securePort enabled="true">443</securePort>
    After update to higher version it is
      <port enabled="false">8765</port>
      <securePort enabled="true">8765</securePort>
This is difference which I see after "curl localhost:XXXX/eureka/apps"
So secure/not-secure ports were set on the same value. Seems like inconsistence in configuration between versions.
  1. I manage to solve that (just change in configuration file) by
    eureka:
    instance:
     nonSecurePortEnabled: false
     securePortEnabled: true
     ...
     secure-port: 443
    but now I see that my bug which I have gave to spring-cloud-security is still open and my JWT oauth2 tokens are still not honored and I am getting
{
"error": "invalid_token",
"error_description": "Cannot convert access token to JSON"
}
Dave Syer
@dsyer
Dec 07 2017 13:41
Was that a bug that was closed as fixed?
Ziemowit
@Ziemowit
Dec 07 2017 13:46
So I think here are 2 things:
1st - After upgrade to newer version the configuration for Eureka works a little bit different and applies the "server.port" to "eureka secure/not-secure ports". Previously the port was applied only to eureka non-secure port.
And because of that I had above problems. Because secure/non-secure ports were set to the same value.
2nd - After fixing it up I see that there is still problem with parsing JWT OAuth tokens on @ResourceServer. But this bug is still open on spring cloud security so it is clear for me that still does not work
I will try to confirm 1st case. Then I will arise question/bug on spring cloud eureka.
Tyler Thrailkill
@snowe2010
Dec 07 2017 15:13
I'm attempting to get zuul to find kubernetes services using the service name (or pod/container name, it doesn't matter), but I receive the error:
Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: iam-service
    at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:468) ~[ribbon-loadbalancer-2.2.0.jar!/:2.2.0]
    at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.2.0.jar!/:2.2.0]
    at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.2.0.jar!/:2.2.0]
    at rx.Observable.unsafeSubscribe(Observable.java:8460) ~[rxjava-1.1.5.jar!/:1.1.5]
    at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94) ~[rxjava-1.1.5.jar!/:1.1.5]
    at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42) ~[rxjava-1.1.5.jar!/:1.1.5]
I see that there is a https://github.com/spring-cloud-incubator/spring-cloud-kubernetes project, and I've been trying to use it, but I do not understand what configuration needs to be done to just be able to retrieve the kubernetes registry
Dave Syer
@dsyer
Dec 07 2017 15:26
That project includes a DiscoveryClient implementation.
So I guess it should work as long as you don't have any conflicting implementations.
Tyler Thrailkill
@snowe2010
Dec 07 2017 15:28
do I need to specify a DiscoveryClient bean somewhere?
I see it being autowired in the examples, but I have no need for an autowired version, I just need zuul to resolve the registry properly
Dave Syer
@dsyer
Dec 07 2017 15:30
You shouldn't need to create it manually. Unless the k8s project works differently than everything else (seems unlikely)
I guess you would need to a) check that the DiscoveryClient is the right implementation, b) look at the implementation and make sure it is doing what you expect.
Tyler Thrailkill
@snowe2010
Dec 07 2017 16:15
@dsyer not sure what you mean by "check that the DiscoveryClient is the right implementation"
Yogendra Mishra
@imyom25
Dec 07 2017 17:38
As Suggestion (In Fun way):- I know it not possible but since spring cloud community is very active and releases are coming very fast with new train station version [Edgware being latest] . We should also think of update these cloud version via single action like /refresh, As people are having multiple microservices projects and we have to do it in every service. [Something what I faced today] . Thanks
Tyler Thrailkill
@snowe2010
Dec 07 2017 17:39
@dsyer It finally worked. I just needed to include the ribbon dependency as well
Dave Syer
@dsyer
Dec 07 2017 17:52
Cool.
@imyom25 I don't know what you mean. It's not very clear what you want, but it sounds a bit like Spring Cloud Bus.