-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cannot exec from one pod to another #180
Comments
Can you send a PR with that change? Thanks |
will get to this shortly |
set BearerToken in buildRequest fixes #180
For those who stumble onto this issue while googling as I did I think this problem also impacts port-forwarding. --> GET https://169.46.7.238:22285/api/v1/namespaces/waca-perf-test/pods/waca-perf-test/portforward?ports=8080&ports=9300 HTTP/1.1
X-Stream-Protocol-Version: v4.channel.k8s.io,v3.channel.k8s.io,v2.channel.k8s.io,channel.k8s.io
User-Agent: Swagger-Codegen/1.0-SNAPSHOT/java
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: Xkr3fLWGMIG4Z/iAZB0vZw==
Sec-WebSocket-Version: 13
--> END GET
<-- HTTP/1.1 403 Forbidden (357ms)
Content-Type: text/plain
X-Content-Type-Options: nosniff
Date: Mon, 19 Mar 2018 01:58:58 GMT
Content-Length: 86
OkHttp-Sent-Millis: 1521424738263
OkHttp-Received-Millis: 1521424738321
Exception in thread "OkHttp Dispatcher" java.lang.NullPointerException
at com.squareup.okhttp.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:223)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:232)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.access$100(Call.java:35)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:171)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) I'll try to run a test using the edit proposed in #180 (comment) in the morning. I looked around but could not find a |
We're putting together a release of the beta3 to Maven central.
For now you need to build it yourself.
…________________________________________
From: Greg Lanthier <notifications@github.com>
Sent: Sunday, March 18, 2018 7:19 PM
To: kubernetes-client/java
Cc: Brendan Burns; State change
Subject: Re: [kubernetes-client/java] cannot exec from one pod to another (#180)
For those who stumble onto this issue while googling as I did I think this problem also impacts port-forwarding.
--> GET https://169.46.7.238:22285/api/v1/namespaces/waca-perf-test/pods/waca-perf-test/portforward?ports=8080&ports=9300 HTTP/1.1
X-Stream-Protocol-Version: v4.channel.k8s.io,v3.channel.k8s.io,v2.channel.k8s.io,channel.k8s.io
User-Agent: Swagger-Codegen/1.0-SNAPSHOT/java
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: Xkr3fLWGMIG4Z/iAZB0vZw==
Sec-WebSocket-Version: 13
--> END GET
<-- HTTP/1.1 403 Forbidden (357ms)
Content-Type: text/plain
X-Content-Type-Options: nosniff
Date: Mon, 19 Mar 2018 01:58:58 GMT
Content-Length: 86
OkHttp-Sent-Millis: 1521424738263
OkHttp-Received-Millis: 1521424738321
Exception in thread "OkHttp Dispatcher" java.lang.NullPointerException
at com.squareup.okhttp.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:223)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:232)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.access$100(Call.java:35)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:171)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I'll try to run a test using the edit proposed in #180 (comment)<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.luolix.top%2Fkubernetes-client%2Fjava%2Fissues%2F180%23issue-295276770&data=04%7C01%7Cbburns%40microsoft.com%7C1f81801b01c4404dedfc08d58d3fe500%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636570227922609250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=51wIzzR2Jg5c64X265RanC1s978p4F1x8a8Q%2BpvCSNw%3D&reserved=0> in the morning.
I looked around but could not find a io.kubernetes:client-java:1.0.0-beta3-SNAPSHOT in a repo anywhere. Are SNAPSHOT builds of the io.kubernetes:client-java library produced / available?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.luolix.top%2Fkubernetes-client%2Fjava%2Fissues%2F180%23issuecomment-374082291&data=04%7C01%7Cbburns%40microsoft.com%7C1f81801b01c4404dedfc08d58d3fe500%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636570227922609250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=kneKP6EOy%2B%2BwhRlqr7JKKt7ygRfdGVmvZN%2F9xhO3GBc%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.luolix.top%2Fnotifications%2Funsubscribe-auth%2FAFfDgpd9i7IpS9AaHrdCKcqaNTClx92Hks5tfxXFgaJpZM4R9Ui2&data=04%7C01%7Cbburns%40microsoft.com%7C1f81801b01c4404dedfc08d58d3fe500%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636570227922609250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=pz9d7N6EvQ6ZJVw%2B6vmltSaD6BBi75aB69hEegsDg%2Bs%3D&reserved=0>.
|
Thanks @brendanburns! I did run my test this afternoon with a local build from HEAD and confirmed that the changes from PR #202 corrects the problem I was seeing. |
I still have the same problem even I use 5.0.0-SNAPSHOT <-- HTTP/1.1 403 Forbidden (62ms) |
could anyone help? |
Facing the same error : java.net.ProtocolException: Expected HTTP 101 response but was '403 Forbidden' at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:123) at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:40) at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:98) at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177) at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Any help would be much appreciated!! |
I am trying to copy from one pod to another using InputStream dataStream = copy.copyFileFromPod(namespacename, podname, filePathToCopy); If My application is running from my system, then only one pod comes into picture, my application running locally in my laptop is able to read the file from pod. if I convert my application into container and run as pod the communication breaks |
The exec call worked via the api when calling the api from outside of k8s but not when running from within a pod. Other api calls like set label, watch pod/namespace work.
Also exec as the user from command line works:
But from the api :
If I enable debug on the client via
client.setDebugging(true)
we see
Compared with a list pods it is missing the
Bearer
token.The
ProtocolException
is not being logged presumably due to theNullPointerException
.This change seems to have worked around for me.
The text was updated successfully, but these errors were encountered: