{"record":{"id":"02422d1ae230c8e6","repo":"hashicorp/packer","slug":"one-authentication-method-must-be-specified-pleas","errorCode":null,"errorMessage":"one authentication method must be specified, please reference your communicator documentation","messagePattern":"one authentication method must be specified, please reference your communicator documentation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"builder/null/config.go","lineNumber":53,"sourceCode":"\tvar errs *packersdk.MultiError\n\tif es := c.CommConfig.Prepare(nil); len(es) > 0 {\n\t\terrs = packersdk.MultiErrorAppend(errs, es...)\n\t}\n\n\tif c.CommConfig.Type != \"none\" {\n\t\tif c.CommConfig.Host() == \"\" {\n\t\t\terrs = packersdk.MultiErrorAppend(errs,\n\t\t\t\tfmt.Errorf(\"a Host must be specified, please reference your communicator documentation\"))\n\t\t}\n\n\t\tif c.CommConfig.User() == \"\" {\n\t\t\terrs = packersdk.MultiErrorAppend(errs,\n\t\t\t\tfmt.Errorf(\"a Username must be specified, please reference your communicator documentation\"))\n\t\t}\n\n\t\tif !c.CommConfig.SSHAgentAuth && c.CommConfig.Password() == \"\" && c.CommConfig.SSHPrivateKeyFile == \"\" {\n\t\t\terrs = packersdk.MultiErrorAppend(errs,\n\t\t\t\tfmt.Errorf(\"one authentication method must be specified, please reference your communicator documentation\"))\n\t\t}\n\n\t\tif (c.CommConfig.SSHAgentAuth &&\n\t\t\t(c.CommConfig.SSHPassword != \"\" || c.CommConfig.SSHPrivateKeyFile != \"\")) ||\n\t\t\t(c.CommConfig.SSHPassword != \"\" && c.CommConfig.SSHPrivateKeyFile != \"\") {\n\t\t\terrs = packersdk.MultiErrorAppend(errs,\n\t\t\t\tfmt.Errorf(\"only one of ssh_agent_auth, ssh_password, and ssh_private_key_file must be specified\"))\n\n\t\t}\n\t}\n\n\tif errs != nil && len(errs.Errors) > 0 {\n\t\treturn nil, errs\n\t}\n\n\treturn nil, nil\n}\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/builder/null/config.go#L35-L71","documentation":"Config validation error from the null builder's Prepare: the communicator is enabled but none of ssh_agent_auth, ssh_password, or ssh_private_key_file is configured, leaving no way to authenticate. Fires when all three auth inputs are empty/false.","triggerScenarios":"Thrown at builder/null/config.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ssh_password or communicator.password for password auth","Set ssh_private_key_file (or ssh_keypair_name with agent auth) for key auth","Enable ssh_agent_auth = true to use keys loaded in your SSH agent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}