RuntimeException during import of commit

Reproduction Instructions
Importing the latest commit of one of our repositories got stuck ('Sill importing" displayed in Diffusion and no changeset displayed).
I tried to reparse the commit via bin/repository reparse and ran into the following RuntimeException:

[2020-04-28 13:35:05] EXCEPTION: (RuntimeException) Illegal offset type at [<arcanist>/src/error/PhutilErrorHandler.php:263]
arcanist(head=stable, ref.master=a2ab38df78a9, ref.stable=5efbe22c2afa), phabricator(head=stable, ref.stable=e17c49699309)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:266]
  #1 PhabricatorApplicationTransactionEditor::addUnmentionablePHIDs(array) called at [<phabricator>/src/applications/audit/editor/PhabricatorAuditEditor.php:242]
  #2 PhabricatorAuditEditor::expandTransaction(PhabricatorRepositoryCommit, PhabricatorAuditTransaction) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1989]
  #3 PhabricatorApplicationTransactionEditor::expandTransactions(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/audit/editor/PhabricatorAuditEditor.php:62]
  #4 PhabricatorAuditEditor::expandTransactions(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1033]
  #5 PhabricatorApplicationTransactionEditor::applyTransactions(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:92]
  #6 PhabricatorRepositoryCommitPublishWorker::publishCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:20]
  #7 PhabricatorRepositoryCommitPublishWorker::parseCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:51]
  #8 PhabricatorRepositoryCommitParserWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
  #9 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:163]
  #10 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:260]
  #11 PhabricatorRepositoryManagementReparseWorkflow::execute(PhutilArgumentParser) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:492]
  #12 PhutilArgumentParser::parseWorkflowsFull(array) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:377]
  #13 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/repository/manage_repositories.php:22]

I’m not sure if this helps, but the last query that is listed if I run the reparse command with --trace is the following (username removed for privacy reasons):

>>> [400] (+486) <query> START TRANSACTION
<<< [400] (+487) <query> 72 us
>>> [401] (+487) <query> SELECT * FROM `phabricator_repository`.`repository_commit` WHERE `id`     = 27535 FOR UPDATE
<<< [401] (+487) <query> 165 us
>>> [402] (+488) <query> SELECT `user`.* FROM `user` `user` WHERE (user.userName IN ('XXXX')) ORDER BY `user`.`id` DESC
<<< [402] (+489) <query> 135 us
>>> [403] (+489) <query> ROLLBACK
<<< [403] (+489) <query> 78 us

The commit adds a new file, references a task and adds a user as Auditor.

Please let me know if you need any further information.

Phabricator/Arcanist Version

Library Version Date Branchpoint
phabricator e17c49699309 Mon, Apr 27 d05d8f655896
arcanist 5efbe22c2afa Sun, Apr 26 68f050bd14e0

Thanks! This is fallout from https://secure.phabricator.com/D21044 increasing the severity of certain language-level errors. In this case, the underlying code has a real bug.

When a commit has an explicit list of “Auditors:”, we attempt to mark those users as “unmentionable”, which disables “@username” mentions in the commit message. The goal is to avoid double-generating both an “Alice added Bailey as an auditor.” and “Alice added Bailey as a subscriber.” transactions – the latter isn’t interesting or useful, since “Auditor” is a stronger relationship.

The code passed this list of unmentionable objects incorrectly.

This should be fixed by https://secure.phabricator.com/D21181, which is now in master and stable.

After upgrading to pick up the change, my expectation is that the daemons should automatically retry the task and succeed, and everything should converge to the correct state.

Let me know if that doesn’t happen or you run into anything else.

Thanks for the quick fix!

The commit is now correctly imported.