juicedata/juicefs · error

Invalid version string: %s

Error message

Invalid version string: %s

What it means

Returned by `juicefs config` when min-client-version or max-client-version is given a string that version.Parse cannot interpret. Client version gates must be valid semantic version strings, otherwise mixed-version safety checks would be meaningless.

Source

Thrown at cmd/config.go:347

				format.ChangeLogMaxAge = newAge
			}
		case "changelog-max-lines":
			if new := ctx.Int64(flag); new != format.ChangeLogMaxLines {
				if new < 0 {
					return fmt.Errorf("negative value for %s: %d", flag, new)
				}
				msg.WriteString(fmt.Sprintf("%10s: %d -> %d\n", flag, format.ChangeLogMaxLines, new))
				format.ChangeLogMaxLines = new
			}
		case "user-group-quota":
			if new := ctx.Bool(flag); new != format.UserGroupQuota {
				msg.WriteString(fmt.Sprintf("%10s: %t -> %t\n", flag, format.UserGroupQuota, new))
				format.UserGroupQuota = new
			}
		case "min-client-version":
			if new := ctx.String(flag); new != format.MinClientVersion {
				if version.Parse(new) == nil {
					return fmt.Errorf("Invalid version string: %s", new)
				}
				if compareVersion(new, format.MinClientVersion) < 0 {
					return fmt.Errorf("cannot lower min-client-version from %s to %s", format.MinClientVersion, new)
				}
				requireMinClientVersion(new)
			}
		case "max-client-version":
			if new := ctx.String(flag); new != format.MaxClientVersion {
				if version.Parse(new) == nil {
					return fmt.Errorf("Invalid version string: %s", new)
				}
				msg.WriteString(fmt.Sprintf("%s: %s -> %s\n", flag, format.MaxClientVersion, new))
				format.MaxClientVersion = new
				clientVer = true
			}
		case "enable-acl":
			if enableACL := ctx.Bool(flag); enableACL != format.EnableACL {
				if enableACL {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Use a full, well-formed version string, e.g. `--min-client-version 1.2.0`
  2. Check the exact format accepted by the version package (semver-like x.y.z)
  3. Copy the version from `juicefs version` output

Example fix

// before
juicefs config sqlite3://test.db --min-client-version 1.2
// after
juicefs config sqlite3://test.db --min-client-version 1.2.0
Defensive patterns

Strategy: validation

Validate before calling

[[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || die "invalid version: $VER"

Prevention

When it happens

Trigger: `juicefs config META --min-client-version 1.2` or any string not matching the expected version format (e.g. missing patch, stray characters).

Common situations: Hand-typing versions with typos; using 'v' prefixes or build metadata the parser rejects; scripting versions from non-normalized sources.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/88a563f1cc3d053e. Report an issue: GitHub.