SigNoz/signoz · error · errors.SignozError
ErrCodeInvalidResolver
ErrCodeInvalidResolver
Error message
cannot build resolver, no uris have been provided
What it means
Returned by NewResolver when ResolverConfig.Uris is empty — the config resolver has no configuration sources to read from, so it cannot be constructed. It fails fast to avoid a resolver that would silently resolve nothing.
Source
Thrown at pkg/config/resolver.go:31
type ResolverConfig struct {
// Each string or `uri` must follow "<scheme>:<value>" format. This format is compatible with the URI definition
// defined at https://datatracker.ietf.org/doc/html/rfc3986".
// It is required to have at least one uri.
Uris []string
// ProviderFactories is a slice of Provider factories.
// It is required to have at least one factory.
ProviderFactories []ProviderFactory
}
type Resolver struct {
uris []Uri
providers map[string]Provider
}
func NewResolver(config ResolverConfig) (*Resolver, error) {
if len(config.Uris) == 0 {
return nil, errors.New(errors.TypeInvalidInput, ErrCodeInvalidResolver, "cannot build resolver, no uris have been provided")
}
if len(config.ProviderFactories) == 0 {
return nil, errors.New(errors.TypeInvalidInput, ErrCodeInvalidResolver, "cannot build resolver, no providers have been provided")
}
uris := make([]Uri, len(config.Uris))
for i, inputUri := range config.Uris {
uri, err := NewUri(inputUri)
if err != nil {
return nil, err
}
uris[i] = uri
}
providers := make(map[string]Provider, len(config.ProviderFactories))
for _, factory := range config.ProviderFactories {View on GitHub (pinned to 5069bf80b0)
Solutions
- Pass at least one config URI: set Uris: []string{"file:///etc/signoz/config.yaml"} or equivalent --config flag
- If defaults are expected, populate them before calling NewResolver/New
- Check that code building the Uris slice actually appends (not just declares) entries
Example fix
// before
res, err := config.NewResolver(config.ResolverConfig{}) // error
// after
res, err := config.NewResolver(config.ResolverConfig{Uris: []string{"file:///etc/signoz/config.yaml"}, ProviderFactories: ...}) Defensive patterns
Strategy: validation
Validate before calling
if len(cfg.Uris) == 0 {
cfg.Uris = []string{"file:///etc/signoz/config.yaml"} // sensible default
}
res, err := config.NewResolver(cfg) Prevention
- Always pass at least one --config URI from CLI bootstrap
- Unit-test the config-loading entrypoint with no args to fail fast with a clear message
When it happens
Trigger: Calling config.NewResolver (usually via config.New) with ResolverConfig{Uis: nil} or an empty Uris slice, e.g. when no --config flag and no env/file URIs are supplied.
Common situations: CLI invoked without any --config=/path/file.yaml argument; config loading code that conditionally appends URIs and the condition never fired; default config URI removed in a refactor.
Related errors
- ErrCodeInvalidGatewayConfig
- CodeInvalidInput
- CodeInvalidInput
- ErrCodeIncorrectPassword
- CodeTooManyRequests
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/d088579593084a91.
Report an issue: GitHub.