{"record":{"id":"053922a00345272c","repo":"phacility/phabricator","slug":"request-parameter-s-is-not-formatted-properly","errorCode":null,"errorMessage":"Request parameter \"%s\" is not formatted properly. Expected a JSON object, but value does not start with \"{\".","messagePattern":"Request parameter \"(.+?)\" is not formatted properly\\. Expected a JSON object, but value does not start with \"\\{\"\\.","errorType":"validation","errorClass":"Exception","httpStatus":500,"severity":"error","filePath":"src/aphront/AphrontRequest.php","lineNumber":242,"sourceCode":"  }\n\n\n  /**\n   * @task data\n   */\n  public function getJSONMap($name, $default = array()) {\n    if (!isset($this->requestData[$name])) {\n      return $default;\n    }\n\n    $raw_data = phutil_string_cast($this->requestData[$name]);\n    $raw_data = trim($raw_data);\n    if (!strlen($raw_data)) {\n      return $default;\n    }\n\n    if ($raw_data[0] !== '{') {\n      throw new Exception(\n        pht(\n          'Request parameter \"%s\" is not formatted properly. Expected a '.\n          'JSON object, but value does not start with \"{\".',\n          $name));\n    }\n\n    try {\n      $json_object = phutil_json_decode($raw_data);\n    } catch (PhutilJSONParserException $ex) {\n      throw new Exception(\n        pht(\n          'Request parameter \"%s\" is not formatted properly. Expected a '.\n          'JSON object, but encountered a syntax error: %s.',\n          $name,\n          $ex->getMessage()));\n    }\n\n    return $json_object;","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/aphront/AphrontRequest.php#L224-L260","documentation":"Thrown by the Phabricator CLI workflow 'bin/repository thaw' when the operator supplies both an explicit list of repository identifiers and the '--all-repositories' flag. Thaw applies a cluster promote/demote either to named repositories or to every repository hosted on the target device, so providing both selectors is ambiguous and the workflow aborts before touching anything. It is a PhutilArgumentUsageException, meaning nothing has been executed yet.","triggerScenarios":"Running e.g. 'bin/repository thaw --demote device-1 --all-repositories R12 R13'. The wildcard 'repositories' argument collects R12/R13 while the flag is also true, so the 'if ($repository_names && $all_repositories)' guard at PhabricatorRepositoryManagementThawWorkflow.php:116 fires.","commonSituations":"Runbook commands copied into wrapper scripts that always add '--all-repositories'; operators tab-completing a previous thaw command and appending repo names on top of the flag; CI automation combining a template command with a dynamic repo list without checking for the flag.","solutions":["Drop '--all-repositories' from the command and keep the explicit repository list (or vice versa), then re-run.","If the intent is 'every repository on the device', keep only '--all-repositories' and remove the trailing repository arguments.","Audit wrapper scripts so the repo list and the flag are mutually exclusive before invoking bin/repository thaw."],"exampleFix":"# before\nbin/repository thaw --demote db-001 --all-repositories R4 R5\n\n# after (explicit repositories)\nbin/repository thaw --demote db-001 R4 R5\n\n# or (all repositories on the device)\nbin/repository thaw --demote db-001 --all-repositories","handlingStrategy":"validation","validationCode":"# In wrapper scripts, make the two selectors mutually exclusive before invoking thaw:\nif [ -n \"$REPOS\" ] && [ \"$ALL\" = \"1\" ]; then\n  echo 'Pass either a repository list or --all-repositories, not both.' >&2\n  exit 2\nfi\nbin/repository thaw --demote \"$DEVICE\" $REPOS $([ \"$ALL\" = \"1\" ] && echo --all-repositories)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat 'repositories...' and '--all-repositories' as an either/or choice in runbooks.","Never hardcode '--all-repositories' in shared templates that also accept repo names."],"tags":["phabricator","cli","argument-validation","repository-management","cluster-repositories"],"backgroundTag":"cli-argument-conflict","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}