{"record":{"id":"0cb562eaf34b0458","repo":"semaphoreui/semaphore","slug":"access-key-type-not-supported-for-ansible-user","errorCode":null,"errorMessage":"access key type not supported for ansible user","messagePattern":"access key type not supported for ansible user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ssh/agent.go","lineNumber":231,"sourceCode":"\t\tif key.Type != db.AccessKeyLoginPassword {\n\t\t\terr = fmt.Errorf(\"access key type not supported for ansible become user\")\n\t\t}\n\t\tinstallation.Login = key.LoginPassword.Login\n\t\tinstallation.Password = key.LoginPassword.Password\n\tcase db.AccessKeyRoleAnsibleUser:\n\t\tswitch key.Type {\n\t\tcase db.AccessKeySSH:\n\t\t\tvar agent Agent\n\t\t\tagent, err = StartSSHAgent(key, logger)\n\t\t\tinstallation.SSHAgent = &agent\n\t\t\tinstallation.Login = key.SshKey.Login\n\t\tcase db.AccessKeyLoginPassword:\n\t\t\tinstallation.Login = key.LoginPassword.Login\n\t\t\tinstallation.Password = key.LoginPassword.Password\n\t\tcase db.AccessKeyNone:\n\t\t\t// No SSH agent or password needed for ansible user with no access key.\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"access key type not supported for ansible user\")\n\t\t}\n\t}\n\n\treturn\n}\n","sourceCodeStart":213,"sourceCodeEnd":237,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/pkg/ssh/agent.go#L213-L237","documentation":"Returned by KeyInstaller.Install in pkg/ssh/agent.go when the access key used for the Ansible user role falls outside the supported types (SSH key, login/password, and the remaining handled case in that switch). Hitting the default/error branch of the switch over key.Type means the credential kind attached to the task cannot be installed for connecting to the target hosts — e.g. an unsupported or newly added key type was selected for the ansible user role.","triggerScenarios":"Thrown at pkg/ssh/agent.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Switch the environment's ansible-user access key to one of the supported types (SSH key or login/password)","If a new key type was introduced in db.AccessKey, extend this switch in KeyInstaller.Install with an installation path for it","Validate allowed key types per role when the environment is saved, not at task run time"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa","analyzedAt":"2026-09-07T11:00:33.293Z","contentChangedAt":"2026-09-07T11:00:33.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}