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

/healthz logs errors #2914

Closed
davidkarlsen opened this issue Apr 27, 2020 · 3 comments · Fixed by #3102
Closed

/healthz logs errors #2914

davidkarlsen opened this issue Apr 27, 2020 · 3 comments · Fixed by #3102
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@davidkarlsen
Copy link

davidkarlsen commented Apr 27, 2020

Bug Report

What did you do?
call pod:8686/healthz endpoint.
It returns the "ok" payload and everything seems fine. But logs are full of

github-actions-runner-operator-bb98fd99b-m87r6 github-actions-runner-operator {"level":"error","ts":1587974842.2687132,"logger":"kubemetrics","msg":"Unable to write to serve custom metrics","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/runner/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.51.al/operator-framework/operator-sdk/pkg/kube-metrics.ServeMetrics.func1\n\t/home/runner/go/pkg/mod/github.com/operator-framework/operator-sdk@v0.17.0/pkg/kube-metrics/server.go:39\nnet/http.HandlerFunc.ServeHTTP\n\t/opt/hostedtoolcache/go/1.13.10/x64/src/net/http/server.go:2007\nnet/http.(*ServeMux).ServeHTTP\n\t/opt/hostedtoolcache/go/1.13.10/x64/src/net/http/server.go:2387\nnet/http.serverHandler.ServeHTTP\n\t/opt/hostedtoolcache/go/1.13.10/x64/src/net/http/server.go:2802\nnet/http.(*conn).serve\n\t/opt/hostedtoolcache/go/1.13.10/x64/src/net/http/server.go:1890"}

What did you expect to see?
No log message

What did you see instead? Under which circumstances?
See above

Environment

  • operator-sdk version:
    v0.17.0

  • go version:
    1.13.10

  • Kubernetes version information:

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T23:35:15Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.9+icp-ee", GitCommit:"fccfecc454d446967475ce34d13d3d63d407bf09", GitTreeState:"clean", BuildDate:"2019-08-27T08:46:50Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
But it also happens on newer versions.

  • Kubernetes cluster kind:
    ** IBM Cloud private
    ** docker for desktop

  • Are you writing your operator in ansible, helm, or go?
    go

Additional context
code:
https://github.com/evryfs/github-actions-runner-operator/

@camilamacedo86
Copy link
Contributor

HI @davidkarlsen,

Your error came from :

        mux.HandleFunc(healthzPath, func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(200)
		_, err := w.Write([]byte("ok"))
		log.Error(err, "Unable to write to serve custom metrics")
	})

ref.: https://github.com/operator-framework/operator-sdk/blob/master/pkg/kube-metrics/server.go#L36-L56

By looking at the code, shows that the error Unable to write to serve custom metrics will be retuned always when the endpoint /healthz is called. @joelanford have you more context over it? Could you give a hand with?

@camilamacedo86 camilamacedo86 added metrics triage/support Indicates an issue that is a support question. labels Apr 27, 2020
@estroz
Copy link
Member

estroz commented Apr 27, 2020

Sounds like we just need to check the error.

@estroz estroz removed the triage/support Indicates an issue that is a support question. label Apr 27, 2020
@estroz
Copy link
Member

estroz commented Apr 27, 2020

/kind bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants