alibaba/nacos · error · IllegalArgumentException

min check time for http or tcp is too small(<500)

Error message

min check time for http or tcp is too small(<500)

What it means

Thrown by validateHealthParams when healthParams.getMin() < SwitchDomain.HttpHealthParams.MIN_MIN (500 ms). This is the minimum health-check interval; values below 500ms would cause excessive health-check traffic. Applies to both http and tcp health params (both call validateHealthParams).

Source

Thrown at naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java:387

        switchDomain.setPushGoVersion(newSwitchDomain.getPushVersionOfGo());
        switchDomain.setPushJavaVersion(newSwitchDomain.getPushVersionOfJava());
        switchDomain.setPushPythonVersion(newSwitchDomain.getPushVersionOfPython());
        switchDomain.setPushCVersion(newSwitchDomain.getPushVersionOfC());
        switchDomain.setPushCSharpVersion(newSwitchDomain.getPushVersionOfCsharp());
        switchDomain.setEnableAuthentication(newSwitchDomain.isEnableAuthentication());
        switchDomain.setOverriddenServerStatus(newSwitchDomain.getOverriddenServerStatus());
        switchDomain.setDefaultInstanceEphemeral(newSwitchDomain.isDefaultInstanceEphemeral());
        switchDomain.setLightBeatEnabled(newSwitchDomain.isLightBeatEnabled());
    }
    
    /**
     * Validate health params.
     *
     * @param healthParams health params
     */
    public void validateHealthParams(SwitchDomain.HealthParams healthParams) {
        if (healthParams.getMin() < SwitchDomain.HttpHealthParams.MIN_MIN) {
            throw new IllegalArgumentException("min check time for http or tcp is too small(<500)");
        }
        
        if (healthParams.getMax() < SwitchDomain.HttpHealthParams.MIN_MAX) {
            
            throw new IllegalArgumentException(
                "max check time for http or tcp is too small(<3000)");
        }
        
        if (healthParams.getFactor() < 0 || healthParams.getFactor() > 1) {
            
            throw new IllegalArgumentException("malformed factor");
        }
    }
    
    private void updateWithConsistency(SwitchDomain tempSwitchDomain) throws NacosException {
        try {
            final BatchWriteRequest req = new BatchWriteRequest();
            String switchDomainKey = KeyBuilder.getSwitchDomainKey();

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Set the 'min' field to >= 500 (milliseconds).
  2. Ensure min <= max and both are reasonable for your check type.

Example fix

// before
PUT /v3/admin/ns/operator/switches?entry=httpHealthParams&value={"min":100,"max":5000,"factor":0.85}
// after
PUT /v3/admin/ns/operator/switches?entry=httpHealthParams&value={"min":500,"max":5000,"factor":0.85}
Defensive patterns

Strategy: validation

Validate before calling

if (healthParams.getMin() < 500) {
    throw new IllegalArgumentException("Health check min must be >= 500ms");
}

Type guard

function isValidMin(min: number): boolean {
  return min >= 500;
}

Try / catch

try {
  operatorV2Impl.updateSwitch(entry, json, debug);
} catch (NacosApiException e) {
  if (e.getMessage().includes("min check time")) {
    params.min = 500; // clamp
    json = JSON.stringify(params);
  }
}

Prevention

When it happens

Trigger: PUT /v3/admin/ns/operator/switches with entry=httpHealthParams or tcpHealthParams and a valid JSON whose 'min' field is < 500, e.g. {"min":100,"max":5000,"factor":0.85}.

Common situations: Aggressive health-check tuning, or confusing min with factor.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/86eef78a4468cc76. Report an issue: GitHub.