Skip to content

Running the sample Pod Logs code: java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close() #86

@sebastienratez

Description

@sebastienratez
final Configuration configuration = Configuration.builder().username(new ConfigurationSupplier<String>() {
            @Override
            public String get() throws IOException {
                return "arn:aws:eks...";
            }
        }).server("https://....us-east-1.eks.amazonaws.com")
            .certificateAuthorityData("...=")
            .namespace("...")
            .token(new ConfigurationSupplier<String>() {
                @Override
                public String get() throws IOException {
                    return "...";
                }
            }).build();

        try (KubernetesClient kc = new KubernetesClient(configuration)) {
            final CoreV1Api api = kc.create(CoreV1Api.class);

            final KubernetesCall<String> podLogCall = api.readNamespacedPodLog(this.podName, this.namespace, new CoreV1Api.ReadNamespacedPodLog().follow(false).pretty("false").timestamps(true));
            System.out.println(podLogCall.get());
        } catch (Exception ex) {
            ex.printStackTrace();
        }

podLogCall.get() fails:


java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close()
        at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:164)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at com.marcnuri.yakc.config.OkHttpClientConfigurator.lambda$initOkHttpClient$2(OkHttpClientConfigurator.java:90)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at com.marcnuri.yakc.config.OkHttpClientConfigurator.lambda$initOkHttpClient$1(OkHttpClientConfigurator.java:84)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
        at okhttp3.RealCall.execute(RealCall.java:81)
        at com.marcnuri.yakc.retrofit.KubernetesHttpCall.executeRaw(KubernetesHttpCall.java:107)
        at com.marcnuri.yakc.retrofit.KubernetesHttpCall.get(KubernetesHttpCall.java:68)
        at com.marcnuri.yakc.retrofit.KubernetesHttpCall.get(KubernetesHttpCall.java:63)
        at com.personetics.sa.bundletool.readers.PodStreamReader.readAndParseLogStream(PodStreamReader.java:48)
        at com.personetics.sa.bundletool.parsers.RequestEventsParser.startProcess(RequestEventsParser.java:34)
        at com.personetics.sa.bundletool.Main.main(Main.java:24)

Using version

0.0.28

of the libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions