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

Intermittent Logging Setup Not Called and Timeout Error during vcluster list #2195

Open CB122023 opened 1 month ago

CB122023 commented 1 month ago

What happened?

Here’s the full error message I received during vcluster list:

% vcluster list

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
    >  goroutine 1 [running]:
    >  runtime/debug.Stack()
    >   runtime/debug/stack.go:24 +0x64
    >  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
    >   sigs.k8s.io/controller-runtime@v0.18.4/pkg/log/log.go:60 +0xf4
    >  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0x1400035ca40, {0x105ee15c8, 0x9})
    >   sigs.k8s.io/controller-runtime@v0.18.4/pkg/log/deleg.go:147 +0x34
    >  github.com/go-logr/logr.Logger.WithName(...)
    >   github.com/go-logr/logr@v1.4.2/logr.go:345
    >  github.com/loft-sh/vcluster/pkg/util/loghelper.New({0x105ee15c8?, 0x14000901500?})
    >   github.com/loft-sh/vcluster/pkg/util/loghelper/loghelper.go:24 +0x58
    >  github.com/loft-sh/vcluster/pkg/telemetry.newCLICollector()
    >   github.com/loft-sh/vcluster/pkg/telemetry/collect_cli.go:54 +0x34
    >  github.com/loft-sh/vcluster/pkg/telemetry.StartCLI(0x1400052cc00?)
    >   github.com/loft-sh/vcluster/pkg/telemetry/collect_cli.go:42 +0x68
    >  github.com/loft-sh/vcluster/cmd/vclusterctl/cmd.BuildRoot.NewRootCmd.func1(0x1400052cc00?, {0x108273520?, 0x4?, 0x105ed76f0?})
    >   github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/root.go:46 +0xfc
    >  github.com/spf13/cobra.(*Command).execute(0x140003a5208, {0x108273520, 0x0, 0x0})
    >   github.com/spf13/cobra@v1.8.0/command.go:961 +0x6e4
    >  github.com/spf13/cobra.(*Command).ExecuteC(0x140003a4908)
    >   github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
    >  github.com/spf13/cobra.(*Command).Execute(...)
    >   github.com/spf13/cobra@v1.8.0/command.go:1039
    >  github.com/spf13/cobra.(*Command).ExecuteContext(...)
    >   github.com/spf13/cobra@v1.8.0/command.go:1032
    >  github.com/loft-sh/vcluster/cmd/vclusterctl/cmd.Execute()
    >   github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/root.go:78 +0xd0
    >  main.main()
    >   github.com/loft-sh/vcluster/cmd/vclusterctl/main.go:17 +0x30

    NAME | NAMESPACE | STATUS | VERSION | CONNECTED | AGE  
  -------+-----------+--------+---------+-----------+------

What did you expect to happen?

The vcluster list command should display a list of virtual clusters without logging errors or timeouts.

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

Not sure if it could be reproducible

Anything else we need to know?

While this issue doesn't happen all the time, it does occur occasionally. I’m sharing the logs in hopes that they might point to an underlying problem.

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-beta.2 ```

VCluster Config

``` # My vcluster.yaml / values.yaml here ```