Page MenuHomePhabricator

PhabricatorPolicyFilter::hasCapability() does not apply application-level "Can Use Application" policy checks
Closed, ResolvedPublic

Description

I have a bunch of daemons failing... the error message is as follows:

Executing task 18829015 (PhabricatorApplicationTransactionPublishWorker)...[2015-08-04 12:24:17] EXCEPTION: (Exception) Diff "PHID-DIFF-qr2rcjd2lparj2atn2m6" does not exist! at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:1535]
arcanist(head=master, ref.master=0d6f3328a08f), phabricator(head=master, ref.master=4139305f73f0, custom=1), phlab(head=master, ref.master=c090c8485be5), phutil(head=master, ref.master=aa6cd8f7e5e5)
  #0 DifferentialTransactionEditor::requireDiff(string, boolean) called at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:1243]
  #1 DifferentialTransactionEditor::buildMailBody(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2326]
  #2 PhabricatorApplicationTransactionEditor::buildMailForTarget(DifferentialRevision, array, PhabricatorMailTarget) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2285]
  #3 PhabricatorApplicationTransactionEditor::buildMail(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1046]
  #4 PhabricatorApplicationTransactionEditor::publishTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:21]
  #5 PhabricatorApplicationTransactionPublishWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:91]
  #6 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:162]
  #7 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:51]
  #8 PhabricatorWorkerManagementExecuteWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #9 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #10 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/setup/manage_worker.php:21]
``

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a subscriber: joshuaspence.

We have roughly 10 of these in our queue.

To clarify, the PHID does exist (I checked by querying the database directly)

Running this code works fine as well:

$diffs = id(new DifferentialDiffQuery())
  ->withPHIDs(array('PHID-DIFF-qr2rcjd2lparj2atn2m6'))
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->needChangesets(true)
  ->executeOne();

It looks like at some stage, this code is being executed:

id(new DifferentialDiffQuery())
  ->withPHIDs(array('PHID-DIFF-qr2rcjd2lparj2atn2m6'))
  ->setViewer($user)
  ->executeOne();

And the $user doesn't have access to see the diff.

./bin/worker execute --trace --id 18829015>>> [2] <connect> phabricator_worker
<<< [2] <connect> 4,734 us
>>> [3] <query> SELECT * FROM `worker_activetask` WHERE id IN ('18829015') 
<<< [3] <query> 1,038 us
>>> [4] <query> SELECT * FROM `worker_archivetask` WHERE (id in (18829015)) ORDER BY id DESC 
<<< [4] <query> 1,051 us
>>> [5] <connect> phabricator_worker
<<< [5] <connect> 4,057 us
>>> [6] <query> UPDATE `worker_activetask` SET `failureTime` = '1438841678', `taskClass` = 'PhabricatorApplicationTransactionPublishWorker', `leaseOwner` = NULL, `leaseExpires` = '1438841719', `failureCount` = '1744', `dataID` = '18858361', `priority` = '1000', `objectPHID` = 'PHID-DREV-4mhbuxmiuwzo37rixqlg', `id` = '18829015' WHERE `id` = '18829015'
<<< [6] <query> 15,661 us
>>> [7] <query> SELECT * FROM `worker_taskdata` WHERE id = 18858361 
<<< [7] <query> 1,097 us
Executing task 18829015 (PhabricatorApplicationTransactionPublishWorker)...>>> [8] <connect> phabricator_differential
<<< [8] <connect> 4,149 us
>>> [9] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.phid IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg'))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [9] <query> 1,096 us
>>> [10] <connect> phabricator_repository
<<< [10] <connect> 4,121 us
>>> [11] <query> SELECT `r`.* FROM `repository` r  WHERE (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [11] <query> 1,149 us
>>> [12] <query> SELECT * FROM `differential_transaction` x WHERE (phid IN ('PHID-XACT-DREV-p5gcdmcnkw5wbkf', 'PHID-XACT-DREV-sxxh7nigyrhy7fh', 'PHID-XACT-DREV-gdelyb3soycjphm', 'PHID-XACT-DREV-3chlxztlhpwmnry', 'PHID-XACT-DREV-aewd7vbxwkvsfjx', 'PHID-XACT-DREV-xrhkvvzmlai4qhw', 'PHID-XACT-DREV-pxrls5jrsppn4qr')) ORDER BY `id` DESC 
<<< [12] <query> 1,271 us
>>> [13] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.phid IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg'))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [13] <query> 1,080 us
>>> [14] <query> SELECT `r`.* FROM `repository` r  WHERE (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [14] <query> 1,074 us
>>> [15] <connect> phabricator_auth
<<< [15] <connect> 4,305 us
>>> [16] <query> SELECT * FROM `auth_providerconfig`  ORDER BY `id` DESC 
<<< [16] <query> 1,151 us
>>> [17] <connect> phabricator_project
<<< [17] <connect> 4,077 us
>>> [18] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [18] <query> 1,244 us
>>> [19] <connect> phabricator_file
<<< [19] <connect> 4,019 us
>>> [20] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [20] <query> 1,137 us
>>> [21] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [21] <query> 1,091 us
>>> [22] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [22] <query> 1,033 us
>>> [23] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [23] <query> 1,102 us
>>> [24] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [24] <query> 1,044 us
>>> [25] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [25] <query> 1,024 us
>>> [26] <connect> phabricator_user
<<< [26] <connect> 4,075 us
>>> [27] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [27] <query> 1,188 us
>>> [28] <connect> phabricator_maniphest
<<< [28] <connect> 4,014 us
>>> [29] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [29] <query> 1,096 us
>>> [30] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [30] <query> 1,064 us
>>> [31] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [31] <query> 1,055 us
>>> [32] <query> SELECT `r`.* FROM `repository` r  WHERE (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [32] <query> 1,081 us
>>> [33] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [33] <query> 1,106 us
>>> [34] <query> SELECT `r`.* FROM `repository` r  WHERE (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [34] <query> 1,075 us
>>> [35] <query> SELECT revisionID, id FROM `differential_diff` WHERE revisionID IN (23146)
        ORDER BY id DESC
<<< [35] <query> 1,024 us
>>> [36] <query> SELECT * FROM `differential_diff` WHERE id IN (566473) 
<<< [36] <query> 1,044 us
>>> [37] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg')) AND (edge.type IN ('35')) ORDER BY edge.dateCreated ASC, edge.seq ASC
<<< [37] <query> 1,118 us
>>> [38] <query> SELECT edgedata.* FROM `edgedata` edgedata WHERE id IN (85773, 85774, 85775, 85776)
<<< [38] <query> 1,038 us
>>> [39] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [39] <query> 1,209 us
>>> [40] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu')) AND (edge.type IN ('21')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [40] <query> 1,214 us
>>> [41] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm', 'PHID-USER-mw6ockgrrgytq3d3yywa', 'PHID-USER-peuiavsm52zpxge5kiok', 'PHID-USER-hzs5buz4sbj5lcbwx4vu', 'PHID-USER-comtfhp2czgmyrs3cm7m', 'PHID-USER-inwz7rtaiuxgmjduhmmq', 'PHID-USER-hfenohlvucsbthy2su73', 'PHID-USER-abzwhc667osh5mwd4gk7', 'PHID-USER-yl3qonlcgmrtn3tdxppz', 'PHID-USER-3u5vybbidp7ael5ebh6z', 'PHID-USER-cfqyrlmwwho74uzi4cbl', 'PHID-USER-bqflamirb2342abaeqf5', 'PHID-USER-q2zc6dtm6uvbjqsxzut6', 'PHID-USER-raqt
<<< [41] <query> 2,285 us
>>> [42] <connect> phabricator_spaces
<<< [42] <connect> 4,078 us
>>> [43] <query> SELECT * FROM `spaces_namespace`      ORDER BY `id` DESC 
<<< [43] <query> 1,029 us
>>> [44] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [44] <query> 1,107 us
>>> [45] <connect> phabricator_policy
<<< [45] <connect> 4,195 us
>>> [46] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-mz7dj6am3bq4yx477tgg') 
<<< [46] <query> 1,077 us
>>> [47] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-l4hrts2frjnyghof5fgm')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [47] <query> 1,127 us
>>> [48] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [48] <query> 1,108 us
>>> [49] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [49] <query> 1,131 us
>>> [50] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-uwziuxgtcivsiknlo73u') 
<<< [50] <query> 1,127 us
>>> [51] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-l4hrts2frjnyghof5fgm')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [51] <query> 1,186 us
>>> [52] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [52] <query> 1,186 us
>>> [53] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-l4hrts2frjnyghof5fgm' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [53] <query> 1,189 us
>>> [54] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [54] <query> 1,093 us
>>> [55] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [55] <query> 1,065 us
>>> [56] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [56] <query> 1,034 us
>>> [57] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [57] <query> 1,157 us
>>> [58] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [58] <query> 1,067 us
>>> [59] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [59] <query> 1,008 us
>>> [60] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (`task`.spacePHID IS NULL) AND (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [60] <query> 1,076 us
>>> [61] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [61] <query> 1,071 us
>>> [62] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [62] <query> 1,053 us
>>> [63] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [63] <query> 1,076 us
>>> [64] <query> SELECT * FROM `differential_changeset` WHERE (diffID IN (565918)) ORDER BY `id` DESC 
<<< [64] <query> 1,121 us
>>> [65] <query> SELECT * FROM `differential_hunk_modern` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [65] <query> 1,137 us
>>> [66] <query> SELECT * FROM `differential_hunk` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [66] <query> 1,071 us
>>> [67] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg')) AND (edge.type IN ('41')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [67] <query> 1,075 us
>>> [68] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [68] <query> 1,165 us
>>> [69] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-l4hrts2frjnyghof5fgm' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [69] <query> 1,198 us
>>> [70] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [70] <query> 1,080 us
>>> [71] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [71] <query> 1,133 us
>>> [72] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [72] <query> 1,029 us
>>> [73] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [73] <query> 1,090 us
>>> [74] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [74] <query> 1,036 us
>>> [75] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [75] <query> 1,041 us
>>> [76] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [76] <query> 1,101 us
>>> [77] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-mz7dj6am3bq4yx477tgg') 
<<< [77] <query> 1,055 us
>>> [78] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-mw6ockgrrgytq3d3yywa')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [78] <query> 1,147 us
>>> [79] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [79] <query> 1,092 us
>>> [80] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [80] <query> 1,067 us
>>> [81] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-uwziuxgtcivsiknlo73u') 
<<< [81] <query> 1,007 us
>>> [82] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-mw6ockgrrgytq3d3yywa')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [82] <query> 1,076 us
>>> [83] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [83] <query> 1,091 us
>>> [84] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-mw6ockgrrgytq3d3yywa' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [84] <query> 1,177 us
>>> [85] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [85] <query> 1,092 us
>>> [86] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [86] <query> 1,050 us
>>> [87] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [87] <query> 1,024 us
>>> [88] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [88] <query> 1,127 us
>>> [89] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [89] <query> 1,081 us
>>> [90] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [90] <query> 1,111 us
>>> [91] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (`task`.spacePHID IS NULL) AND (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [91] <query> 1,105 us
>>> [92] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [92] <query> 1,070 us
>>> [93] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [93] <query> 1,168 us
>>> [94] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [94] <query> 1,073 us
>>> [95] <query> SELECT * FROM `differential_changeset` WHERE (diffID IN (565918)) ORDER BY `id` DESC 
<<< [95] <query> 1,127 us
>>> [96] <query> SELECT * FROM `differential_hunk_modern` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [96] <query> 1,126 us
>>> [97] <query> SELECT * FROM `differential_hunk` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [97] <query> 1,059 us
>>> [98] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg')) AND (edge.type IN ('41')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [98] <query> 1,059 us
>>> [99] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [99] <query> 1,173 us
>>> [100] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-mw6ockgrrgytq3d3yywa' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [100] <query> 1,222 us
>>> [101] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [101] <query> 1,056 us
>>> [102] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [102] <query> 1,157 us
>>> [103] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [103] <query> 1,034 us
>>> [104] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [104] <query> 1,107 us
>>> [105] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [105] <query> 1,055 us
>>> [106] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [106] <query> 1,164 us
>>> [107] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [107] <query> 1,117 us
>>> [108] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-mz7dj6am3bq4yx477tgg') 
<<< [108] <query> 1,070 us
>>> [109] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-peuiavsm52zpxge5kiok')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [109] <query> 1,126 us
>>> [110] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [110] <query> 1,106 us
>>> [111] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [111] <query> 1,132 us
>>> [112] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-uwziuxgtcivsiknlo73u') 
<<< [112] <query> 1,098 us
>>> [113] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-peuiavsm52zpxge5kiok')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [113] <query> 1,122 us
>>> [114] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [114] <query> 1,063 us
>>> [115] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-peuiavsm52zpxge5kiok' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [115] <query> 1,185 us
>>> [116] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [116] <query> 1,102 us
>>> [117] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [117] <query> 1,079 us
>>> [118] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [118] <query> 1,071 us
>>> [119] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [119] <query> 1,133 us
>>> [120] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [120] <query> 1,109 us
>>> [121] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [121] <query> 1,040 us
>>> [122] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (`task`.spacePHID IS NULL) AND (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [122] <query> 1,108 us
>>> [123] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [123] <query> 1,287 us
>>> [124] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [124] <query> 1,065 us
>>> [125] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [125] <query> 1,141 us
>>> [126] <query> SELECT * FROM `differential_changeset` WHERE (diffID IN (565918)) ORDER BY `id` DESC 
<<< [126] <query> 1,157 us
>>> [127] <query> SELECT * FROM `differential_hunk_modern` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [127] <query> 1,236 us
>>> [128] <query> SELECT * FROM `differential_hunk` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [128] <query> 1,005 us
>>> [129] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg')) AND (edge.type IN ('41')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [129] <query> 1,072 us
>>> [130] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [130] <query> 1,127 us
>>> [131] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-peuiavsm52zpxge5kiok' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [131] <query> 1,267 us
>>> [132] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [132] <query> 1,084 us
>>> [133] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [133] <query> 1,061 us
>>> [134] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [134] <query> 1,036 us
>>> [135] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [135] <query> 1,168 us
>>> [136] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [136] <query> 1,050 us
>>> [137] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [137] <query> 1,127 us
>>> [138] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [138] <query> 1,140 us
>>> [139] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-mz7dj6am3bq4yx477tgg') 
<<< [139] <query> 1,049 us
>>> [140] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-hzs5buz4sbj5lcbwx4vu')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [140] <query> 1,248 us
>>> [141] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [141] <query> 1,143 us
>>> [142] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [142] <query> 1,080 us
>>> [143] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-uwziuxgtcivsiknlo73u') 
<<< [143] <query> 1,055 us
>>> [144] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-hzs5buz4sbj5lcbwx4vu')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [144] <query> 1,117 us
>>> [145] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [145] <query> 1,115 us
>>> [146] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-hzs5buz4sbj5lcbwx4vu' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [146] <query> 1,227 us
>>> [147] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [147] <query> 1,126 us
>>> [148] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [148] <query> 1,100 us
>>> [149] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [149] <query> 1,075 us
>>> [150] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [150] <query> 1,148 us
>>> [151] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [151] <query> 1,224 us
>>> [152] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [152] <query> 1,061 us
>>> [153] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (`task`.spacePHID IS NULL) AND (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [153] <query> 1,147 us
>>> [154] <query> SELECT * FROM `differential_diff` WHERE (phid IN ('PHID-DIFF-qr2rcjd2lparj2atn2m6')) ORDER BY `id` DESC 
<<< [154] <query> 1,089 us
>>> [155] <query> (SELECT `r`.* FROM `differential_revision` r  WHERE (r.id IN (23146))   ORDER BY `r`.`dateModified` DESC, `r`.`id` DESC )
<<< [155] <query> 1,092 us
>>> [156] <query> SELECT `r`.* FROM `repository` r  WHERE (`r`.spacePHID IS NULL) AND (r.phid IN ('PHID-REPO-rgnn364lembo2emt5622'))   ORDER BY `r`.`id` DESC 
<<< [156] <query> 1,240 us
>>> [157] <query> SELECT * FROM `differential_changeset` WHERE (diffID IN (565918)) ORDER BY `id` DESC 
<<< [157] <query> 1,157 us
>>> [158] <query> SELECT * FROM `differential_hunk_modern` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [158] <query> 1,168 us
>>> [159] <query> SELECT * FROM `differential_hunk` WHERE (changesetID IN (7748366, 7748365)) ORDER BY `id` ASC 
<<< [159] <query> 1,052 us
>>> [160] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-DREV-4mhbuxmiuwzo37rixqlg')) AND (edge.type IN ('41')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [160] <query> 1,132 us
>>> [161] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [161] <query> 1,228 us
>>> [162] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-hzs5buz4sbj5lcbwx4vu' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [162] <query> 1,482 us
>>> [163] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [163] <query> 1,241 us
>>> [164] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [164] <query> 1,129 us
>>> [165] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [165] <query> 1,044 us
>>> [166] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [166] <query> 1,202 us
>>> [167] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [167] <query> 1,096 us
>>> [168] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [168] <query> 1,101 us
>>> [169] <query> SELECT `user`.* FROM `user` user  WHERE (user.phid IN ('PHID-USER-l4hrts2frjnyghof5fgm'))   ORDER BY `user`.`id` DESC 
<<< [169] <query> 1,410 us
>>> [170] <query> SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-mz7dj6am3bq4yx477tgg') 
<<< [170] <query> 1,110 us
>>> [171] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = '' JOIN `edge` e ON e.src = p.phid AND e.type = 13 WHERE (phid IN ('PHID-PROJ-5fgvj2vy6q3bzdcyrdsx')) AND (e.dst IN ('PHID-USER-comtfhp2czgmyrs3cm7m')) GROUP BY p.phid  ORDER BY `p`.`name` ASC 
<<< [171] <query> 1,152 us
>>> [172] <query> SELECT `p`.*, vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-comtfhp2czgmyrs3cm7m' WHERE (phid IN ('PHID-PROJ-z4lum22ekior7wxtn7ub', 'PHID-PROJ-fpucoegg437ttgxyfciu'))   ORDER BY `p`.`name` ASC 
<<< [172] <query> 1,298 us
>>> [173] <query> SELECT `f`.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg'))   ORDER BY `f`.`id` DESC 
<<< [173] <query> 1,065 us
>>> [174] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [174] <query> 1,056 us
>>> [175] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-fbyv3ulhxu3erfudpdzg') 
<<< [175] <query> 1,091 us
>>> [176] <query> SELECT `f`.* FROM `file` f JOIN `file_transformedfile` t ON t.transformedPHID = f.phid WHERE (((t.originalPHID = 'PHID-VOID-00000000000000000000' AND t.transform = 'builtin:project.png')))   ORDER BY `f`.`id` DESC 
<<< [176] <query> 1,086 us
>>> [177] <query> SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-mpgyi55wthmxjdg4vewp')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
<<< [177] <query> 1,108 us
>>> [178] <query> SELECT * FROM `file_transformedfile` WHERE transformedPHID IN ('PHID-FILE-mpgyi55wthmxjdg4vewp') 
<<< [178] <query> 1,053 us
>>> [179] <query> SELECT `task`.*  FROM `maniphest_task` task  WHERE (`task`.spacePHID IS NULL) AND (task.phid in ('PHID-TASK-xlaezfav3hqyzgbie2li'))   ORDER BY `task`.`id` DESC 
<<< [179] <query> 1,196 us
>>> [180] <query> UPDATE `worker_activetask` SET `failureTime` = '1438841719', `taskClass` = 'PhabricatorApplicationTransactionPublishWorker', `leaseOwner` = NULL, `leaseExpires` = '300', `failureCount` = '1745', `dataID` = '18858361', `priority` = '1000', `objectPHID` = 'PHID-DREV-4mhbuxmiuwzo37rixqlg', `id` = '18829015' WHERE `id` = '18829015'
<<< [180] <query> 11,445 us
[2015-08-06 16:15:19] EXCEPTION: (Exception) Diff "PHID-DIFF-qr2rcjd2lparj2atn2m6" does not exist! at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:1535]
arcanist(head=master, ref.master=0d6f3328a08f), phabricator(head=master, ref.master=4139305f73f0, custom=1), phlab(head=master, ref.master=c090c8485be5), phutil(head=master, ref.master=aa6cd8f7e5e5)
  #0 DifferentialTransactionEditor::requireDiff(string, boolean) called at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:1243]
  #1 DifferentialTransactionEditor::buildMailBody(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2326]
  #2 PhabricatorApplicationTransactionEditor::buildMailForTarget(DifferentialRevision, array, PhabricatorMailTarget) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2285]
  #3 PhabricatorApplicationTransactionEditor::buildMail(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1046]
  #4 PhabricatorApplicationTransactionEditor::publishTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:21]
  #5 PhabricatorApplicationTransactionPublishWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:91]
  #6 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:162]
  #7 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:51]
  #8 PhabricatorWorkerManagementExecuteWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #9 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #10 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/setup/manage_worker.php:21]

OK. I figured out the issue. Steps to reproduce are roughly as follows:

  1. There is a project defined called "Restricted Code Access". Members of this project cannot use Differential or Diffusion.
  2. There is another project, let's just call it "Project X".
  3. Someone submitted a diff for review and added #project_x as a reviewer.
  4. There are users which are a member of both "Project X" and "Restricted Code Access". The exceptions occur whilst trying to publish notifications to these users.

I'm happy to take a crack at this, but I'm not sure what the desired behavior is... Silently drop notifications to users that don't have the correct permissions? Filter the list of users to notify before triggering notifications?

I think the desired behavior is to silently drop the notifications, yes. Specifically, they should be dropped in PhabricatorMailReplyHandler->filterRecipientUsers().

This method filters viewers who can not see the object (in this case, the revision). However, this doesn't perform a "Can Use Application" policy check.

The way this check works is relatively rare: usually, we check implicitly when using a Query. The Query does an application check in addition to an object check.

Here, we do only an object check here, which these users can pass. They fail a later check which actually uses a Query to load a diff.

These object checks should probably stop passing, although the meaning of "Can Use Application" is perhaps a little ambiguous. One might possibly expect that it only prevents the user from actually using the application: for example, no interacting with it from the web UI or calling Conduit methods, but maybe seeing objects from it is OK if they're linked elsewhere. But in practice it means "Can Use Application or See Any of its Objects", and this is consistent in other contexts and is probably the meaning we should pursue.

I'm not sure what the best way to enforce this check is. One approach is to extend PolicyInterface to include a getPolicyApplicationThatYouMustBeAbleToSee() or whatever, but that's a ton of legwork. We can probably go from PHID -> query class -> application instead.

epriestley renamed this task from PhabricatorApplicationTransactionPublishWorker failures to PhabricatorPolicyFilter::hasCapability() does not apply application-level "Can Use Application" policy checks.Jan 1 2017, 5:48 PM
epriestley triaged this task as Normal priority.
epriestley added a project: Policy.
epriestley moved this task from Backlog to v3 (Infrastructure) on the Differential board.