Skip to content
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

Error no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\" in gitjob logs after start #2471

Closed
1 task done
thehejik opened this issue May 30, 2024 · 3 comments
Labels
Milestone

Comments

@thehejik
Copy link

thehejik commented May 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After initial start of gitjob pod I see following error in logs. The error is occurring twice and then stops appearing:

{
  "level": "error",
  "ts": "2024-05-29T15:10:23Z",
  "logger": "controller-runtime.source.EventHandler",
  "msg": "if kind is a CRD, it should be installed before calling Start",
  "kind": "GitRepo.fleet.cattle.io",
  "error": "no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"",
  "stacktrace": "sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:63\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func1\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:53\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:54\nk8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/poll.go:33\nsigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:56"
}

Reproducer

  • install rancher:v2.9-c42447977787af1230f82e3dcf92c4895d5723df-head with fleet 104.0.0+up0.10.0-rc.14
  • login to rancher and let fleet to initialize
  • Without adding any resources into fleet run kubectl logs -n cattle-fleet-system -lapp=gitjob
  • see the error
Full gitjob log
# kubectl logs -n cattle-fleet-system -lapp=gitjob 
{"level":"info","ts":"2024-05-29T15:10:23Z","logger":"setup","msg":"Setting up webhook listener"}
{"level":"info","ts":"2024-05-29T15:10:23Z","msg":"Starting EventSource","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","source":"kind source: *v1alpha1.GitRepo"}
{"level":"info","ts":"2024-05-29T15:10:23Z","msg":"Starting EventSource","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","source":"kind source: *v1.Job"}
{"level":"info","ts":"2024-05-29T15:10:23Z","msg":"Starting Controller","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo"}
{"level":"error","ts":"2024-05-29T15:10:23Z","logger":"controller-runtime.source.EventHandler","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GitRepo.fleet.cattle.io","error":"no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:63\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func1\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:53\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:54\nk8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/poll.go:33\nsigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:56"}
{"level":"error","ts":"2024-05-29T15:10:33Z","logger":"controller-runtime.source.EventHandler","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GitRepo.fleet.cattle.io","error":"no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:63\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func2\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:87\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:88\nk8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/poll.go:33\nsigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:56"}
{"level":"info","ts":"2024-05-29T15:10:43Z","msg":"Starting workers","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","worker count":1}

Expected Behavior

There should not be any error in logs.

@thehejik thehejik added this to the v2.9.0 milestone May 30, 2024
@thehejik
Copy link
Author

The error is still appearing also in latest fleet-104.0.0+up0.10.0-rc.14

$ kubectl logs -n cattle-fleet-system -lapp=gitjob -f
{"level":"info","ts":"2024-06-12T13:19:56Z","logger":"setup","msg":"starting manager"}
{"level":"info","ts":"2024-06-12T13:19:56Z","logger":"setup","msg":"Setting up webhook listener"}
{"level":"info","ts":"2024-06-12T13:19:56Z","logger":"controller-runtime.metrics","msg":"Starting metrics server"}
{"level":"info","ts":"2024-06-12T13:19:56Z","msg":"Starting EventSource","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","source":"kind source: *v1alpha1.GitRepo"}
{"level":"info","ts":"2024-06-12T13:19:56Z","msg":"Starting EventSource","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","source":"kind source: *v1.Job"}
{"level":"info","ts":"2024-06-12T13:19:56Z","msg":"Starting Controller","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo"}
{"level":"info","ts":"2024-06-12T13:19:56Z","logger":"controller-runtime.metrics","msg":"Serving metrics server","bindAddress":":8081","secure":false}
{"level":"error","ts":"2024-06-12T13:19:56Z","logger":"controller-runtime.source.EventHandler","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GitRepo.fleet.cattle.io","error":"no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:63\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func1\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:53\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:54\nk8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/poll.go:33\nsigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:56"}
{"level":"error","ts":"2024-06-12T13:20:06Z","logger":"controller-runtime.source.EventHandler","msg":"if kind is a CRD, it should be installed before calling Start","kind":"GitRepo.fleet.cattle.io","error":"no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:63\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func2\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:87\nk8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/loop.go:88\nk8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/poll.go:33\nsigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/source/kind.go:56"}
{"level":"info","ts":"2024-06-12T13:20:16Z","msg":"Starting workers","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","worker count":1}

@manno
Copy link
Member

manno commented Jul 9, 2024

This is most likely due to the way Rancher installs Fleet. Maybe it's not waiting long enough for the CRD chart.
However, if I understand that error is ephemeral and the controller will eventually work without a restart.

@kkaempf kkaempf modified the milestones: v2.9.0, v2.9-Next1 Jul 31, 2024
@mmartin24
Copy link
Collaborator

Thanks. Confirmed they are ephemeral and they do disappear once CRD are installed so closing ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants