phacility/phabricator · error · Exception
Object owner can not be unlocked: the unlocking engine ("%s"
Error message
Object owner can not be unlocked: the unlocking engine ("%s") for this object does not implement an owner unlocking mechanism. What it means
The base PhabricatorUnlockEngine::newUnlockOwnerTransactions() unconditionally throws: transferring ownership requires object-specific knowledge of how ownership is stored and changed, so only engines that override this method (returned by an object's newUnlockEngine()) support owner unlock. The default engine and most subclasses do not.
Source
Thrown at src/applications/system/engine/PhabricatorUnlockEngine.php:60
public function newUnlockEditTransactions($object, $user) {
$type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY;
if (!$this->canApplyTransactionType($object, $type_edit)) {
throw new Exception(
pht(
'Object edit policy can not be unlocked because this object '.
'does not have a mutable edit policy.'));
}
return array(
$this->newTransaction($object)
->setTransactionType($type_edit)
->setNewValue($user->getPHID()),
);
}
public function newUnlockOwnerTransactions($object, $user) {
throw new Exception(
pht(
'Object owner can not be unlocked: the unlocking engine ("%s") for '.
'this object does not implement an owner unlocking mechanism.',
get_class($this)));
}
final protected function canApplyTransactionType($object, $type) {
$xaction_types = $object->getApplicationTransactionEditor()
->getTransactionTypesForObject($object);
$xaction_types = array_fuse($xaction_types);
return isset($xaction_types[$type]);
}
final protected function newTransaction($object) {
return $object->getApplicationTransactionTemplate();
}View on GitHub (pinned to 5720a38cfe)
Solutions
- Use the view-policy or edit-policy unlock instead; both are implemented by the base engine
- If this is your application, override newUnlockOwnerTransactions() in your PhabricatorUnlockEngine subclass and return the ownership-changing transactions
- Hand-edit ownership through the object type's own admin workflow if one exists
Example fix
// before: relying on the base engine for owner unlock
$engine = PhabricatorUnlockEngine::newUnlockEngineForObject($object);
$xactions = $engine->newUnlockOwnerTransactions($object, $user);
// after: implement the mechanism in your application's engine
final class MyAppUnlockEngine extends PhabricatorUnlockEngine {
public function newUnlockOwnerTransactions($object, $user) {
return array(
$this->newTransaction($object)
->setTransactionType(MyAppOwnerTransaction::TRANSACTIONTYPE)
->setNewValue($user->getPHID()),
);
}
} Defensive patterns
Strategy: validation
Validate before calling
// Owner unlock is supported only when the engine overrides the base method.
$ref = new ReflectionMethod($engine, 'newUnlockOwnerTransactions');
if ($ref->getDeclaringClass()->getName() === 'PhabricatorUnlockEngine') {
// unsupported: fall back to view/edit policy unlock
} Try / catch
Catch Exception around newUnlockOwnerTransactions() and present the view/edit policy unlock options; the failure is structural (unimplemented mechanism), so retrying is never useful.
Prevention
- Hide the owner-unlock action unless the engine overrides newUnlockOwnerTransactions()
- Prefer policy unlocks, which the base engine always implements
- In custom applications, implement owner unlock transactions when the type has ownership
When it happens
Trigger: Choosing the owner-unlock operation for an object whose engine is PhabricatorDefaultUnlockEngine or any subclass that does not override newUnlockOwnerTransactions().
Common situations: Attempting to reassign ownership of object types with no owner concept or whose application never implemented owner unlock; hitting the admin unlock dialog on an unsupported type.
Related errors
- Object ("%s") does not implement interface "%s", so this typ
- Object view policy can not be unlocked because this object d
- Object edit policy can not be unlocked because this object d
- Unrecognized verb: %s
- This object ("%s") has more than %s transactions in its most
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/a7c381980c776abc.
Report an issue: GitHub.