{"record":{"id":"406d416be227630d","repo":"phacility/phabricator","slug":"object-s-can-not-be-destroyed-it-does-not-impl","errorCode":null,"errorMessage":"Object \"%s\" can not be destroyed (it does not implement %s).","messagePattern":"Object \"(.+?)\" can not be destroyed \\(it does not implement (.+?)\\)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php","lineNumber":49,"sourceCode":"    }\n\n    $object_query = id(new PhabricatorObjectQuery())\n      ->setViewer($this->getViewer())\n      ->withNames($object_names);\n\n    $object_query->execute();\n\n    $named_objects = $object_query->getNamedResults();\n    foreach ($object_names as $object_name) {\n      if (empty($named_objects[$object_name])) {\n        throw new PhutilArgumentUsageException(\n          pht('No such object \"%s\" exists!', $object_name));\n      }\n    }\n\n    foreach ($named_objects as $object_name => $object) {\n      if (!($object instanceof PhabricatorDestructibleInterface)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Object \"%s\" can not be destroyed (it does not implement %s).',\n            $object_name,\n            'PhabricatorDestructibleInterface'));\n      }\n    }\n\n    $banner = <<<EOBANNER\n                                  uuuuuuu\n                               uu###########uu\n                            uu#################uu\n                           u#####################u\n                          u#######################u\n                         u#########################u\n                         u#########################u\n                         u######\"   \"###\"   \"######u\n                         \"####\"      u#u       ####\"\n                          ###u       u#u       u###","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php#L31-L67","documentation":"bin/remove destroy destroys objects through PhabricatorDestructibleInterface, which supplies destroyObjectPermanently() so the engine can clean up attached records. Objects that do not implement the interface have no destruction semantics and are refused before the confirmation banner.","triggerScenarios":"Naming an object whose class does not implement PhabricatorDestructibleInterface: singleton/config-style rows, or objects that are only destroyed as a side effect of destroying some parent object.","commonSituations":"Trying to destroy raw configuration or custom DAO records where destruction semantics were never defined.","solutions":["Destroy the parent/container object instead; dependents are normally destroyed via its interface","If this is your application, implement PhabricatorDestructibleInterface::destroyObjectPermanently() on the DAO and clean up dependent rows","Use the application's own deletion workflow if it provides one"],"exampleFix":"// before: DAO has no destruction support (command refuses)\n\n// after: implement the interface on your DAO\npublic function destroyObjectPermanently(\n  PhabricatorDestructionEngine $engine) {\n  $this->delete();\n  // also delete attached rows (e.g. file chunks, subscriptions)\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isDestructible($object) {\n  return ($object instanceof PhabricatorDestructibleInterface);\n}","tryCatchPattern":null,"preventionTips":["Implement PhabricatorDestructibleInterface on custom objects that will be deletable","Filter candidate object names through the interface check before calling destroy","Destroy container objects rather than their dependents"],"tags":["cli","destroy","interface-check","cleanup"],"backgroundTag":"interface-not-implemented","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}