thanos-io/thanos · error
serve gRPC
Error message
serve gRPC
What it means
Raised in grpc.Server.ListenAndServe when grpc.Server.Serve(l) returns after the listener was successfully bound — i.e., serving failed or stopped with an error (listener closed unexpectedly, accept failure, TLS setup error). Startup is considered failed and the error is propagated to the caller.
Solutions
- Inspect the wrapped Serve error for accept or TLS handshake failures
- Check for processes interfering with the bound listener
- Review gRPC server options (credentials, TLS config) for validity
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at pkg/server/grpc/grpc.go:163 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/bbf5261467d3755c.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/server/grpc/grpc.go:163
return &Server{
logger: logger,
comp: comp,
srv: s,
opts: options,
}
}
// ListenAndServe listens on the TCP network address and handles requests on incoming connections.
func (s *Server) ListenAndServe() error {
l, err := net.Listen(s.opts.network, s.opts.listen)
if err != nil {
return errors.Wrapf(err, "listen gRPC on address %s", s.opts.listen)
}
s.listener = l
level.Info(s.logger).Log("msg", "listening for serving gRPC", "address", s.opts.listen)
return errors.Wrap(s.srv.Serve(s.listener), "serve gRPC")
}
func (s *Server) Address() string {
if s.listener != nil {
return s.listener.Addr().String()
}
return ""
}
// Shutdown gracefully shuts down the server by waiting,
// for specified amount of time (by gracePeriod) for connections to return to idle and then shut down.
func (s *Server) Shutdown(err error) {
level.Info(s.logger).Log("msg", "internal server is shutting down", "err", err)
if s.opts.gracePeriod == 0 {
s.srv.Stop()
level.Info(s.logger).Log("msg", "internal server is shutdown", "err", err)
returnView on GitHub (pinned to 35b8b99117)