{"record":{"id":"710c5def21fb857a","repo":"OpenNHP/opennhp","slug":"unknown-remote-provider-710c5d","errorCode":null,"errorMessage":"unknown remote provider","messagePattern":"unknown remote provider","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"endpoints/server/config.go","lineNumber":482,"sourceCode":"\t\t\treturn nil\n\t\t}\n\n\t\tif len(conf.Key) == 0 {\n\t\t\tlog.Error(\"remote config has no key,open nhp server will startup with local configuration\")\n\t\t\treturn nil\n\t\t}\n\n\t\ts.etcdConn = &etcd.EtcdConn{\n\t\t\tEndpoints: conf.Endpoints,\n\t\t\tUsername:  conf.Username,\n\t\t\tPassword:  conf.Password,\n\t\t\tKey:       conf.Key,\n\t\t}\n\n\t\terr = s.etcdConn.InitClient()\n\t\treturn err\n\t} else {\n\t\treturn errors.New(\"unknown remote provider\")\n\t}\n\n}\n\nfunc (s *UdpServer) loadRemoteBaseConfig() error {\n\tvar serverEtcdConfig ServerEtcdConfig\n\tvalue, err := s.etcdConn.GetValue()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = toml.Unmarshal(value, &serverEtcdConfig); err != nil {\n\t\tlog.Error(\"failed to unmarshal remote config: %v\", err)\n\t\treturn err\n\t}\n\n\terr = s.updateBaseConfig(serverEtcdConfig.BaseConfig)\n\treturn err\n}","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/OpenNHP/opennhp/blob/6e04ca5ff03222a699c24205cd4bf8fee9af7ffe/endpoints/server/config.go#L464-L500","documentation":"Identical guard to the AC's initRemoteConn but in UdpServer: when the configured remote provider is not the supported one (etcd), Start() fails with this sentinel error before the server can load remote base config.","triggerScenarios":"Start() -> initRemoteConn runs while the server config's remote provider value is empty or not the supported 'etcd' string.","commonSituations":"Mis-edited config.toml, templating variable left unsubstituted (e.g. ${REMOTE_PROVIDER}), or copying a config from a project using a different provider such as consul.","solutions":["Set the remote provider field to the supported value (etcd) in the server config","Check the rendered config on the host for empty/unsubstituted provider values","Remove the remote config block if remote config is not intended","Log the received provider value when extending the switch to catch future typos"],"exampleFix":"// before (config.toml)\n[remote]\nprovider = \"\"\n// after\n[remote]\nprovider = \"etcd\"","handlingStrategy":"validation","validationCode":"if s.conf.Remote.Provider != \"etcd\" {\n    return fmt.Errorf(\"server config: unsupported remote provider %q\", s.conf.Remote.Provider)\n}","typeGuard":"func isValidRemoteProvider(p string) bool { return p == \"etcd\" }","tryCatchPattern":"err := s.Start()\nif err != nil && err.Error() == \"unknown remote provider\" {\n    log.Fatalf(\"check [remote] provider in server config: %v\", err)\n}","preventionTips":["Use envsubst templates with required-variable enforcement so provider can never render empty","Validate configs with a schema/linter in the deploy pipeline","Document the single supported provider value in config comments"],"tags":["go","config","etcd"],"backgroundTag":"invalid-config-value","analyzedSha":"6e04ca5ff03222a699c24205cd4bf8fee9af7ffe","analyzedAt":"2026-09-07T15:44:59.941Z","contentChangedAt":"2026-09-07T15:44:59.941Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}