{"record":{"id":"e4f966aa77d8de74","repo":"GoogleContainerTools/jib","slug":"s-is-missing-from-build-configuration-ignoring-a","errorCode":null,"errorMessage":"%s is missing from build configuration; ignoring auth section.","messagePattern":"(.+?) is missing from build configuration; ignoring auth section\\.","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":85,"sourceCode":"    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    }\n\n    return Optional.empty();\n  }\n\n  /**\n   * Returns an {@link ImageReference} parsed from the configured target image, or one of the form\n   * {@code project-name:project-version} if target image is not configured.\n   *\n   * @param targetImage the configured target image reference\n   * @param projectProperties the {@link ProjectProperties} providing the project name, version, and\n   *     log event handler\n   * @param helpfulSuggestions used for generating the message notifying the user of the generated\n   *     tag\n   * @return an {@link ImageReference} parsed from the configured target image, or one of the form","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ConfigurationPropertyValidator.java#L67-L103","documentation":"ConfigurationPropertyValidator.getImageCredential logs this warning when the build configuration's auth section has a password but no username (the message reports the missing username via auth.getUsernameDescriptor()). The incomplete auth entry is ignored and Jib falls back to other credential sources.","triggerScenarios":"build.gradle/pom.xml contains to.auth.password (non-empty) while to.auth.username is null/empty; the check at line 85 fires inside getImageCredential before returning Optional.empty().","commonSituations":"Editing build files and forgetting one auth field; templated configs where a variable (e.g. ${REGISTRY_USER}) resolves to empty; migrating configs and dropping one line.","solutions":["Add the missing username to the auth block in the build configuration","Check that any variable used for the username resolves to a non-empty value in the build environment","Remove the auth block entirely if you intend to use system properties or a credential helper","Validate the full credential pair before the build (fail fast with a pre-build check)"],"exampleFix":"// before: build.gradle\njib { to { auth { password = 'secret' } } }\n// after\njib { to { auth { username = 'user'; password = 'secret' } } }","handlingStrategy":"validation","validationCode":"// gradle pre-flight: auth must be a complete pair\nafterEvaluate {\n  def auth = jib.to.auth\n  if ((auth.password && !auth.username) || (auth.username && !auth.password))\n    throw new GradleException(\"jib.to.auth requires both username and password\")\n}","typeGuard":null,"tryCatchPattern":"def credential = null\nif (auth?.username && auth?.password) credential = Credential.from(auth.username, auth.password)\n// otherwise skip auth entirely instead of a partial config","preventionTips":["Keep auth username/password together in one config block","Avoid interpolated variables in auth fields that may resolve to empty strings","Centralize registry credentials in one reviewed location"],"tags":["authentication","configuration","gradle","jib"],"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"}