{"record":{"id":"145da93a7736114d","repo":"phacility/phabricator","slug":"you-can-not-both-enable-or-disable-with-se","errorCode":null,"errorMessage":"You can not both \"--enable\" or \"--disable\" with search parameters like \"--name\".","messagePattern":"You can not both \"--enable\" or \"--disable\" with search parameters like \"--name\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php","lineNumber":42,"sourceCode":"          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $is_enable = $args->getArg('enable');\n    $is_disable = $args->getArg('disable');\n\n    if ($is_enable && $is_disable) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'You can not both \"--enable\" and \"--disable\" the lock log.'));\n    }\n\n    $with_name = $args->getArg('name');\n\n    if ($is_enable || $is_disable) {\n      if (strlen($with_name)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'You can not both \"--enable\" or \"--disable\" with search '.\n            'parameters like \"--name\".'));\n      }\n\n      $gc = new PhabricatorDaemonLockLogGarbageCollector();\n      $is_enabled = (bool)$gc->getRetentionPolicy();\n\n      $config_key = 'phd.garbage-collection';\n      $const = $gc->getCollectorConstant();\n      $value = PhabricatorEnv::getEnvConfig($config_key);\n\n      if ($is_disable) {\n        if (!$is_enabled) {\n          echo tsprintf(\n            \"%s\\n\",\n            pht('Lock log is already disabled.'));\n          return 0;","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php#L24-L60","documentation":"Mode-conflict guard in the lock log workflow's execute(): --enable or --disable was combined with search filters such as --name. Changing the log's global state and querying specific locks cannot be done in one invocation.","triggerScenarios":"Thrown at src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run --enable/--disable without --name","Do the --name query in a separate invocation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}