{"record":{"id":"8defb0920e008d59","repo":"phacility/phabricator","slug":"user-aborted-workflow","errorCode":null,"errorMessage":"User aborted workflow.","messagePattern":"User aborted workflow\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"info","filePath":"src/applications/almanac/management/AlmanacManagementTrustKeyWorkflow.php","lineNumber":77,"sourceCode":"      \"**<bg:red> %s </bg>**\\n\\n%s\\n\\n%s\\n\\n%s\",\n      pht('IMPORTANT!'),\n      phutil_console_wrap(\n        pht(\n          'Trusting a public key gives anyone holding the corresponding '.\n          'private key complete, unrestricted access to all data. The '.\n          'private key will be able to sign requests that bypass policy and '.\n          'security checks.')),\n      phutil_console_wrap(\n        pht(\n          'This is an advanced feature which should normally be used only '.\n          'when building a cluster. This feature is very dangerous if '.\n          'misused.')),\n      pht('This key is associated with device \"%s\".', $handle->getName()));\n\n    $prompt = pht(\n      'Really trust this key?');\n    if (!phutil_console_confirm($prompt)) {\n      throw new PhutilArgumentUsageException(\n        pht('User aborted workflow.'));\n    }\n\n    $key->setIsTrusted(1);\n    $key->save();\n\n    PhabricatorAuthSSHKeyQuery::deleteSSHKeyCache();\n\n    $console->writeOut(\n      \"**<bg:green> %s </bg>** %s\\n\",\n      pht('TRUSTED'),\n      pht('Key %s has been marked as trusted.', $id));\n  }\n\n}\n","sourceCodeStart":59,"sourceCodeEnd":93,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/almanac/management/AlmanacManagementTrustKeyWorkflow.php#L59-L93","documentation":"Raised at the end of the trust-key workflow when the operator declines the final 'Really trust this key?' confirmation. phutil_console_confirm() returned false (answer 'n' or no readable 'y' from stdin), so the workflow converts the decline into a PhutilArgumentUsageException and exits without changing the key: setIsTrusted(1) and save() are never reached.","triggerScenarios":"Executing ./bin/almanac trust-key --id N interactively and answering 'n'; or running it non-interactively (cron, piped stdin, no TTY) where the confirm prompt gets EOF instead of 'y'.","commonSituations":"Automating trust-key in a deploy script without feeding stdin; operator hesitating at the red 'bypass policy and security checks' warning; CI jobs or SSH sessions without an interactive terminal.","solutions":["If you intended to trust the key, re-run the command and answer 'y' at the prompt.","When automating, supply the confirmation explicitly: printf 'y\\n' | ./bin/almanac trust-key --id N (or yes | ...), knowing this trusts the key unattended.","If you declined deliberately, nothing is broken: the key's isTrusted flag is unchanged; verify in the UI if unsure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // invoke trust-key workflow\n} catch (PhutilArgumentUsageException $ex) {\n  if ($ex->getMessage() === pht('User aborted workflow.')) {\n    // Deliberate decline: exit cleanly, key untouched.\n    exit(0);\n  }\n  throw $ex;\n}","preventionTips":["Run trust-key from an interactive TTY when a human should confirm.","In automation, feed the answer explicitly: printf 'y\\n' | ./bin/almanac trust-key --id N.","Never assume EOF counts as consent - treat non-interactive runs as declines until stdin is wired."],"tags":["almanac","cli","interactive-confirm","phabricator","ssh-keys"],"backgroundTag":"operation-cancelled-by-user","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}