router-for-me/CLIProxyAPI · error
codex.live-media-relay cannot set both allow-private-remote-
Error message
codex.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips
What it means
Configuration decode error for codex.live-media-relay: both the deprecated allow-private-remote-ips key and its replacement disable-private-remote-ips were present in the same relay block. Because one is the boolean inverse of the other, setting both is ambiguous, so the decoder rejects the combination instead of guessing precedence.
Source
Thrown at internal/config/codex_live.go:47
key := value.Content[index].Value
switch key {
case "allow-private-remote-ips":
var setting bool
if errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {
return fmt.Errorf("decode codex.live-media-relay.allow-private-remote-ips: %w", errDecode)
}
allowPrivate = &setting
case "disable-private-remote-ips":
var setting bool
if errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {
return fmt.Errorf("decode codex.live-media-relay.disable-private-remote-ips: %w", errDecode)
}
disablePrivate = &setting
}
}
}
if allowPrivate != nil && disablePrivate != nil {
return errors.New("codex.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips")
}
if allowPrivate != nil {
decoded.DisablePrivateRemoteIPs = !*allowPrivate
log.Warn("codex.live-media-relay.allow-private-remote-ips is deprecated; use disable-private-remote-ips with the inverse value")
}
*c = CodexLiveMediaRelayConfig(decoded)
return nil
}
// EffectiveMaxSessions returns the configured media session limit.
func (c CodexLiveMediaRelayConfig) EffectiveMaxSessions() int {
if c.MaxSessions > 0 {
return c.MaxSessions
}
return DefaultCodexLiveMediaMaxSessions
}
// Validate verifies the Codex Live media relay configuration.View on GitHub (pinned to 78f0c4079e)
Solutions
- Open the config file, find the codex.live-media-relay block, and delete allow-private-remote-ips
- Keep disable-private-remote-ips with the inverse boolean value of the old key (allow-private: true becomes disable-private: false)
- Reload/restart the server and confirm the deprecation warning no longer appears
Example fix
# before
codex:
live-media-relay:
allow-private-remote-ips: false
disable-private-remote-ips: true
# after
codex:
live-media-relay:
disable-private-remote-ips: true Defensive patterns
Strategy: validation
Validate before calling
# Pre-flight config check before starting the server grep -n 'allow-private-remote-ips' config.yaml && grep -n 'disable-private-remote-ips' config.yaml && echo "ERROR: both keys set" || echo OK
Try / catch
// If loading config programmatically:
if err := cfg.Codex.LiveMediaRelay.UnmarshalKDL(node); err != nil {
if strings.Contains(err.Error(), "cannot set both allow-private-remote-ips and disable-private-remote-ips") {
log.Fatal("remove the deprecated allow-private-remote-ips key from codex.live-media-relay")
}
return err
} Prevention
- Finish deprecation migrations in one commit: add the new key, delete the old one
- Lint config files for known-deprecated keys in CI
- Note the inversion: allow-private-remote-ips: false equals disable-private-remote-ips: true
When it happens
Trigger: A config.yaml (or KDL config) codex.live-media-relay map containing both allow-private-remote-ips: <bool> and disable-private-remote-ips: <bool>.
Common situations: Migrating an old config to the new key name and forgetting to delete the deprecated line; merging config templates where both keys survived.
Related errors
- codex.live-media-relay.max-sessions must not be negative
- codex.live-media-relay UDP port minimum and maximum must bot
- codex.live-media-relay.udp-port-min must not exceed udp-port
- upstream WebRTC offer is empty
- Codex live media session closed while configuring TCP proxy
AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15).
Data as JSON: /api/errors/a2101e2b5b06081f.
Report an issue: GitHub.