omrikiei / ktunnel

A cli that exposes your local resources to kubernetes
GNU General Public License v3.0
913 stars 71 forks source link

ktunnel expose throws exception: failed parsing session uuid from stream, skipping error="invalid UUID length: 0" session= #88

Open pietervdheijden opened 1 year ago

pietervdheijden commented 1 year ago

I'm trying to expose a local microservice on port 8080 in my cluster on port 80 via ktunnel:

ktunnel expose app 80:8080 -v

However, this throws the following exception:

INFO[0000] Exposed service's cluster ip is: 10.0.244.123 .INFO[0000] waiting for deployment to be ready ...... INFO[0002] port forwarding to https://controlplane.io:443/api/v1/namespaces/default/pods/app-99b5c8479-f8c55/portforward INFO[0002] Waiting for port forward to finish INFO[0002] Forwarding from 127.0.0.1:28688 -> 28688 Forwarding from [::1]:28688 -> 28688 INFO[2022-09-01 14:44:09.131] starting tcp tunnel from source 80 to target 8080 DEBU[2022-09-01 14:44:09.156] attempting to receive from stream ERRO[2022-09-01 14:44:09.170] failed parsing session uuid from stream, skipping error="invalid UUID length: 0" session= INFO[2022-09-01 14:44:09.170] new connection port=8080 session= DEBU[2022-09-01 14:44:09.171] received 0 bytes from server session=00000000-0000-0000-0000-000000000000 DEBU[2022-09-01 14:44:09.171] attempting to receive from stream INFO[2022-09-01 14:44:09.171] closing listener on 8080 error="context canceled" DEBU[2022-09-01 14:44:09.171] started reading conn session=00000000-0000-0000-0000-000000000000

ktunnel does work though when exposing on port 8080:

ktunnel expose app 8080:8080 -v

Output:

INFO[0000] Exposed service's cluster ip is: 10.0.232.32 .INFO[0000] waiting for deployment to be ready .... INFO[0001] port forwarding to https://controlplane.io:443/api/v1/namespaces/default/pods/app-76f85f96f5-x5zf7/portforward INFO[0001] Waiting for port forward to finish INFO[0002] Forwarding from 127.0.0.1:28688 -> 28688 Forwarding from [::1]:28688 -> 28688 INFO[2022-09-01 14:46:42.504] starting tcp tunnel from source 8080 to target 8080 DEBU[2022-09-01 14:46:42.531] attempting to receive from stream

My preliminary conclusion is that ktunnel doesn't work on low ports (80, 81, etc.), but does work on high ports (8080, 8081).

I'm using ktunnel version 1.4.8 on WSL2 (Ubuntu 20.04).

stb1337 commented 1 year ago

@pietervdheijden i also came to this conclusion https://github.com/omrikiei/ktunnel/issues/66

freshteapot commented 1 year ago

I can confirm, I suffered with this exact issue yesterday.

Info

andrey-bondar commented 1 year ago

The same problem after upgrading to 1.4.8. I downgraded to 1.4.7 and everything is ok.

alexef commented 5 months ago

also having this issue

andrey-bondar commented 4 months ago

@omrikiei Is it possible to fix this issue?