{"record":{"id":"542c9e3cadb3ac87","repo":"GoogleContainerTools/jib","slug":"s-system-property-is-set-but-s-is-not-attempti","errorCode":null,"errorMessage":"%s system property is set, but %s is not; attempting other authentication methods.","messagePattern":"(.+?) system property is set, but (.+?) is not; attempting other authentication methods\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ConfigurationPropertyValidator.java","lineNumber":71,"sourceCode":"  public static Optional<Credential> getImageCredential(\n      Consumer<LogEvent> logger,\n      String usernameProperty,\n      String passwordProperty,\n      AuthProperty auth,\n      RawConfiguration rawConfiguration) {\n    // System property takes priority over build configuration\n    String commandlineUsername = rawConfiguration.getProperty(usernameProperty).orElse(\"\");\n    String commandlinePassword = rawConfiguration.getProperty(passwordProperty).orElse(\"\");\n    if (!commandlineUsername.isEmpty() && !commandlinePassword.isEmpty()) {\n      return Optional.of(Credential.from(commandlineUsername, commandlinePassword));\n    }\n\n    // Warn if a system property is missing\n    String missingProperty =\n        \"%s system property is set, but %s is not; attempting other authentication methods.\";\n    if (!commandlinePassword.isEmpty()) {\n      logger.accept(\n          LogEvent.warn(String.format(missingProperty, passwordProperty, usernameProperty)));\n    }\n    if (!commandlineUsername.isEmpty()) {\n      logger.accept(\n          LogEvent.warn(String.format(missingProperty, usernameProperty, passwordProperty)));\n    }\n\n    // Check auth configuration next; warn if they aren't both set\n    if (!Strings.isNullOrEmpty(auth.getUsername()) && !Strings.isNullOrEmpty(auth.getPassword())) {\n      return Optional.of(Credential.from(auth.getUsername(), auth.getPassword()));\n    }\n\n    String missingConfig = \"%s is missing from build configuration; ignoring auth section.\";\n    if (!Strings.isNullOrEmpty(auth.getPassword())) {\n      logger.accept(LogEvent.warn(String.format(missingConfig, auth.getUsernameDescriptor())));\n    }\n    if (!Strings.isNullOrEmpty(auth.getUsername())) {\n      logger.accept(LogEvent.warn(String.format(missingConfig, auth.getPasswordDescriptor())));\n    }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ConfigurationPropertyValidator.java#L53-L89","documentation":"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.","triggerScenarios":"Calling getImageCredential with a non-empty commandlinePassword but empty commandlineUsername — the message is formatted with (passwordProperty, usernameProperty) at line 71.","commonSituations":"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.","solutions":["Set both system properties: -Djib.to.auth.username=... -Djib.to.auth.password=...","Fix the property name typos (check which property the message reports as missing)","Configure the credential pair in the build configuration auth block instead of partial system properties","Rely on Docker config / credential helpers so a complete credential is found"],"exampleFix":"// before\nmvn jib:build -Djib.to.auth.password=secret   # username missing\n// after\nmvn jib:build -Djib.to.auth.username=user -Djib.to.auth.password=secret","handlingStrategy":"validation","validationCode":"// shell check before invoking the build\n[ -n \"$JIB_USERNAME\" ] && [ -n \"$JIB_PASSWORD\" ] || { echo \"Both jib.to.auth.username and jib.to.auth.password are required\"; exit 1; }","typeGuard":null,"tryCatchPattern":"// in CI, guard the pair\npreBuildCheck() {\n  test -n \"$REGISTRY_USER\" && test -n \"$REGISTRY_PASS\" || fail(\"incomplete registry credentials\")\n}","preventionTips":["Always pass username/password system properties as a pair","CI: assert both secrets exist before the build step","Prefer a credential helper or complete auth config over ad-hoc -D flags"],"tags":["authentication","configuration","jib","system-properties"],"backgroundTag":"missing-required-config-field","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}