{"record":{"id":"6c42e307ab1b5b9d","repo":"semaphoreui/semaphore","slug":"access-key-does-not-suite-for-inventory-s-user-cre","errorCode":null,"errorMessage":"access key does not suite for inventory's user credentials","messagePattern":"access key does not suite for inventory's user credentials","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/tasks/local_executor.go","lineNumber":483,"sourceCode":"\t}\n\n\tif t.Inventory.SSHKeyID != nil {\n\t\tswitch t.Inventory.SSHKey.Type {\n\t\tcase db.AccessKeySSH:\n\t\t\tif t.sshKeyInstallation.Login != \"\" {\n\t\t\t\targs = append(args, \"--user\", t.sshKeyInstallation.Login)\n\t\t\t}\n\t\tcase db.AccessKeyLoginPassword:\n\t\t\tif t.sshKeyInstallation.Login != \"\" {\n\t\t\t\targs = append(args, \"--user\", t.sshKeyInstallation.Login)\n\t\t\t}\n\t\t\tif t.sshKeyInstallation.Password != \"\" {\n\t\t\t\targs = append(args, \"--ask-pass\")\n\t\t\t\tinputMap[db.AccessKeyRoleAnsibleUser] = t.sshKeyInstallation.Password\n\t\t\t}\n\t\tcase db.AccessKeyNone:\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"access key does not suite for inventory's user credentials\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif t.Inventory.BecomeKeyID != nil {\n\t\tswitch t.Inventory.BecomeKey.Type {\n\t\tcase db.AccessKeyLoginPassword:\n\t\t\tif t.becomeKeyInstallation.Login != \"\" {\n\t\t\t\targs = append(args, \"--become-user\", t.becomeKeyInstallation.Login)\n\t\t\t}\n\t\t\tif t.becomeKeyInstallation.Password != \"\" {\n\t\t\t\targs = append(args, \"--ask-become-pass\")\n\t\t\t\tinputMap[db.AccessKeyRoleAnsibleBecomeUser] = t.becomeKeyInstallation.Password\n\t\t\t}\n\t\tcase db.AccessKeyNone:\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"access key does not suite for inventory's sudo user credentials\")\n\t\t\treturn","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/services/tasks/local_executor.go#L465-L501","documentation":"When building ansible-playbook arguments, the executor selects SSH arguments based on the inventory's login (user) key type: SSH keys, login/password keys, or explicitly no key (AccessKeyNone). Any other key type (e.g. a key type meant only for become/root or an unknown type) cannot provide user credentials, so preparation fails with this error.","triggerScenarios":"Attaching an access key as the inventory's login key whose db.AccessKey.Type is not ssh/privatekey, login_password, or none — for instance selecting an unsupported/newer key type, or a key of the wrong kind saved to Inventory.SshKeyID.","commonSituations":"User picks the wrong access key in the inventory form; a key of a new type created by a newer Semaphore version is used with an older executor; migration left an unexpected key type on the inventory.","solutions":["Open the inventory settings and choose a login access key of type SSH key or login/password","Create a suitable access key (SSH private key or username/password) and attach it to the inventory","Set the key type to 'none' (AccessKeyNone) if the target genuinely needs no user credentials","Upgrade Semaphore so both server and executor recognize the key type in use"],"exampleFix":"// before\nInventory.SshKeyID -> key with Type: \"vault_generic\" (unsupported)\n// after\nInventory.SshKeyID -> key with Type: db.AccessKeySSH (ssh private key) or db.AccessKeyLoginPassword","handlingStrategy":"validation","validationCode":"if inv.SshKey != nil {\n    switch inv.SshKey.Type {\n    case db.AccessKeySSH, db.AccessKeyLoginPassword, db.AccessKeyNone:\n        // ok\n    default:\n        return fmt.Errorf(\"login key %q type %q not usable for user credentials\", inv.SshKey.Name, inv.SshKey.Type)\n    }\n}","typeGuard":"func loginKeyUsable(k *db.AccessKey) bool {\n    return k == nil || k.Type == db.AccessKeySSH || k.Type == db.AccessKeyLoginPassword || k.Type == db.AccessKeyNone\n}","tryCatchPattern":null,"preventionTips":["Attach only SSH or login/password keys as inventory login keys","Validate key type when saving inventory via API","Recreate keys through the UI if imported from another Semaphore version","Keep server and executor builds on the same version"],"tags":["go","ansible","ssh"],"backgroundTag":"incompatible-source-type","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"}