Page MenuHomePhabricator

Exception when destroying an object with edges that no longer have corresponding edge definitions
Closed, ResolvedPublic

Description

Destroying PhabricatorRepository rDEYIHOMEPHPSOURCE...
[2016-06-23 09:49:30] EXCEPTION: (Exception) Unknown edge constant "39"! at [<phabricator>/src/infrastructure/edges/type/PhabricatorEdgeType.php:202]
arcanist(head=master, ref.master=2374403e8f80), phabricator(head=master, ref.master=72588d2eaaa0), phutil(head=master, ref.master=51c179b4c000)
  #0 PhabricatorEdgeType::getByConstant(string) called at [<phabricator>/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:179]
  #1 PhabricatorEdgeEditor::buildEdgeSpecs(string, string, string) called at [<phabricator>/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:78]
  #2 PhabricatorEdgeEditor::removeEdge(string, string, string) called at [<phabricator>/src/infrastructure/edges/engineextension/PhabricatorEdgesDestructionEngineExtension.php:31]
  #3 PhabricatorEdgesDestructionEngineExtension::destroyObject(PhabricatorDestructionEngine, PhabricatorRepository) called at [<phabricator>/src/applications/system/engine/PhabricatorDestructionEngine.php:51]
  #4 PhabricatorDestructionEngine::destroyObject(PhabricatorRepository) called at [<phabricator>/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php:156]
  #5 PhabricatorSystemRemoveDestroyWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:410]
  #6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:303]
  #7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/setup/manage_remove.php:21]

Event Timeline

What are the steps to reproduce the error, specifically? I can't trigger this exception.

Edge Constant 39 was TYPE_OBJECT_USES_CREDENTIAL, which was removed a few months back.

I am running Phabricator up to date (I upgrade it today, using git pull --rebase)

I execute `./bin/remove destroy rDEMO```

try to delete an repository.

The repository created last year.

epriestley triaged this task as Normal priority.

When we destroy an object, we load all its edges and destroy them too.

When we destroy an edge, we check the edge definition to see if it has a corresponding inverse edge type. If it does, we destroy that.

In this case there was no edge definition available for the edge, so we failed while trying to identify its inverse. After D16171, we just assume it has no inverse and continue destroying related objects.

epriestley renamed this task from Exception when destroy diffusion repository to Exception when destroying an object with edges that no longer have corresponding edge definitions.Jun 23 2016, 12:53 PM

This is still logged as an EXCEPTION. Is DELETE FROM phabricator_repository.edge WHERE type = 39 a reasonable step to take, to prevent administrators unfamiliar with the non-fatal-ness of this from being worried?