loft-sh / vcluster

vCluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
https://www.vcluster.com
Apache License 2.0
6.92k stars 426 forks source link

panic: agent tsnet server is not running #2212

Open lucasfcnunes opened 1 month ago

lucasfcnunes commented 1 month ago

What happened?

syncer {"level":"error","ts":1728424782.3093603,"caller":"filters/wrap.go:54","msg":"timeout or abort while handling: method=GET URI=\"/v1-k3s/connect\" audit-ID=\"0e22dc61-7326-41bd-b5b2-2118554cee6f\"","component":"vcluster"}
syncer {"level":"info","ts":1728424808.669536,"caller":"commandwriter/commandwriter.go:126","msg":"Failed to get storage metrics","component":"vcluster","component":"k3s","location":"metrics.go:299","storage_cluster_id":"etcd-0","err":"rpc error: code = Unknown desc = sql: Scan error on column index 0, name \"SUM(data_length + index_length)\": converting driver.Value type []uint8 (\"2.5803878052e+10\") to a int64: invalid syntax"}
syncer {"level":"info","ts":1728424838.662725,"caller":"commandwriter/commandwriter.go:126","msg":"Failed to get storage metrics","component":"vcluster","component":"k3s","location":"metrics.go:299","storage_cluster_id":"etcd-0","err":"rpc error: code = Unknown desc = sql: Scan error on column index 0, name \"SUM(data_length + index_length)\": converting driver.Value type []uint8 (\"2.6911196616e+10\") to a int64: invalid syntax"}
syncer panic: agent tsnet server is not running
syncer 
syncer goroutine 471 [running]:
syncer github.com/loft-sh/vcluster-pro/pkg/tailscale.ConnectToPlatform.func3()
syncer     github.com/loft-sh/vcluster-pro/pkg/tailscale/tsnet.go:190 +0x3ce
syncer created by github.com/loft-sh/vcluster-pro/pkg/tailscale.ConnectToPlatform in goroutine 1
syncer     github.com/loft-sh/vcluster-pro/pkg/tailscale/tsnet.go:178 +0xeff
Stream closed EOF for vcluster/vcluster-dev-74dd669c89-p67b9 (syncer)

What did you expect to happen?

No panic.

How can we reproduce it (as minimally and precisely as possible)?

Don't know

Anything else we need to know?

No response

Host cluster Kubernetes version

```console $ kubectl version Client Version: v1.31.1 Kustomize Version: v5.4.2 Server Version: v1.30.3-gke.1969001 ```

vcluster version

```console $ vcluster --version vcluster version 0.20.1 ```

VCluster Config

``` # My vcluster.yaml / values.yaml here ```
FabianKramm commented 1 month ago

@lucasfcnunes thanks for creating this issue! Can you run a kubectl delete secret vcluster-platform-api-key -n VCLUSTER_NAMESPACE and then restart the vCluster? It seems that this is caused by general networking issues, are you running in a special environment?