GoogleContainerTools/jib · error · NumberFormatException
property + " must be an integer: " + value
Error message
property + " must be an integer: " + value
What it means
JibSystemProperties.checkNumericSystemProperty validates numeric Jib system properties (HTTP timeout, proxy port). This NumberFormatException is thrown when the property value cannot be parsed as an integer at all. It wraps the parse failure with the property name and offending value for clarity.
Source
Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/global/JibSystemProperties.java:136
* jib.skipExistingImages} system property.
*
* @return {@code true} if Jib should skip pushing tags to existing images, {@code false} if not
*/
public static boolean skipExistingImages() {
return Boolean.getBoolean(SKIP_EXISTING_IMAGES);
}
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
- Set the property to a plain integer, e.g. -Djib.httpTimeout=30
- Remove units and quotes from the value
- Check you are setting the correct property name with a numeric value
- Validate build.gradle/pom.xml and CI config for the -D flags
Example fix
// before
jib {
// containerizer.environment or jvmFlags passing bad value
}
// gradle: gradle jib -Djib.httpTimeout=30s
// after
gradle jib -Djib.httpTimeout=30000 Defensive patterns
Strategy: validation
Validate before calling
String v = System.getProperty("jib.httpTimeout");
if (v != null && !v.matches("\\d+")) throw new IllegalArgumentException("jib.httpTimeout must be an integer: " + v); Try / catch
try { jibStep(); } catch (NumberFormatException e) { if (e.getMessage().contains("must be an integer")) { failBuild("Fix -Djib property value: " + e.getMessage()); } throw e; } Prevention
- Pass numeric Jib properties as bare integers with no units or quotes
- Keep property names and values together in one place (gradle.properties/CI vars) to avoid mixups
- Lint CI scripts for -Djib.* flags
When it happens
Trigger: Setting a system property like sendCredentialsOverHttp... specifically jib.httpTimeout or jib.proxy.port (or their -D flags) to a non-integer string, e.g. -Djib.httpTimeout=30s or -Djib.proxy.port=abc.
Common situations: Typos in numeric flags, passing values with units ("30s", "10ms"), copying config values with quotes or whitespace, mixing up property names so a non-numeric value lands in a numeric property.
Understand the failure class
Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.
Related errors
- property + " cannot be less than " + validRange.lowerEndpoin
- property + " cannot be greater than " + validRange.upperEndp
- <field> is required but not set
- jib.to.tags contains empty tag
- <from><platforms> contains a platform configuration that is
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/ea7c78d24b5164fe.
Report an issue: GitHub.