GoogleContainerTools/jib · error · NumberFormatException

property + " cannot be greater than " + validRange.upperEndp

Error message

property + " cannot be greater than " + validRange.upperEndpoint() + ": " + value

What it means

The mirror of the lower-bound check: thrown when a numeric Jib system property parses but exceeds the property's upper bound. The message includes the property name, the maximum allowed, and the offending value.

Source

Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/global/JibSystemProperties.java:142

  }

  private static void checkNumericSystemProperty(String property, Range<Integer> validRange) {
    String value = System.getProperty(property);
    if (value == null) {
      return;
    }

    int parsed;
    try {
      parsed = Integer.parseInt(value);
    } catch (NumberFormatException ex) {
      throw new NumberFormatException(property + " must be an integer: " + value);
    }
    if (validRange.hasLowerBound() && validRange.lowerEndpoint() > parsed) {
      throw new NumberFormatException(
          property + " cannot be less than " + validRange.lowerEndpoint() + ": " + value);
    } else if (validRange.hasUpperBound() && validRange.upperEndpoint() < parsed) {
      throw new NumberFormatException(
          property + " cannot be greater than " + validRange.upperEndpoint() + ": " + value);
    }
  }

  private JibSystemProperties() {}
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use a proxy port in 1-65535, e.g. -Djib.proxy.port=8080
  2. Cap jib.httpTimeout at the documented maximum (Integer-range) milliseconds
  3. Remove the property to use defaults
  4. Fix typos/extra digits in the value

Example fix

// before
gradle jib -Djib.proxy.port=80800
// after
gradle jib -Djib.proxy.port=8080
Defensive patterns

Strategy: validation

Validate before calling

int port = Integer.parseInt(System.getProperty("jib.proxy.port", "0"));
if (port < 1 || port > 65535) throw new IllegalArgumentException("jib.proxy.port out of range: " + port);

Try / catch

try { jibStep(); } catch (NumberFormatException e) { if (e.getMessage().contains("cannot be greater than")) { failBuild("Value too large: " + e.getMessage()); } throw e; }

Prevention

When it happens

Trigger: Setting -Djib.httpTimeout above the maximum allowed milliseconds value, or -Djib.proxy.port greater than 65535.

Common situations: Setting a port like 80800 (typo, extra digit), huge timeout values meant as 'infinite', unexpanded template variables resolving to absurd numbers.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/85fbbf172d5c9428. Report an issue: GitHub.