hashicorp/nomad · error

deploy_query_rate_limit must be greater than 0

Error message

deploy_query_rate_limit must be greater than 0

What it means

server.deploy_query_rate_limit controls the rate at which the server polls deployment watcher state queries. Zero is replaced by the built-in default (deploymentwatcher.LimitStateQueriesPerSecond), positive values are honored, but negative values are rejected by convertServerConfig because a negative rate limit is invalid.

Source

Thrown at command/agent/agent.go:620

	// Set max rpc conns; nil/0 == unlimited
	// Leave a little room for streaming RPCs
	minLimit := config.LimitsNonStreamingConnsPerClient + 5
	if agentConfig.Limits.RPCMaxConnsPerClient == nil || *agentConfig.Limits.RPCMaxConnsPerClient == 0 {
		conf.RPCMaxConnsPerClient = 0
	} else if limit := *agentConfig.Limits.RPCMaxConnsPerClient; limit <= minLimit {
		return nil, fmt.Errorf("rpc_max_conns_per_client must be > %d; found: %d", minLimit, limit)
	} else {
		conf.RPCMaxConnsPerClient = limit
	}

	// Set deployment rate limit
	if rate := agentConfig.Server.DeploymentQueryRateLimit; rate == 0 {
		conf.DeploymentQueryRateLimit = deploymentwatcher.LimitStateQueriesPerSecond
	} else if rate > 0 {
		conf.DeploymentQueryRateLimit = rate
	} else {
		return nil, fmt.Errorf("deploy_query_rate_limit must be greater than 0")
	}

	// Set plan rejection tracker configuration.
	if planRejectConf := agentConfig.Server.PlanRejectionTracker; planRejectConf != nil {
		if planRejectConf.Enabled != nil {
			conf.NodePlanRejectionEnabled = *planRejectConf.Enabled
		}
		conf.NodePlanRejectionThreshold = planRejectConf.NodeThreshold

		if planRejectConf.NodeWindow == 0 {
			return nil, fmt.Errorf("plan_rejection_tracker.node_window must be greater than 0")
		} else {
			conf.NodePlanRejectionWindow = planRejectConf.NodeWindow
		}
	}
	conf.PlanApplyPipeline = agentConfig.Server.PlanApplyPipeline

	// Add Enterprise license configs

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set deploy_query_rate_limit to a positive number, or remove it to use the default
  2. Fix the script/template that computed a negative rate
  3. If the goal is less deployment polling load, lower the positive value rather than going negative

Example fix

// before
server {
  deploy_query_rate_limit = -1
}
// after
server {
  deploy_query_rate_limit = 50.0
}
Defensive patterns

Strategy: validation

Validate before calling

// Go: ensure rate limit is positive before applying
if r := cfg.Server.DeploymentQueryRateLimit; r < 0 {
    return errors.New("deploy_query_rate_limit must be greater than 0")
}

Type guard

func isPositiveRate(r float64) bool {
    return r > 0
}

Prevention

When it happens

Trigger: Setting server { deploy_query_rate_limit = -1 } (or any negative number) in the agent config and starting the agent, or applying it through a config reload.

Common situations: Operators trying to 'disable' deployment polling with a negative number; automation generating rate limits from calculations that can go negative; sign typos in hand-edited config.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/d45de45dc6e73b66. Report an issue: GitHub.