Skip to content

Non-JSON log line "remote error: tls: unknown certificate" #254

@NorseGaud

Description

@NorseGaud

The following are the logs I'm seeing from the prometheus exporter I've built. The last line happens when I launch the landing page/url in my browser. The cert is self-signed so I expect it to maybe warn, but I certainly don't expect it to be non-JSON as I'm passing my logger in and it uses JSON.

	if err := web.ListenAndServe(&http.Server{}, &web.FlagConfig{
		WebListenAddresses: &[]string{server.webListenAddress},
		WebConfigFile:      &server.configFile,
	}, log.Logger); err != nil {
		log.Error(fmt.Sprintf("Error starting web server: %s", err.Error()))
		os.Exit(1)
	}
❯ go run -ldflags="-X main.version=$(cat VERSION) -X main.commit=$(git rev-parse HEAD)" main.go --controller-address http://anka.controller:8090 -web.config.file web.config.yml
{"time":"2024-09-17T20:42:55.378809-05:00","level":"INFO","msg":"Starting Prometheus Exporter for Anka (3.0.1)"}
{"time":"2024-09-17T20:42:55.443433-05:00","level":"INFO","msg":"Serving metrics at :2112/metrics"}
{"time":"2024-09-17T20:42:55.443825-05:00","level":"INFO","msg":"Listening on","address":"[::]:2112"}
{"time":"2024-09-17T20:42:55.444787-05:00","level":"INFO","msg":"TLS is enabled.","http2":true,"address":"[::]:2112"}
2024/09/17 20:43:53 http: TLS handshake error from 127.0.0.1:54574: remote error: tls: unknown certificate

I'm having trouble finding where this comes from though. It seems to be generated from something not using the logger I passed in.

Any recommendations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions