{"record":{"id":"d088579593084a91","repo":"SigNoz/signoz","slug":"errcodeinvalidresolver","errorCode":"ErrCodeInvalidResolver","errorMessage":"cannot build resolver, no uris have been provided","messagePattern":"cannot build resolver, no uris have been provided","errorType":"error_code","errorClass":"errors.SignozError","httpStatus":400,"severity":"error","filePath":"pkg/config/resolver.go","lineNumber":31,"sourceCode":"type ResolverConfig struct {\n\t// Each string or `uri` must follow \"<scheme>:<value>\" format. This format is compatible with the URI definition\n\t// defined at https://datatracker.ietf.org/doc/html/rfc3986\".\n\t// It is required to have at least one uri.\n\tUris []string\n\n\t// ProviderFactories is a slice of Provider factories.\n\t// It is required to have at least one factory.\n\tProviderFactories []ProviderFactory\n}\n\ntype Resolver struct {\n\turis      []Uri\n\tproviders map[string]Provider\n}\n\nfunc NewResolver(config ResolverConfig) (*Resolver, error) {\n\tif len(config.Uris) == 0 {\n\t\treturn nil, errors.New(errors.TypeInvalidInput, ErrCodeInvalidResolver, \"cannot build resolver, no uris have been provided\")\n\t}\n\n\tif len(config.ProviderFactories) == 0 {\n\t\treturn nil, errors.New(errors.TypeInvalidInput, ErrCodeInvalidResolver, \"cannot build resolver, no providers have been provided\")\n\t}\n\n\turis := make([]Uri, len(config.Uris))\n\tfor i, inputUri := range config.Uris {\n\t\turi, err := NewUri(inputUri)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\turis[i] = uri\n\t}\n\n\tproviders := make(map[string]Provider, len(config.ProviderFactories))\n\tfor _, factory := range config.ProviderFactories {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/config/resolver.go#L13-L49","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nres, err := config.NewResolver(config.ResolverConfig{}) // error\n\n// after\nres, err := config.NewResolver(config.ResolverConfig{Uris: []string{\"file:///etc/signoz/config.yaml\"}, ProviderFactories: ...})","handlingStrategy":"validation","validationCode":"if len(cfg.Uris) == 0 {\n    cfg.Uris = []string{\"file:///etc/signoz/config.yaml\"} // sensible default\n}\nres, err := config.NewResolver(cfg)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["config","resolver","initialization","go"],"backgroundTag":"missing-config-source","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}