Git Product home page Git Product logo

ktunnel's Introduction

Ktunnel logo

ktunnel

A CLI tool that establishes a reverse tunnel between a kubernetes cluster and your local machine

Status GitHub Issues GitHub Pull Requests License: GPL v3


Expose your local resources to kubernetes

๐Ÿ“ Table of Contents

๐Ÿ Installation

Distribution Command / Link
Pre-built binaries for macOS, Linux, and Windows GitHub releases
Homebrew (macOS and Linux) brew tap omrikiei/ktunnel && brew install omrikiei/ktunnel/ktunnel
Krew kubectl krew install tunnel

Building from source

Clone the project

git clone https://github.com/omrikiei/ktunnel; cd ktunnel

Build the binary

CGO_ENABLED=0 go build -ldflags="-s -w"

You can them move it to your bin path

sudo mv ./ktunnel /usr/local/bin/ktunnel

Test the command

ktunnel -h

๐Ÿง About

Ktunnel is a CLI tool that establishes a reverse tunnel between a kubernetes cluster and your local machine. It lets you expose your machine as a service in the cluster or expose it to a specific deployment. You can also use the client and server without the orchestration part. Although ktunnel is identified with kubernetes, it can also be used as a reverse tunnel on any other remote system

Ktunnel was born out of the need to access my development host when running applications on kubernetes. The aim of this project is to be a holistic solution to this specific problem (accessing the local machine from a kubernetes pod). If you found this tool to be helpful on other scenarios, or have any suggesstions for new features - I would love to get in touch.

Ktunnel schema

Ktunnel schema

๐ŸŽˆ Usage

Expose your local machine as a service in the cluster

This will allow pods in the cluster to access your local web app (listening on port 8000) via http (i.e kubernetes applications can send requests to myapp:8000)

ktunnel expose myapp 80:8000
ktunnel expose myapp 80:8000 -r #deployment & service will be reused if exists or they will be created

Inject to an existing deployment

This will currently only work for deployments with 1 replica - it will expose a listening port on the pod through a tunnel to your local machine

ktunnel inject deployment mydeployment 3306

Star History

Star History Chart

Made with โค๏ธ in Gedera!

ktunnel's People

Contributors

aeronotix avatar anatolyrugalev avatar chandanpasunoori avatar code0x9 avatar dependabot[bot] avatar idsulik avatar jaredallard avatar jboewer avatar leandregagnonlewis avatar lionelnicolas avatar luckyf avatar mariappan avatar mindovermiles262 avatar moshebe avatar nitinsurana avatar okletzmayr avatar omrikiei avatar outscale-age avatar progxaker avatar rhysm avatar scotty-rdn avatar sillyfrog avatar takatea avatar tamarmeital avatar vandot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktunnel's Issues

Failed reading from socket, exiting

When we try to use ktunnel to establish a connection for using xdebug in one of our containers, it works for about 15 seconds before failing with this error:

INFO[2020-04-09 16:32:45] f73e9c2d-ffdb-48dd-aa74-a4f8be552086; new session; connecting to port 9000
ERRO[2020-04-09 16:32:58] f73e9c2d-ffdb-48dd-aa74-a4f8be552086; failed reading from socket, exiting: read tcp 127.0.0.1:55793->127.0.0.1:9000: read: connection reset by peer

The ktunnel command we were using was ktunnel inject -n poor-cannon deployment api 8999:8999

ktunnel version: 1.2.2

Tunneling doesn't work

On Windows 10, Docker for Windows and using a k3d cluster, the tunnel cannot be established.

On the host, when running something like ktunnel expose debuggerhost 4321:4321 I get the following messages:

time="2021-08-10T16:50:36+02:00" level=info msg="port forwarding to https://http:/api/v1/namespaces/default/pods/debuggerhostt-6c76f898fd-vhmw2/portforward"
time="2021-08-10T16:50:36+02:00" level=info msg="Waiting for port forward to finish"
time="2021-08-10T16:50:49+02:00" level=error msg="error upgrading connection: error sending request: Post \"https://http/api/v1/namespaces/default/pods/debuggerhostt-6c76f898fd-vhmw2/portforward\": dial tcp: lookup http: no such 
host"

The first line already looks wrong to me.

ktunnel `--tls` should set `traefik.ingress.kubernetes.io/service.serversscheme: https` annotation

Hello!

I've been loving ktunnel, and just started using it with a cluster that uses Traefik. I spent a full 3 hours trying to figure out how to get the Ingress system to pass HTTPS thru my ktunnel service, and finally found out that the service needs to have an annotation that hints to Traefik that the service speaks TLS.

When using --tls option, the service should be created with the traefik.ingress.kubernetes.io/service.serversscheme: https annotation, which would make Traefik ingresses pointing at the service work properly.

Honestly, this seems more like a failure on Traefik's side, but since adding an annotation is a harmless and very light change, it seems like a nice convenience that ktunnel could add.

Feel free to close this if you don't think ktunnel should deal with this - I have mixed feelings. It's not "correct", but it certainly would have saved me a lot of time.

unknown shorthand flag: 'r' in -r

On your README it says:

ktunnel expose myapp 80:8000 -r #deployment & service will be reused if exists or they will be created

but sadly there's no flag on ktunnel version 1.4.0

ktunnel expose -n cluster-base some-service-svc 80:80 -r
Error: unknown shorthand flag: 'r' in -r
Usage:
  ktunnel expose [flags] SERVICE_NAME [ports]

Examples:

# Expose a local application running on port 8000 via http
ktunnel expose kewlapp 80:8000
			  
# Expose a local redis server
ktunnel expose redis 6379
              

Flags:
  -c, --ca-file string                TLS cert auth file
  -h, --help                          help for expose
  -n, --namespace string              Namespace (default "default")
  -s, --scheme string                 Connection scheme (default "tcp")
  -o, --server-host-override string   Server name use to verify the hostname returned by the TLS handshake
  -i, --server-image string           Ktunnel server image to use (default "quay.io/omrikiei/ktunnel:v1.4.0")

Global Flags:
  -p, --port int   The port to use to establish the tunnel (default 28688)
  -t, --tls        Connection uses tls if true, else plain TCP
  -v, --verbose    verbose mode

Hanging at INFO[0000] waiting for deployment to be ready

Image is v1.3.6

Kubernetes side, deployment/pod seems to start up just fine:

k get pods
NAME                       READY   STATUS    RESTARTS   AGE
ktunnel-77b65858f8-w9zg5   1/1     Running   0          35s
k get deployments
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
ktunnel   1/1     1            1           37s

Edit: just tried with v1.3.3 also since I remember that working for sure last time I used this (It's me from #36 :D) issue persists just the same... I've checked I haven't got any lingering ktunnel resources server-side as well

Edit: k logs on the server pod shows:

INFO[2021-04-12 15:35:20.451] Starting to listen on port 28688          

Swap functionality

I would like to replace current deployment of some app (lets call it myapp) with ktunnel to debug it locally. This is kind of similar to expose with reuse flag, but trying it when it tries to patch deployment and replace labels it fails as they are immutable by design.

Is there any plans to add such functionality? I can see in TODO it was once in plan but not sure if it's still in scope of this? Or do you know any other ways of achieving above with ktunnel?

ktunnel should honor kubectl env var for setting the active config

export KUBECONFIG=${HOME}/.kube/dev-west.yaml

When I use ktunnel I get the following error

ERRO[0000] Failed getting kubernetes config: stat /Users/fieldju/.kube/config: no such file or directory

I would expect kubectl and ktunnel to use the same env var for choosing what config to use.

Found this:

kconfig := os.Getenv("KUBE_CONFIG")

Is that a typo or intentional?

Right now for me to use kubectl and ktunnel I need to set 2 env vars

export KUBECONFIG=${HOME}/.kube/dev-west.yaml
export KUBE_CONFIG=$KUBECONFIG

failed connecting to localhost on port 9002 scheme tcp

failed connecting to localhost on port 9002 scheme tcp

ktunnel version 1.2.4 (1.2.5 actually)

my PHPStorm is listening port 9002.

โžœ  ~ lsof -i :9002
COMMAND    PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
phpstorm 50781 cyao  465u  IPv6 0x32e9aa96a4c0d673      0t0  TCP *:pichat (LISTEN)

And I also tried to start a TCP server to respond to the connection.

โžœ  ~ nc -vl 9002

same error.

โžœ  ~ ktunnel -v inject deployment my-php-app 9000:9002 -n playground
INFO[2020-05-01 00:59:00] Injecting tunnel sidecar to playground/my-php-app
INFO[2020-05-01 00:59:01] Waiting for deployment to be ready
INFO[2020-05-01 00:59:23] All pods located for port-forwarding
DEBU[2020-05-01 00:59:23] Injecting to this pods: [my-php-app-6995b778b-8fzm5]
INFO[2020-05-01 00:59:23] Waiting for port forward to finish
INFO[2020-05-01 00:59:24] Forwarding from 127.0.0.1:28688 -> 28688
Forwarding from [::1]:28688 -> 28688
INFO[2020-05-01 00:59:24] starting tcp tunnel from source 9000 to target 9002
DEBU[2020-05-01 00:59:25] attempting to receive from stream
DEBU[2020-05-01 00:59:33] 780fece3-8339-40f4-bcf4-2da5a60fd5de; got session from server: 499<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/www/public/index.php" language="PHP" xdebug:language_version="7.3.17" protocol_version="1.0" appid="38" idekey="PHPSTORM"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
INFO[2020-05-01 00:59:33] 780fece3-8339-40f4-bcf4-2da5a60fd5de; new session; connecting to port 9002
ERRO[2020-05-01 00:59:33] failed connecting to localhost on port 9002 scheme tcp

ktunnel v1.3.9 killed on Mac OS Big Sur

Description

On Mac OS Big Sur (Version 11.3.1) running ktunnel 1.3.9 results in process being terminated with SIGKILL

Expected Behavior

We would expect ktunnel to work normally

Current Behavior

Even a simple invocation, just invoking the command ktunnel without any argument, results in the process being killed

$ ktunnel
[1]    35494 killed     ktunnel

Steps to Reproduce

  1. brew tap omrikiei/ktunnel && brew install ktunnel or brew upgrade ktunnel if already installed
  2. run ktunnel

Work around

Build 1.3.8 from source:

brew uninstall ktunnel
git clone https://github.com/omrikiei/ktunnel.git
git checkout tags/v1.3.8
CGO_ENABLED=0 go build -l$dflags="-s -w"
./ktunnel

Ktunnel crashes if we try to use the kube config from env variable

Hello, Thanks for this nice k8s plugin.

Most dev use this idea of running a proxy container to forward the k8s traffic to local dev environment manually.
But this plugin really makes that process smoother, with a single command.

I am trying to use this plugin for my dev environment and I am facing a minor issue with my setup.

I have multiple clusters configured though env variable KUBECONFIG
https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable

When trying to start ktunnel using this config, ktunnel crashes with following trace:

ERRO[0000] Failed getting kubernetes config: stat /home/maari/.kube/config:/home/maari/.kube/first.yaml:/home/maari/.kube/second.yaml: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1323f7a]

goroutine 1 [running]:
k8s.io/client-go/kubernetes.NewForConfig(0x0, 0xc0003f126f, 0xff9ff3fe7fc, 0x37)
	/home/maari/go/pkg/mod/k8s.io/[email protected]/kubernetes/clientset.go:395 +0x3a
github.com/omrikiei/ktunnel/pkg/k8s.getClients.func1()
	/home/maari/documents/github/ktunnel/pkg/k8s/common.go:75 +0x34
sync.(*Once).doSlow(0x2170878, 0xc0004239b8)
	/usr/lib/go/src/sync/once.go:68 +0xec
sync.(*Once).Do(...)
	/usr/lib/go/src/sync/once.go:59
github.com/omrikiei/ktunnel/pkg/k8s.getClients(0x2136a40)
	/home/maari/documents/github/ktunnel/pkg/k8s/common.go:74 +0x69
github.com/omrikiei/ktunnel/pkg/k8s.ExposeAsService(0x2136a40, 0xc000446320, 0x7010, 0x164d91e, 0x3, 0xc0003d35d0, 0x1, 0x1, 0xc00043c1a0, 0x1f, ...)
	/home/maari/documents/github/ktunnel/pkg/k8s/exposer.go:20 +0x45
github.com/omrikiei/ktunnel/cmd.glob..func2(0x212bee0, 0xc0003d35c0, 0x2, 0x2)
	/home/maari/documents/github/ktunnel/cmd/expose.go:42 +0x1e5
github.com/spf13/cobra.(*Command).execute(0x212bee0, 0xc0003d3580, 0x2, 0x2, 0x212bee0, 0xc0003d3580)
	/home/maari/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x212b9e0, 0x7, 0x0, 0x0)
	/home/maari/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/maari/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/omrikiei/ktunnel/cmd.Execute()
	/home/maari/documents/github/ktunnel/cmd/root.go:45 +0x65
main.main()
	/home/maari/documents/github/ktunnel/main.go:8 +0x25

ktunnel inject deployment not working

i was trying ktunnel to inject deployment but not working

command used:-ktunnel inject deployment flask-deployment 80

Error

"status": "Failure",
  "message": "pods \"flask-deployment-6c86b6f988-vkfh8\" is forbidden: User \"system:anonymous\" cannot get resource \"pods/portforward\" in API group \"\" in the namespace \"default\"",
  "reason": "Forbidden",
  "details": {
    "name": "flask-deployment-6c86b6f988-vkfh8",
    "kind": "pods"
  },

Subsequent requests hang for exactly 1 minute

Hey,

I've got it set up and it works, but the request/response round-trip is intermittently very, very slow, or hangs and doesn't complete.

I have no idea what kinds of logs/tests to try to give more meaningful information about this issue, if there are any suggestions I'd be happy to undertake them.

Cheers!

Problems with large files

I'm trying to proxy to a local web server, but it looks like ktunnel doesn't behave well with large files. Here's some output from curl:

โฏ curl https://proxy.mbuffett.com/_next/static/chunks/main.js | wc -c
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  8 4295k    8  377k    0     0  73862      0  0:00:59  0:00:05  0:00:54 73862
curl: (18) transfer closed with 4012193 bytes remaining to read
386672

โฏ curl localhost:8085/_next/static/chunks/main.js | wc -c            
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4295k  100 4295k    0     0   209M      0 --:--:-- --:--:-- --:--:--  209M
4398865

Please, no judgement for the 4MB JS file ๐Ÿ˜„ I do see these logs from ktunnel about buffer sizes:

INFO[2020-07-30 07:59:34] increasing buffer size to 65536              
INFO[2020-07-30 07:59:34] increasing buffer size to 131072

Wonder if there's anything I can do about this limitation? Thanks!

And awesome program, exactly what I was looking for and easy to set up

GoReleaser need Go > 1.16 for darwinarm64 binary build

I want to use prebuilt darwinarm64 binary for my M1 Mac

https://github.com/omrikiei/ktunnel/runs/4053675165?check_suite_focus=true

      โ€ข building binaries
         โ€ข DEPRECATED: skipped darwin/arm64 build on Go < 1.16 for compatibility, check https://goreleaser.com/deprecations/#builds-for-darwinarm64 for more info.
         โ€ข DEPRECATED: skipped windows/arm64 build on Go < 1.17 for compatibility, check https://goreleaser.com/deprecations/#builds-for-windowsarm64 for more info.

ERRO[0000] Failed to get k8s client: no Auth Provider found for name "gcp"

Hi @omrikiei and thank you for your work!

I'm trying to use ktunnel but stumbled upon an issue which I'm posting here in case there are any clues on how to resolve ๐Ÿ”จ the showstopper ๐Ÿ› :) (note: I'm golang newbie)

Here is what I can share so far of my findings:

Steps to reproduce

  1. download latest binary 1.1.7 for linux
  2. execute with ktunnel expose myapp 8084:8084 -n mynamespace
  3. see ERRO[0000] Failed to get k8s client: no Auth Provider found for name "gcp"

kubectl version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.1", GitCommit:"d224476cd0730baca2b6e357d144171ed74192d6", GitTreeState:"clean", BuildDate:"2020-01-14T21:04:32Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.8-gke.12", GitCommit:"188432a69210ca32cafded81b4dd1c063720cac0", GitTreeState:"clean", BuildDate:"2019-11-07T19:27:01Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}

kube config

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ...
    server: https://endpoint
  name: long_cluster_name
contexts:
- context:
    cluster: long_cluster_name
    user: long_cluster_name
  name: long_cluster_name
current-context: long_cluster_name
kind: Config
preferences: {}
users:
- name: xyz
  user:
    auth-provider:
      config:
        access-token: XYZ
        cmd-args: config config-helper --format=json
        cmd-path: /usr/lib/google-cloud-sdk/bin/gcloud
        expiry: "UTC-DATE"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

failed parsing session uuid from stream, skipping error="invalid UUID length: 0" during inject deployment

I have a K8s Deployment which declares containerPort 80 for an REST Server.

I want to redirect all ingress traffic from this K8s Deployment (POD) to my local machine.

I am using version 1.4.0

ktunnel inject deployment -n cluster-base rest-callback-handler 80 -v
INFO[0000] Injecting tunnel sidecar to cluster-base/rest-callback-handler 
INFO[0000] ProgressDeadlineInSeconds is currently 600s. It may take this long to detect a deployment failure. 
INFO[0000] Waiting for deployment to be ready           
INFO[0002] deployment "rest-callback-handler" successfully rolled out 
INFO[0002] port forwarding to https://api.......com/api/v1/namespaces/cluster-base/pods/rest-callback-handler-84c97c9689-npkzn/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[2021-09-08 09:54:12.389] starting tcp tunnel from source 80 to target 80 
DEBU[2021-09-08 09:54:12.482] attempting to receive from stream            
ERRO[2021-09-08 09:54:12.527] failed parsing session uuid from stream, skipping  error="invalid UUID length: 0" session=
INFO[2021-09-08 09:54:12.527] new connection                                port=80 session=
ERRO[2021-09-08 09:54:12.527] failed connecting to localhost on port 80 scheme tcp  error="dial tcp [::1]:80: connect: connection refused"
ERRO[2021-09-08 09:54:12.527] failed sending close message to tunnel stream  error=EOF
DEBU[2021-09-08 09:54:12.527] attempting to receive from stream            
INFO[2021-09-08 09:54:12.527] closing listener on 80                        error="context canceled"

v1.4.1 is not available

The latest krew plugin is trying to use v1.4.1 but looking at quay.io that version is not tagged.

Kubernetes event:

Failed to pull image "quay.io/omrikiei/ktunnel:v1.4.1": rpc error: code = Unknown desc = Error response from daemon: manifest for quay.io/omrikiei/ktunnel:v1.4.1 not found: manifest unknown: manifest unknown

Add resource request for injected ktunnel server sidecar

Thanks for the great tool, @omrikiei!

I ran into a small issue on my Kubernetes cluster. The injected sidecar doesn't specify any resource request (resources: {} in the deployment yaml) which the cluster doesn't allow. My workaround is to manually edit the yaml and add CPU and memory limits and requests to unblock the deployment.
Could you add a reasonable default to make that step unnecessary?

/.kube/config: no such file or directory

Hi,

I have followed the example for Pycharm debugging.

I have deployed the example to docker-desktop kubernetes.

When I look into the logs on the pyremotedebug-<hash> pod I can see this error:

ktunnel time="2020-12-09T16:47:50Z" level=error msg="Failed getting kubernetes config: stat /.kube/config: no such file or directory"
ktunnel INFO[2020-12-09 16:47:50.669] Starting to listen on port 28688

I follow all the steps in the instructions , start the remote debugger, it is waiting for connection.
I do ktunnel inject deployment pyremotedebug 4321

and the output is:

INFO[0000] Injecting tunnel sidecar to default/pyremotedebug
WARN[0000] quay.io/omrikiei/ktunnel:latest already injected to the deplyoment
INFO[0000] Waiting for deployment to be ready
INFO[0000] Waiting for port forward to finish
INFO[0000] Forwarding from 127.0.0.1:28688 -> 28688
Forwarding from [::1]:28688 -> 28688

So I am missing the crucial bit shown in the instructions: INFO[0011] starting tcp tunnel from source 4321 to target 4321

looks like the tunnel is never started...

I assume it is because it cannot find this kube config file?

This happens also if I set KUBECONFIG in my terminal (but I guess this does not matter as it is the container log reporting missing kube config not the local ktunnel....)

If I do:
curl localhost:8000/debug

then in the pod's logs I can see:

pyremotedebug INFO:root:Connecting to remote debugger on 127.0.0.1:4321
pyremotedebug Could not connect to 127.0.0.1: 4321

Help please? Is there a step in the instructions missing?

URL Parse Error

Trying to use ktunnel with Rancher deployed pod (the example pod ffrom this repo). The following error is displayed:
INFO[0001] Injecting tunnel sidecar to dparsons/pyremotedebug
INFO[0002] Waiting for deployment to be ready
INFO[0007] Waiting for port forward to finish
ERRO[0007] error upgrading connection: error creating request: parse https://rancher.plaidcloud.io%2Fk8s%2Fclusters%2Fc-wfdqx/api/v1/namespaces/dparsons/pods/pyremotedebug-9ff9fc4c-trbcg/portforward: invalid URL escape "%2F"

Issue waiting for pod to be ready after injecting

I believe there is an issue waiting for the newly injected pod to be ready.

injector.go:28 waitForReady(&o.Name, o.GetCreationTimestamp().Time, *o.Spec.Replicas, readyChan)

This line seems to always use the creation timestamp of the deployment which is not updated when the deployment is modified. I think we're on Kubernetes 1.19.

Perhaps I'm misunderstanding the code but don't we want a pod created after the the current time in this scenario?

Issue seems to manifest for me as sometimes having to run the inject command 2x. The first time in updates the deployment and then tries to connect to the pod that existed before the deployment was changed.

The second time it detects the sidecar and creates the tunnel successfully.

Thanks.

Support local registries

It would be great if ktunnel could support local registries.
For instance:
ktunnel inject ... --image my/local/registry/ktuneel:my-tag

is authentication with token supported?

Hi
How does ktunnel authenticate itself in the cluster?
Can I use --token=<token> just like I use with openshift cli tool? e.g. oc project --token=<token>

Multiple ports forwarded in a single expose ?

Hello,

First, thanks for writing this software, which is of great use to me.

I'm trying to use ktunnel to expose a locally running service (actually an Apache Spark driver that need to talk to Apache Spark Executors it spaws inside the cluster) that happens to listen on several ports at the same time.

What i'm basically looking to do is a multiport remote service forwarded to multiple local ports.

I initially thought this was not possible, because I had a strange error message:

FATA[0000] Failed to expose local machine as a service: Service "my-remote" is invalid: [spec.ports[0].name: Required value, spec.ports[1].name: Required value]

In reality this seems to stem from the fact that the service name seem to be mandatory when having multiple services in recent Kubernetes (v.1.18 ?)

Thanks !

Does it work with Gihub codespaces?

It is mentioned in the README "Although ktunnel is identified with kubernetes, it can also be used as a reverse tunnel on any other remote system"

Is there anyway I can use ktunnel to expose local resources(webserver) so that they can be accessed from within the GitHub codespaces container?

Thanks

Revise questionable claims about Ngrok and Inlets

Hi @omrikiei

I don't believe that you meant to call Ngrok and inlets "insecure" and "incomplete" as a way of attacking other open source projects openly, however you have done that and it could be considered slanderous.

although there are partial solutions to this problem such as inlets and ngrok I found them to be unsuitable and insecure for the task at hand

In what way is Ngrok or inlets insecure? Either give evidence and qualify your opinion, or I would ask you to kindly remove it. inlets is a free open-source community project and I would ask you to be respectful of that in the way you talk about it.

I'm not sure in which ways you consider either solution to be incomplete, but you are free to email me [email protected] or to browse the documentation to see if your opinion is true or not. It might even be worth removing this statement from the public README. You could even go as far as qualifying your statement.

Alex

ktunnel expose --ca-file option not used?

Hi,

First of all thank you so much for creating this awesome project ๐Ÿ‘

I'm trying to enable TLS using --tls and --ca-file options but I'm not sure is it actually working. What I'm curious about is this part:

opts = append(opts, client.WithTLS(CertFile, ServerHostOverride))

Should the CertFile parameter be CaFile instead?

exposeCmd.Flags().StringVarP(&CaFile, "ca-file", "c", "", "TLS cert auth file")

ERRO[0007] Error sending init tunnel request: rpc error: code = Unavailable

Hi @omrikiei :)

Its me again, this time with the following:

2020-02-06 09:52:13 >| $ ktunnel expose myWebapp 8084:8084 -n myNamespace
INFO[0000] Exposed service's cluster ip is: 10.31.10.100
INFO[0000] waiting for deployment to be ready           
INFO[0007] All pods located for port-forwarding         
INFO[0007] Waiting for port forward to finish           
INFO[0007] Forwarding from 127.0.0.1:28688 -> 28688
Forwarding from [::1]:28688 -> 28688 
INFO[0007] starting tcp tunnel from source 8084 to target 8084 
E0206 09:52:21.785327   10875 portforward.go:400] an error occurred forwarding 28688 -> 28688: error forwarding port 28688 to pod 3ddcdef600c6c0d884e3d71f5600a350623786083794ac4ef3a330c5ddc2944b, uid : exit status 1: 2020/02/06 07:52:21 socat[165522] E connect(5, AF=2 127.0.0.1:28688, 16): Connection refused
ERRO[0007] Error sending init tunnel request: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection closed 
INFO[0023] Got exit signal, closing client tunnels and removing k8s objects 
INFO[0023] Deleting service myWebapp

I'll appreciate ๐Ÿ˜ any clues as always :)

Kind regards,
Boris

License

Could you please add a license to the repository?

PyCharm debugger waiting for process connection

After starting the PyCharm debugger with IDE host name 0.0.0.0, port 5678 and correct path mappings, then setting up the tunnel and starting the remote application with

import pydevd_pycharm
pydevd_pycharm.settrace('localhost', port=5678, stdoutToServer=True, stderrToServer=True)

in the source code (using pip install pydevd-pycharm~=211.7628.24 as the PyCharm run/debug configuration tells me) the PyCharm debugger doesn't start the debugging process properly. It keeps showing

Waiting for process connection...

When stopping the remote application with CTRL-C the stdout/stderr is nonetheless transmitted to PyCharm and appears in the debug console:

Traceback (most recent call last):
File "/opt/app-root/./main.py", line 9, in
pydevd_pycharm.settrace('127.0.0.1', port=5678, stdoutToServer=True, stderrToServer=True, suspend=False)
File "/home/precisionlims/.local/lib/python3.9/site-packages/pydevd.py", line 1689, in settrace
_locked_settrace()
Waiting for process connection...
Server stopped.

The tunnel is logging:

INFO[2021-07-16 11:08:45.939] new connection port=5678 session=fddfa455-d934-4fd2-8588-aed7d5e48631
INFO[2021-07-16 11:08:45.970] closed session session=fddfa455-d934-4fd2-8588-aed7d5e48631

Like if the connection was opened and closed at the same time.

So there is a successful connection attempt made. What might be the issue here?

Kubectl plugin

Providing ktunnel as a kubectl plugin and exposing commands like kubectl tunnel expose ... would help with distribution and updates.

Error upgrading connection

antek@vps3:~/Downloads$ ./ktunnel expose -v test2 4444
INFO[0000] Exposed service's cluster ip is: 10.100.17.49 
INFO[0000] waiting for deployment to be ready           
INFO[0012] Waiting for port forward to finish           
ERRO[0013] error upgrading connection:                  

^CINFO[0024] Got exit signal, closing client tunnels and removing k8s objects 
INFO[0024] Deleting service test2                       
INFO[0024] Deleting deployment test2         

Brew install on Big Sur Mac ARM fails

I have tried lots of variants of installing with brew and getting the following:

โžœ  brew tap omrikiei/ktunnel && brew install --HEAD ktunnel
==> Installing ktunnel from omrikiei/ktunnel
==> Cloning https://github.com/omrikiei/ktunnel.git
Updating /Users/nick/Library/Caches/Homebrew/ktunnel--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 03424c3 updated docs
Error: An exception occurred within a child process:
  Errno::ENOENT: No such file or directory - ktunnel

Tunnel established but does not respond or shows high CPU usage

Hi @omrikiei, it's me again ๐Ÿ™ˆ

I am currently trying to forward a simple local HTTP server into the cluster. Service, deployment and kTunnel (28688 -> 28688) are always established correctly and do not show any errors. Nevertheless the ktunnel server very often does not forward any requests to the local ktunnel client. Requests end in a timeout, although no errors can be seen.

Steps to reproduce

  1. download latest (brew) binary 1.1.10 for macos
  2. execute ktunnel -v expose myapp 8080:8080
  3. see:
INFO[0000] Exposed service's cluster ip is: 10.99.192.110 
INFO[0000] waiting for deployment to be ready           
INFO[0003] Waiting for port forward to finish           
INFO[0004] Forwarding from 127.0.0.1:28688 -> 28688
Forwarding from [::1]:28688 -> 28688 
INFO[0004] starting tcp tunnel from source 8080 to target 8080 
  1. Perform a http request to service inside kubernetes (other) pod via curl -v http://myapp.default.svc.cluster.local:8080/ (ip gets resolved to exposed service cluster ip) no response, no incoming request to local server, no session created)
  2. CTRL+C on client side
INFO[0027] Got exit signal, closing client tunnels and removing k8s objects 
INFO[0027] Deleting service travellerapp                
WARN[0027] error reading from stream: %vrpc error: code = Canceled desc = grpc: the client connection is closing 
INFO[0027] Deleting deployment myapp  

kubectl version

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T14:25:20Z", GoVersion:"go1.12.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:41:55Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

In a few cases the server forwards the request to the client and the HTTP request is successfully answered. After that the CPU load of the (local) ktunnel client increases to 500-600% (6 cores). The client still responds (but no further tunnel requests are forwarded), but the CPU usage does not decrease.

The cpu usage increases after the client logs

INFO[0005] b638fa36-d3ad-4cfd-8881-38b5cf9a8cca; new session; connecting to port 8080 

Please let me know how I can help you to reproduce the bug.
Thank you!
Markus

Clean up unused resources

After using ktunnel expose and an unexpected shutdown the deployment and the service will stay in the cluster indefinitely.

There could be something like a ktunnel clean or ktunnel reconnect. Alternatively there could be a timeout after which the resources delete themselves if the connection is lost to the client, I'm not sure if this is possible.

This is not a must have feature, but it would be nice.

P.S.: This tool has been very handy so far, thanks for creating it!

Sessions being left open with "closing session... err: EOF session not found in openRequests"

We are using ktunnel to use xdebug against our remote php pods. It works great, but we noticed that all connections are left open indefinitely.

The ktunnel logs show errors that seem to be related:

INFO[2020-07-22 22:37:08 closing session 8b033568-e519-46ea-a42d-164b12a3c46d; err: EOF 
ERRO[2020-07-22 22:37:14 8b033568-e519-46ea-a42d-164b12a3c46d; session not found in openRequests 
ERRO[2020-07-22 22:37:15 8b033568-e519-46ea-a42d-164b12a3c46d; session not found in openRequests 
INFO[2020-07-22 22:38:02 closing session 407cef1f-3cf7-4505-83b6-4f05f665388f; err: EOF 
ERRO[2020-07-22 22:38:11 407cef1f-3cf7-4505-83b6-4f05f665388f; session not found in openRequests 
ERRO[2020-07-22 22:38:12 407cef1f-3cf7-4505-83b6-4f05f665388f; session not found in openRequests 

How do we resolve this?

Change namespace

Hi
I need to use a different namespace for expose and inject. I see there is a namespace flag but it never seems to work or I have got the command line wrong.

Help text is:

This command accepts a pod/deployment and injects the tunnel sidecar to that artifact, 
			it then establishes a reverse tunnel

Usage:
  ktunnel inject [command]

Available Commands:
  deployment  Inject server sidecar to a deployment and run the ktunnel client to establish a connection

Flags:
  -c, --ca-file string                TLS cert auth file
  -h, --help                          help for inject
  -n, --namespace string              Namespace (default "default")
  -s, --scheme string                 Connection scheme (default "tcp")
  -o, --server-host-override string   Server name use to verify the hostname returned by the TLS handshake

Global Flags:
  -p, --port int   The port to use to establish the tunnel (default 28688)
  -t, --tls        Connection uses TLS if true, else plain TCP
  -v, --verbose    Emit debug logs

Use "ktunnel inject [command] --help" for more information about a command.

Is the namespace flag implemented? What is the correct command line order to change namespace?

ERRO[0009] error upgrading connection due to incorrect port-forward url

Hi @omrikiei, first of all: thank you for your work!

I'm trying to use ktunnel to forward a local port to the cluster.

Steps to reproduce

  1. download latest (brew) binary 1.1.8 for macos
  2. execute ktunnel expose myapp 3000:8000 -n mynamespace -v
  3. see:
INFO[0005] Exposed service's cluster ip is: 10.96.53.19 (correct)
INFO[0005] waiting for deployment to be ready (deployment gets ready, pod and service created)           
INFO[0009] Waiting for port forward to finish           
ERRO[0009] error upgrading connection: error sending request: Post https://rv01.mydomain.de:6443//api/v1/namespaces/default/pods/myapp-5b65c8777b-dd54r/portforward: dial tcp [ip of mydomain.de]:6443: connect: connection refused 

kubectl version

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T14:25:20Z", GoVersion:"go1.12.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:41:55Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

kube config

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: [omitted]
    server: https://srv01.mydomain.de:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    namespace: default
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: [omitted]
    client-key-data: [omitted]

The configured kube.config server is: srv01.mydomain.de while rv01.mydomain.de is being used, which resolves to another IP.

Also it seems that this results in #9 when hitting CTRL+C after receiving ERRO[0009]:

INFO[0052] Got exit signal, closing client tunnels and removing k8s objects 
INFO[0052] Deleting service travellerapp                
INFO[0053] Deleting deployment travellerapp  

The service and deployment get successfully terminated but ktunnel hangs until killed.

Autocompletion

Hello.
Thanks for the great tool.

Do you have a plan to implement autocompletion for zsh/bash/etc?

Thanks

Expose doesn't work when source and target port are different

I tried to use the expose command to forward traffic from a kubernetes service to a local port:

ktunnel expose myservice 80:8000

Access from another pod in the same cluster using curl just says:

Failed to connect to myservice port 80: Connection refused

It looks like the service will be created with a source port of 80 and a target port of 8000, but the pod is listening on port 80. When I change the service manually and set source and target port to 80, it works.

Mixed linux and windows clusters

First, thank you very much for ktunnel! We discovered it this week and are replacing our hacky usage of ngrok with this.

We have a mixed linux and windows node Kubernetes cluster and often the deploy of ktunnel fails if Kubernetes schedules it on a windows node. We can fix this by adding a nodeSelector manually to the deployment after ktunnel initiates it:

      nodeSelector:
        kubernetes.io/os: linux

This selector is specific to the labels we apply to our Kubernetes nodes (I think), so I don't believe ktunnel should adopt this, but I was wondering if there's a way we can add the nodeSelector to the deployment so it does not error?

If you can think of how you would like this feature added to ktunnel, I would be happy to contribute a PR as well.

Pydevd protocol issues

I've encountered a couple of debugger parsing issues where evidently different field types were expected than what was delivered, some seemingly cutting of a single character or scrambling up file paths. Sometimes the debugging sessions continue fine but other times things get stuck.

Screen Shot 2020-04-27 at 8 57 47 PM

with pydevd-pycharm (201.6668.115) installed in the local and remote venv, Python 3.6.5 and PyCharm 2020.1.

When connecting to the debugger:

Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'ce/current/app/scripts/modelconfig_sync.py'
Can't process net command: ce/current/app/scripts/modelconfig_sync.py	109	sync	THREAD	None	None
pydev debugger: warning: trying to add breakpoint to file that does not exist: /srv/servi111 (will have no effect)

Corresponding inject logs

DEBU[2020-04-27 17:57:28] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server:
INFO[2020-04-27 17:57:28] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; new session; connecting to port 21000
DEBU[2020-04-27 17:57:28] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 0 bytes
DEBU[2020-04-27 17:57:28] attempting to receive from stream
DEBU[2020-04-27 17:57:28] started reading from session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 15 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 501	1	201.6668.115
DEBU[2020-04-27 17:57:28] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 19 bytes
DEBU[2020-04-27 17:57:28] attempting to receive from stream
DEBU[2020-04-27 17:57:28] read 96 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 320 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 28 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 97 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 44 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 90 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] read 8 bytes from conn on session ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; err: <nil>
DEBU[2020-04-27 17:57:28] locking: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:28] unlocked: ce7e715a-b5cb-49d0-9141-6e11bdbe31bc
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 116	2	<xml><io s="Traceback %2528most recent call last%2529%253A%250A" ctx="2"/></xml>
116	4	<xml><io s="  File %2522/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py%2522%252C line 311%252C in _on_run%250A    cmd_id = int%2528args%255B0%255D%2529%250A" ctx="2"/></xml>
116	6	<xml><io s="ValueError%253A invalid literal for int%2528%2529 with base 10%253A %2527ce/current/app/scripts/modelconfig_sync.py%2527%250A" ctx="2"/></xml>
116	8	<xml><io s="Can%2527t process net command%253A ce/current/app/scripts/modelconfig_sync.py%2509109%2509sync%2509THREAD%2509None%2509None%250A" ctx="2"/></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 652 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server:
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 0 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 116	10	<xml><io s="pydev debugger%253A warning%253A trying to add breakpoint to file that does not exist%253A /srv/servi111 %2528will have no effect%2529%250A" ctx="2"/></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 176 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 103	12	<xml><thread name="MainThread" id="pid_1308_id_140361090732384" /></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 80 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 103	14	<xml><thread name="Thread-1" id="pid_1308_id_140360240746392" /></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 78 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 103	16	<xml><thread name="DummyThread-2" id="pid_1308_id_140360231815824" /></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 83 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc; got session from server: 103	18	<xml><thread name="DummyThread-9" id="pid_1308_id_140360229536208" /></xml>
DEBU[2020-04-27 17:57:29] ce7e715a-b5cb-49d0-9141-6e11bdbe31bc got 83 bytes
DEBU[2020-04-27 17:57:29] attempting to receive from stream

Another example from executing a test via pytest

Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: ''
Can't process net command: 	None	None
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'srv/service/current/tests/integration/local_load_test.py'
Can't process net command: srv/service/current/tests/integration/local_load_test.py	20	test_load_model_from_local	THREAD	None	None

And some more

Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'one'
Can't process net command: one	None	0	1	0
---
Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'ne'
Can't process net command: ne
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_process_net_command.py", line 339, in process_net_command
    breakpoint_id = line = int(line)
ValueError: invalid literal for int() with base 10: 'python-line'
---
Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: ''
Can't process net command: 	None
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'om_local'
Can't process net command: om_local	THREAD	None	None
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'ython-line'
Can't process net command: ython-line	/srv/service/current/tests/integration/s3_load_test.py	16	test_load_from_s3	THREAD	None	None
---
Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'ython-BaseException'
Can't process net command: ython-BaseException	None	None	0	1	0
---
Connected to pydev debugger (build 201.6668.115)
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: ''
Can't process net command: 	None
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'om_local'
Can't process net command: om_local	THREAD	None	None
Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/_pydevd_bundle/pydevd_comm.py", line 311, in _on_run
    cmd_id = int(args[0])
ValueError: invalid literal for int() with base 10: 'ython-line'
Can't process net command: ython-line	/srv/service/current/tests/integration/s3_load_test.py	16	test_load_from_s3	THREAD	None	None

Have you encountered similar issues before or do you have an idea what might cause it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.