phacility/phabricator · error · PhutilArgumentUsageException
You can not both "--enable" or "--disable" with search…
Error message
You can not both "--enable" or "--disable" with search parameters like "--name".
What it means
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.
Solutions
- Run --enable/--disable without --name
- Do the --name query in a separate invocation
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/145da93a7736114d.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php:42
),
));
}
public function execute(PhutilArgumentParser $args) {
$is_enable = $args->getArg('enable');
$is_disable = $args->getArg('disable');
if ($is_enable && $is_disable) {
throw new PhutilArgumentUsageException(
pht(
'You can not both "--enable" and "--disable" the lock log.'));
}
$with_name = $args->getArg('name');
if ($is_enable || $is_disable) {
if (strlen($with_name)) {
throw new PhutilArgumentUsageException(
pht(
'You can not both "--enable" or "--disable" with search '.
'parameters like "--name".'));
}
$gc = new PhabricatorDaemonLockLogGarbageCollector();
$is_enabled = (bool)$gc->getRetentionPolicy();
$config_key = 'phd.garbage-collection';
$const = $gc->getCollectorConstant();
$value = PhabricatorEnv::getEnvConfig($config_key);
if ($is_disable) {
if (!$is_enabled) {
echo tsprintf(
"%s\n",
pht('Lock log is already disabled.'));
return 0;View on GitHub (pinned to 5720a38cfe)