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

Upgrade to rc4 with flux bootstrap outputs log.SetLogger(...) was never called #3931

Closed
1 task done
plockaby opened this issue May 30, 2023 · 4 comments · Fixed by #3932
Closed
1 task done

Upgrade to rc4 with flux bootstrap outputs log.SetLogger(...) was never called #3931

plockaby opened this issue May 30, 2023 · 4 comments · Fixed by #3932
Labels
bug Something isn't working

Comments

@plockaby
Copy link

plockaby commented May 30, 2023

Describe the bug

When I run flux bootstrap to upgrade to rc4 I'm getting an error from controller-runtime. The upgrade seems to be successful, regardless.

My upgrade command:

GITHUB_TOKEN= flux bootstrap github \
    --owner=XXXX \
    --repository=fluxcd \
    --path=./clusters/XXXX \
    --private \
    --read-write-key \
    --token-auth \
    --components=source-controller,kustomize-controller,helm-controller,notification-controller \
    --components-extra=image-reflector-controller,image-automation-controller \
    --interval=5m0s \
    --context=XXXX
► connecting to github.com
► cloning branch "main" from Git repository "https://github.com/XXXX/fluxcd.git"
✔ cloned repository
► generating component manifests
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
✔ generated component manifests
✔ committed sync manifests to "main" ("XXXX")
► pushing component manifests to "https://github.com/XXXX/fluxcd.git"
✔ reconciled components
► determining if source secret "flux-system/flux-system" exists
► generating source secret
► applying source secret "flux-system/flux-system"
✔ reconciled source secret
► generating sync manifests
✔ generated sync manifests
✔ sync manifests are up to date
► applying sync manifests
✔ reconciled sync configuration
◎ waiting for Kustomization "flux-system/flux-system" to be reconciled
✔ Kustomization reconciled successfully
[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.20.4/x64/src/runtime/debug/stack.go:24 +0x65
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/log/log.go:59 +0xbd
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0003e5a40, {0x2474abf, 0x14})
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/log/deleg.go:147 +0x4c
github.com/go-logr/logr.Logger.WithName({{0x285e390, 0xc0003e5a40}, 0x0}, {0x2474abf?, 0x0?})
	/home/runner/go/pkg/mod/github.com/go-logr/logr@v1.2.4/logr.go:336 +0x46
sigs.k8s.io/controller-runtime/pkg/client.newClient(0xc002d22900, {0x0, 0x0, {0x2860990, 0xc000896680}, 0x0, {0x0, 0x0}, 0x0})
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/client/client.go:115 +0xb4
sigs.k8s.io/controller-runtime/pkg/client.New(0xc0016d9600?, {0x0, 0x0, {0x2860990, 0xc000896680}, 0x0, {0x0, 0x0}, 0x0})
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/client/client.go:101 +0x85
github.com/fluxcd/flux2/v2/pkg/status.NewStatusChecker(0x28597a0?, 0x12a05f200, 0x45d964b800, {0x285eff0?, 0xc0002c7c70})
	/home/runner/work/flux2/flux2/pkg/status/status.go:53 +0xda
github.com/fluxcd/flux2/v2/pkg/bootstrap.(*PlainGitBootstrapper).ReportComponentsHealth(_, {_, _}, {{0x24aa918, 0x28}, {0xc000054d20, 0xb}, {0x2460d06, 0xb}, {0xc000173e00, ...}, ...}, ...)
	/home/runner/work/flux2/flux2/pkg/bootstrap/bootstrap_plain_git.go:421 +0x85
github.com/fluxcd/flux2/v2/pkg/bootstrap.Run({_, _}, {_, _}, {_, _}, {{0x24aa918, 0x28}, {0xc000054d20, 0xb}, ...}, ...)
	/home/runner/work/flux2/flux2/pkg/bootstrap/bootstrap.go:105 +0x303
main.bootstrapGitHubCmdRun(0x3aff100?, {0x24516b9?, 0xa?, 0xa?})
	/home/runner/work/flux2/flux2/cmd/flux/bootstrap_github.go:274 +0x15a8
github.com/spf13/cobra.(*Command).execute(0x3aff100, {0xc0004b9900, 0xa, 0xa})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x3af3340)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
main.main()
	/home/runner/work/flux2/flux2/cmd/flux/main.go:173 +0x32
► confirming components are healthy
✔ helm-controller: deployment ready
✔ image-automation-controller: deployment ready
✔ image-reflector-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ notification-controller: deployment ready
✔ source-controller: deployment ready
✔ all components are healthy

Also the warning about patchesJson6902 being deprecated is interesting. The only place that is being referenced is in the gotk-components.yaml so hopefully that goes away soon?

Steps to reproduce

  1. Start with rc3 and bootstrap it to rc4
  2. Watch error appear in output

Expected behavior

I would expect no errors when doing a bootstrap upgrade.

Screenshots and recordings

No response

OS / Distro

Debian Bullseye

Flux version

v2.0.0-rc.4

Flux check

► checking prerequisites
✔ Kubernetes 1.26.4+k3s1 >=1.20.6-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.34.0
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.34.0
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.28.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.0.0-rc.4
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.0.0-rc.4
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.0.0-rc.4
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta2
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta2
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

GitHub

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@aryan9600
Copy link
Member

related upstream change: kubernetes-sigs/controller-runtime@ed8be90.
there is no actual error being thrown here, it's just the current stack being printed through debug.Stack(),

@aryan9600
Copy link
Member

setting log.SetLogger(logr.Discard()) doesn't help because of kubernetes-sigs/controller-runtime#2352

@aryan9600
Copy link
Member

aryan9600 commented May 30, 2023

setting log.SetLogger(logr.New(log.NullLogSink{})) manages to avoid this. might be worth it to add this to our codebase for now, but imo controller-runtime should provide an option to disable not be logging such a big non-error.

@stefanprodan stefanprodan added the bug Something isn't working label May 30, 2023
@stefanprodan stefanprodan changed the title upgrade to rc4 with flux bootstrap throws error Upgrade to rc4 with flux bootstrap outputs log.SetLogger(...) was never called May 30, 2023
@plockaby
Copy link
Author

Thanks for the fast fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants