{"record":{"id":"a96a366f52fe97f7","repo":"nats-io/nats-server","slug":"minimum-version-required","errorCode":null,"errorMessage":"minimum version required","messagePattern":"minimum version required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/errors.go","lineNumber":220,"sourceCode":"\n\t// ErrMalformedSubject is returned when a subscription is made with a subject that does not conform to subject rules.\n\tErrMalformedSubject = errors.New(\"malformed subject\")\n\n\t// ErrSubscribePermissionViolation is returned when processing of a subscription fails due to permissions.\n\tErrSubscribePermissionViolation = errors.New(\"subscribe permission violation\")\n\n\t// ErrNoTransforms signals no subject transforms are available to map this subject.\n\tErrNoTransforms = errors.New(\"no matching transforms available\")\n\n\t// ErrCertNotPinned is returned when pinned certs are set and the certificate is not in it\n\tErrCertNotPinned = errors.New(\"certificate not pinned\")\n\n\t// ErrDuplicateServerName is returned when processing a server remote connection and\n\t// the server reports that this server name is already used in the cluster.\n\tErrDuplicateServerName = errors.New(\"duplicate server name\")\n\n\t// ErrMinimumVersionRequired is returned when a connection is not at the minimum version required.\n\tErrMinimumVersionRequired = errors.New(\"minimum version required\")\n\t// ErrLeafNodeMinVersionRejected is the leafnode protocol error prefix used\n\t// when rejecting a remote due to leafnodes.min_version.\n\tErrLeafNodeMinVersionRejected = errors.New(\"connection rejected since minimum version required is\")\n\n\t// ErrInvalidMappingDestination is used for all subject mapping destination errors\n\tErrInvalidMappingDestination = errors.New(\"invalid mapping destination\")\n\n\t// ErrInvalidMappingDestinationSubject is used to error on a bad transform destination mapping\n\tErrInvalidMappingDestinationSubject = fmt.Errorf(\"%w: invalid transform\", ErrInvalidMappingDestination)\n\n\t// ErrMappingDestinationNotUsingAllWildcards is used to error on a transform destination not using all of the token wildcards\n\tErrMappingDestinationNotUsingAllWildcards = fmt.Errorf(\"%w: not using all of the token wildcard(s)\", ErrInvalidMappingDestination)\n\n\t// ErrUnknownMappingDestinationFunction is returned when a subject mapping destination contains an unknown mustache-escaped mapping function.\n\tErrUnknownMappingDestinationFunction = fmt.Errorf(\"%w: unknown function\", ErrInvalidMappingDestination)\n\n\t// ErrMappingDestinationIndexOutOfRange is returned when the mapping destination function is passed an out of range wildcard index value for one of it's arguments\n\tErrMappingDestinationIndexOutOfRange = fmt.Errorf(\"%w: wildcard index out of range\", ErrInvalidMappingDestination)","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/errors.go#L202-L238","documentation":"ErrMinimumVersionRequired is returned when a connection is not at the minimum version required. It is used mainly for leaf node connections: when leafnodes.min_version is configured and the connecting leaf's version is too old, processLeafConnect sends a rejection and returns this sentinel, which the parse loop (server/client.go:1574) special-cases because the connection was already closed.","triggerScenarios":"A leaf node connects to a server configured with leafnodes { min_version: \"x.y.z\" } and the leaf's protocol version is below that minimum; processLeafConnect (server/leafnode.go:2275) closes the connection with MinimumVersionRequired and returns ErrMinimumVersionRequired.","commonSituations":"Upgrading hub servers to a version that enforces leafnodes.min_version while edge leaf servers remain on old binaries; mixed-version fleets after a rolling upgrade; ignoring leafnodes.min_version in config.","solutions":["Upgrade the connecting leaf node's nats-server (or client) binary to at least the configured leafnodes.min_version.","If old leaves must be supported temporarily, lower or remove leafnodes.min_version on the hub.","Check versions on both sides (nats-server --version) before rolling out min_version enforcement."],"exampleFix":"# before (hub)\nleafnodes {\n  min_version: \"2.10.0\"\n}\n# leaf runs 2.9.x -> rejected\n# after\n# upgrade leaf: nats-server --version >= 2.10.0, or set min_version: \"2.9.0\" temporarily","handlingStrategy":"validation","validationCode":"// check before connecting a leaf\nif versionCompare(leafVersion, requiredMinVersion) < 0 {\n    return fmt.Errorf(\"leaf version %s < required %s\", leafVersion, requiredMinVersion)\n}","typeGuard":null,"tryCatchPattern":"if errors.Is(err, server.ErrMinimumVersionRequired) {\n    log.Fatalf(\"leaf node too old: upgrade to >= leafnodes.min_version\")\n}","preventionTips":["Pin nats-server versions across hub and leaves in deployment tooling.","Verify versions in CI before enabling leafnodes.min_version.","Upgrade leaves before tightening min_version on hubs."],"tags":["nats","leafnode","version","compatibility"],"backgroundTag":"minimum-version-required","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}