OpenNHP/opennhp · error

unknown remote provider

Error message

unknown remote provider

What it means

initRemoteConn in UdpAC only supports a fixed set of remote config providers; when the configured provider is anything other than the supported one (etcd), it returns this sentinel error. The AC daemon cannot start because its remote configuration source is unrecognized.

Solutions

  1. Set the remote config provider field in the AC config to the supported value (etcd)
  2. Check for typos/case mismatches in the provider string
  3. If no remote config is needed, remove or disable the remote config section rather than leaving a wrong provider value
  4. Verify the rendered config file that actually ships to the host contains the right provider

Example fix

// before (config.toml)
[remote]
provider = "etcdv3"
// after
[remote]
provider = "etcd"
Defensive patterns

Strategy: validation

Validate before calling

cfg, err := loadACConfig(path)
if err != nil { return err }
if cfg.Remote.Provider != "etcd" {
    return fmt.Errorf("AC config: unsupported remote provider %q (want \"etcd\")", cfg.Remote.Provider)
}

Type guard

func providerSupported(p string) bool { return strings.TrimSpace(p) == "etcd" }

Try / catch

if err := a.Start(); err != nil {
    if strings.Contains(err.Error(), "unknown remote provider") {
        log.Fatalf("fix [remote].provider in config; only 'etcd' is supported: %v", err)
    }
    return err
}

Prevention

When it happens

Trigger: Start() calls initRemoteConn while the 'provider' field in the AC's remote/etcd config section is empty, misspelled (e.g. 'etcdv3', 'consul'), or set to a provider other than the supported 'etcd'.

Common situations: Operators copy a config.toml from another deployment, hand-edit the provider field, or leave it blank when etcd is expected; upgrading configs across versions where provider names changed.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of OpenNHP/opennhp@6e04ca5ff0 (2026-09-07). Data as JSON: /api/errors/35a26fcd1acf1ee1. Report an issue: GitHub.

Appendix: source

Thrown at endpoints/ac/config.go:425

			return nil
		}

		if len(conf.Key) == 0 {
			log.Error("remote config has no key,open nhp server will startup with local configuration")
			return nil
		}

		a.etcdConn = &etcd.EtcdConn{
			Endpoints: conf.Endpoints,
			Username:  conf.Username,
			Password:  conf.Password,
			Key:       conf.Key,
		}

		err = a.etcdConn.InitClient()
		return err
	} else {
		return errors.New("unknown remote provider")
	}

}

func (a *UdpAC) loadRemoteConfig() error {
	value, err := a.etcdConn.GetValue()
	if err != nil {
		return err
	}
	//base config has been loaded and no secondary loading is required
	if err = a.updateEtcdConfig(value, false); err != nil {
		return err
	}

	go a.etcdConn.WatchValue(func(val []byte) {
		a.remoteConfigUpdateMutex.Lock()
		defer a.remoteConfigUpdateMutex.Unlock()
		_ = a.updateEtcdConfig(val, true)

View on GitHub (pinned to 6e04ca5ff0)