{"record":{"id":"9c1d6719da5dc41b","repo":"phacility/phabricator","slug":"specify-the-name-of-an-object-to-unlock","errorCode":null,"errorMessage":"Specify the name of an object to unlock.","messagePattern":"Specify the name of an object to unlock\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php","lineNumber":55,"sourceCode":"          array(\n            'name' => 'owner',\n            'param' => 'username',\n            'help' => pht(\n              'Change the owner of an object to the specified user.'),\n          ),\n          array(\n            'name' => 'objects',\n            'wildcard' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $object_names = $args->getArg('objects');\n    if (!$object_names) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify the name of an object to unlock.'));\n    } else if (count($object_names) > 1) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify the name of exactly one object to unlock.'));\n    }\n\n    $object_name = head($object_names);\n\n    $object = id(new PhabricatorObjectQuery())\n      ->setViewer($viewer)\n      ->withNames(array($object_name))\n      ->executeOne();\n    if (!$object) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Unable to find any object with the specified name (\"%s\").',\n          $object_name));\n    }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php#L37-L73","documentation":"bin/policy unlock rewrites an object's policies to rescue objects nobody can reach. It requires exactly one object name; an empty `objects` argument throws this usage exception before anything is loaded.","triggerScenarios":"Running ./bin/policy unlock with no arguments.","commonSituations":"Exploring the rescue tooling and forgetting the argument in runbooks or incident scripts.","solutions":["Pass one object name plus a capability flag: ./bin/policy unlock T123 --edit alice","If you only want to inspect policies, use ./bin/policy show T123 instead."],"exampleFix":"# before\n./bin/policy unlock\n# after\n./bin/policy unlock T123 --edit alice","handlingStrategy":"validation","validationCode":"#!/bin/sh\n[ \"$#\" -ge 1 ] || { echo 'usage: bin/policy unlock <object> --view|--edit|--owner <user>' >&2; exit 64; }\nexec ./bin/policy unlock \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write incident runbooks with the full command including object and flags.","Use ./bin/policy show when inspection is the goal."],"tags":["phabricator","cli","usage","policy","unlock"],"backgroundTag":"cli-missing-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}