GoogleContainerTools/jib · warning

%s system property is set, but %s is not; attempting other a

Error message

%s system property is set, but %s is not; attempting other authentication methods.

What it means

ConfigurationPropertyValidator.getImageCredential logs this warning when exactly one of the username/password system properties (e.g. jib.to.auth.username / jib.to.auth.password) is set via -D flags while the other is missing. Jib cannot form a credential from half a pair, so it falls through to other authentication methods.

Source

Thrown at jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ConfigurationPropertyValidator.java:71

  public static Optional<Credential> getImageCredential(
      Consumer<LogEvent> logger,
      String usernameProperty,
      String passwordProperty,
      AuthProperty auth,
      RawConfiguration rawConfiguration) {
    // System property takes priority over build configuration
    String commandlineUsername = rawConfiguration.getProperty(usernameProperty).orElse("");
    String commandlinePassword = rawConfiguration.getProperty(passwordProperty).orElse("");
    if (!commandlineUsername.isEmpty() && !commandlinePassword.isEmpty()) {
      return Optional.of(Credential.from(commandlineUsername, commandlinePassword));
    }

    // Warn if a system property is missing
    String missingProperty =
        "%s system property is set, but %s is not; attempting other authentication methods.";
    if (!commandlinePassword.isEmpty()) {
      logger.accept(
          LogEvent.warn(String.format(missingProperty, passwordProperty, usernameProperty)));
    }
    if (!commandlineUsername.isEmpty()) {
      logger.accept(
          LogEvent.warn(String.format(missingProperty, usernameProperty, passwordProperty)));
    }

    // Check auth configuration next; warn if they aren't both set
    if (!Strings.isNullOrEmpty(auth.getUsername()) && !Strings.isNullOrEmpty(auth.getPassword())) {
      return Optional.of(Credential.from(auth.getUsername(), auth.getPassword()));
    }

    String missingConfig = "%s is missing from build configuration; ignoring auth section.";
    if (!Strings.isNullOrEmpty(auth.getPassword())) {
      logger.accept(LogEvent.warn(String.format(missingConfig, auth.getUsernameDescriptor())));
    }
    if (!Strings.isNullOrEmpty(auth.getUsername())) {
      logger.accept(LogEvent.warn(String.format(missingConfig, auth.getPasswordDescriptor())));
    }

View on GitHub (pinned to fb949e2676)

Solutions

  1. Set both system properties: -Djib.to.auth.username=... -Djib.to.auth.password=...
  2. Fix the property name typos (check which property the message reports as missing)
  3. Configure the credential pair in the build configuration auth block instead of partial system properties
  4. Rely on Docker config / credential helpers so a complete credential is found

Example fix

// before
mvn jib:build -Djib.to.auth.password=secret   # username missing
// after
mvn jib:build -Djib.to.auth.username=user -Djib.to.auth.password=secret
Defensive patterns

Strategy: validation

Validate before calling

// shell check before invoking the build
[ -n "$JIB_USERNAME" ] && [ -n "$JIB_PASSWORD" ] || { echo "Both jib.to.auth.username and jib.to.auth.password are required"; exit 1; }

Try / catch

// in CI, guard the pair
preBuildCheck() {
  test -n "$REGISTRY_USER" && test -n "$REGISTRY_PASS" || fail("incomplete registry credentials")
}

Prevention

When it happens

Trigger: Calling getImageCredential with a non-empty commandlinePassword but empty commandlineUsername — the message is formatted with (passwordProperty, usernameProperty) at line 71.

Common situations: CI pipelines exporting only JIB_PASSWORD but not JIB_USERNAME; typos in property names; someone setting only the password assuming the username comes from the Docker config.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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