{"record":{"id":"0494ec76ee19095d","repo":"Netflix/chaosmonkey","slug":"failed-viper-addremoteprovider-provider-s-endp","errorCode":null,"errorMessage":"failed viper.AddRemoteProvider(provider=\"%s\", endpoint=\"%s\", path=\"%s\"):","messagePattern":"failed viper\\.AddRemoteProvider\\(provider=\"(.+?)\", endpoint=\"(.+?)\", path=\"(.+?)\"\\):","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/monkey.go","lineNumber":164,"sourceCode":"\n\treturn m, nil\n\n}\n\n// configureRemote configures viper for a remote provider if the user has\n// specified one\nfunc (m *Monkey) configureRemote() error {\n\tprovider := m.v.GetString(param.DynamicProvider)\n\tendpoint := m.v.GetString(param.DynamicEndpoint)\n\tpath := m.v.GetString(param.DynamicPath)\n\n\t// If the user specified an external provider, use it\n\tif provider != \"\" {\n\t\tm.remote = true\n\t\tm.v.SetConfigType(\"json\")\n\t\terr := m.v.AddRemoteProvider(provider, endpoint, path)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"failed viper.AddRemoteProvider(provider=\\\"%s\\\", endpoint=\\\"%s\\\", path=\\\"%s\\\"):\", provider, endpoint, path)\n\t\t}\n\t}\n\treturn nil\n}\n\n// SetRemoteProvider sets remote configuration parameters.\n// These will typically be set by parsing the config files. This method\n// exists to facilitate testing\nfunc (m *Monkey) SetRemoteProvider(provider string, endpoint string, path string) error {\n\tm.v.Set(param.DynamicProvider, provider)\n\tm.v.Set(param.DynamicEndpoint, endpoint)\n\tm.v.Set(param.DynamicPath, path)\n\n\treturn m.configureRemote()\n}\n\n// Set overrides the config value. Used for testing\nfunc (m *Monkey) Set(key string, value interface{}) {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/config/monkey.go#L146-L182","documentation":"Returned by Monkey.configureRemote when viper rejects the dynamic-config provider registration, e.g. an unsupported provider name or conflicting duplicate provider; the provider, endpoint and path in the message identify which dynamic-config settings are at fault.","triggerScenarios":"Setting a remote provider via Load, NewFromReader, or SetRemoteProvider with an unsupported provider name, malformed endpoint URL, or invalid path.","commonSituations":"Provider name typo (e.g. \"Consul\" instead of \"consul\"), missing scheme in the endpoint, remote config feature enabled without required params.","solutions":["Use a supported provider string exactly: \"consul\", \"etcd\", or \"firestore\"","Ensure the endpoint is a full URL like \"http://127.0.0.1:8500\"","Verify provider/endpoint/path are all set consistently before calling SetRemoteProvider","Check the wrapped viper error for the specific validation failure"],"exampleFix":"// before\nm.SetRemoteProvider(\"Consul\", \"127.0.0.1:8500\", \"chaosmonkey/config\")\n// after\nm.SetRemoteProvider(\"consul\", \"http://127.0.0.1:8500\", \"chaosmonkey/config\")","handlingStrategy":"validation","validationCode":"var validProviders = map[string]bool{\"consul\": true, \"etcd\": true, \"firestore\": true}\nif provider != \"\" && !validProviders[provider] {\n    return fmt.Errorf(\"unsupported remote provider %q; use consul, etcd, or firestore\", provider)\n}\nif provider != \"\" && !strings.Contains(endpoint, \"://\") {\n    return fmt.Errorf(\"endpoint must be a full URL, got %q\", endpoint)\n}","typeGuard":null,"tryCatchPattern":"if err := m.SetRemoteProvider(provider, endpoint, path); err != nil {\n    log.Printf(\"remote provider setup failed: %v\", errors.Unwrap(err))\n    return err\n}","preventionTips":["Use exact provider names: consul/etcd/firestore","Always pass a full URL as the endpoint","Set provider, endpoint, and path together","Test remote config connectivity in CI"],"tags":["config","viper","remote-provider"],"backgroundTag":"remote-config-provider-invalid","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}