ipfs/kubo · error
config setting IPNS.RepublishPeriod is not between 1min and
Error message
config setting IPNS.RepublishPeriod is not between 1min and 1day: %s
What it means
Kubo validates IPNS.RepublishPeriod at daemon startup while constructing the Online node (fx dependency graph in Networked). The republisher interval must be at least 1 minute and at most 24 hours (unless util.Debug is set), because republishing more often floods the DHT and less often lets records go stale. The daemon fails to start if the configured duration falls outside that range.
Source
Thrown at core/node/groups.go:335
if ipnsCacheSize == 0 {
ipnsCacheSize = DefaultIpnsCacheSize
}
if ipnsCacheSize < 0 {
return fx.Error(errors.New("cannot specify negative resolve cache size"))
}
// Republisher params
var repubPeriod, recordLifetime time.Duration
if cfg.Ipns.RepublishPeriod != "" {
d, err := time.ParseDuration(cfg.Ipns.RepublishPeriod)
if err != nil {
return fx.Error(fmt.Errorf("failure to parse config setting IPNS.RepublishPeriod: %s", err))
}
if !util.Debug && (d < time.Minute || d > (time.Hour*24)) {
return fx.Error(fmt.Errorf("config setting IPNS.RepublishPeriod is not between 1min and 1day: %s", d))
}
repubPeriod = d
}
if cfg.Ipns.RecordLifetime != "" {
d, err := time.ParseDuration(cfg.Ipns.RecordLifetime)
if err != nil {
return fx.Error(fmt.Errorf("failure to parse config setting IPNS.RecordLifetime: %s", err))
}
recordLifetime = d
}
isBitswapLibp2pEnabled := cfg.Bitswap.Libp2pEnabled.WithDefault(config.DefaultBitswapLibp2pEnabled)
isBitswapServerEnabled := cfg.Bitswap.ServerEnabled.WithDefault(config.DefaultBitswapServerEnabled)
isHTTPRetrievalEnabled := cfg.HTTPRetrieval.Enabled.WithDefault(config.DefaultHTTPRetrievalEnabled)
View on GitHub (pinned to 329838acdf)
Solutions
- Run `ipfs config Ipns.RepublishPeriod` to see the current value, then set it inside 1m-24h: `ipfs config Ipns.RepublishPeriod 4h`
- Remove the setting entirely (`ipfs config --json Ipns.RepublishPeriod ""` or delete the key) to use the default republish interval
- If you really need faster republishing for testing, build with the debug tag (util.Debug) — not recommended for production
Example fix
// before (config.json)
"Ipns": { "RepublishPeriod": "30s" }
// after
"Ipns": { "RepublishPeriod": "4h" } Defensive patterns
Strategy: validation
Validate before calling
d, err := time.ParseDuration(cfg.Ipns.RepublishPeriod)
if err != nil || (!debug && (d < time.Minute || d > 24*time.Hour)) {
return fmt.Errorf("IPNS.RepublishPeriod must be a Go duration between 1m and 24h, got %q", cfg.Ipns.RepublishPeriod)
} Prevention
- Validate IPNS.RepublishPeriod with time.ParseDuration and range-check 1m..24h before writing it via `ipfs config`
- Prefer leaving RepublishPeriod unset and rely on the default interval
When it happens
Trigger: Setting IPNS.RepublishPeriod in the config to a duration string that parses (e.g. "10s" or "25h" or "0") and starting the daemon with `ipfs daemon`; the check runs in the fx Online constructor when the value is non-empty.
Common situations: Users trying to speed up IPNS record propagation set it to seconds; users copying old examples set "0" expecting default behavior; typos like "1day" parse as something unexpected or the value exceeds 24h after a unit mistake (e.g. "1440h").
Related errors
- config setting IPNS.RepublishPeriod is not between 1min and
- serveHTTPGateway: GetConfig() failed: %s
- could not read config: %w
- failed to get repo path: %w
- failed to read config: %w
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/b3bbaa17e4d9edd5.
Report an issue: GitHub.