{"record":{"id":"c15b3365b544cb04","repo":"semaphoreui/semaphore","slug":"access-key-type-not-supported-for-ansible-password","errorCode":null,"errorMessage":"access key type not supported for ansible password vault","messagePattern":"access key type not supported for ansible password vault","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ssh/agent.go","lineNumber":210,"sourceCode":"type KeyInstaller struct{}\n\nfunc (KeyInstaller) Install(key db.AccessKey, usage db.AccessKeyRole, logger task_logger.Logger) (installation AccessKeyInstallation, err error) {\n\n\tswitch usage {\n\tcase db.AccessKeyRoleGit:\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\t}\n\tcase db.AccessKeyRoleAnsiblePasswordVault:\n\t\tswitch key.Type {\n\t\tcase db.AccessKeyLoginPassword:\n\t\t\tinstallation.Password = key.LoginPassword.Password\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"access key type not supported for ansible password vault\")\n\t\t}\n\tcase db.AccessKeyRoleAnsibleBecomeUser:\n\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:","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/pkg/ssh/agent.go#L192-L228","documentation":"Returned by KeyInstaller.Install in pkg/ssh/agent.go when an access key is used in the Ansible password vault role but its type is not db.AccessKeyLoginPassword. The switch over key.Type falls to the default branch, meaning an SSH key or other non-login-password key type was attached where the vault requires a literal password credential.","triggerScenarios":"Thrown at pkg/ssh/agent.go:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Attach a login/password type access key to the environment's vault slot instead of an SSH key","Create a dedicated LoginPassword access key holding the Ansible vault password and reference that key for the vault role","Validate the access key type in the UI/API at attachment time so the mismatch is caught before task startup"],"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"}