Page MenuHomePhabricator

Username `@mentions` prevent creation of revisions with "data not attached" error
Closed, ResolvedPublic

Description

One user on our install reports that arc diff to create a new revision (as opposed to updating an existing one) consistently fails with the error message:

EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Attempting to access attached data on DifferentialRevision (via getRepository()), but the data is not actually attached. Before accessing attachable data on an object, you must load and attach it.

This appears to be returned from the differential.createrevision Conduit call, and is preventing the diff from being created.

Unfortunately, I cannot tell how common this issue is. The logs at /conduit/log/?methods=differential.createrevision show that almost every call is failing with ERR-CONDUIT-CORE, but many of those are due to T8455 and not this issue.

The full output of arc diff --trace is included at P1800.

Event Timeline

jhurwitz raised the priority of this task from to Needs Triage.
jhurwitz updated the task description. (Show Details)
jhurwitz added a project: Restricted Project.
jhurwitz added a subscriber: angie.
jhurwitz added a subscriber: jhurwitz.

Can you fish the server-side stack trace out of the error log on the server? (Usually /var/log/apache2/error_log or similar.)

The client-side traces aren't very useful for Conduit errors out of an abundance of caution, although this caution is probably unwarranted, particularly now that we have a heavier hand in stack trace construction and formatting than we once did.

I think we're bitten by the same issue, although nothing to do with Conduit on our end as far as I can tell. Creating a new revision with arc diff crashes for me today, and that is after we upgraded Phabricator this weekend. Stack trace:

[2015-06-08 14:01:43] EXCEPTION: (PhabricatorDataNotAttachedException) Attempting to access attached data on DifferentialRevision (via getRepository()), but the data is not actually attached. Before accessing attachable data on an object, you must load and attach it.

Data is normally attached by calling the corresponding needX() method on the Query class when the object is loaded. You can also call the corresponding attachX() method explicitly. at [<phabricator>/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:166]
arcanist(head=master, ref.master=c36a825f5cfb), phabricator(head=master, ref.master=9a9df74ddb34), phutil(head=master, ref.master=72d3d6087892)
  #0 <#2> PhabricatorLiskDAO::assertAttached(string) called at [<phabricator>/src/applications/differential/storage/DifferentialRevision.php:391]
  #1 <#2> DifferentialRevision::getRepository() called at [<phabricator>/src/applications/differential/storage/DifferentialRevision.php:352]
  #2 <#2> DifferentialRevision::getExtendedPolicy(string, PhabricatorUser) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:286]
  #3 <#2> PhabricatorPolicyFilter::executeExtendedPolicyChecks(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:259]
  #4 <#2> PhabricatorPolicyFilter::applyExtendedPolicyChecks(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:223]
  #5 <#2> PhabricatorPolicyFilter::apply(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:83]
  #6 <#2> PhabricatorPolicyFilter::hasCapability(PhabricatorUser, DifferentialRevision, string) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1278]
  #7 <#2> PhabricatorApplicationTransactionEditor::buildSubscribeTransaction(DifferentialRevision, array, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicati
asteinlein triaged this task as Unbreak Now! priority.Jun 8 2015, 12:15 PM

I'm sorry for bumping this, but I'm actually totally stuck, and can't seem to find any way to create revisions. We just upgraded Phabricator again to see if this had been resolved since our initial upgrade this weekend, but no go...

FYI, I also created creating the diff manually through Differential on the web interface. Same exception occured.

I'm not immediately able to reproduce this. Does it reproduce for you on this install?

Thanks for the stack trace, in any case -- I'll keep digging; if you can come up with a repro case on this install that might help get things resolved faster.

How should I do that? But we have further info. A collegue of mine checked out my branch, and successfully created the diff I was unable to. So this seems to be specific to my user...

If it reproduces via the web UI on your install, try to hit it on this install by typing stuff in here:

https://secure.phabricator.com/differential/diff/create/

If you come up with a combination of inputs which reproduce it, I can go from there.

Seems to work fine, which doesn't suprise me ref. my last comment...

Do the problematic revisions mention a user with @username in the summary or test plan?

Do the problematic revisions mention a user with @username in the summary or test plan?

YES! Thank you so much. Seems we have found the bug, since removing that did indeed do the trick. I know that used to work, though, since I used that as recently on Friday (before we upgraded Phabricator on Saturday).

D13205 is a possible fix; if that's the issue, a workaround is to avoid mentioning any users with @mentions in the summary, test plan, or other description fields until it lands.

epriestley renamed this task from differential.createrevision failing with "Attempting to access attached data on DifferentialRevision (via getRepository()), but the data is not actually attached" to Username `@mentions` prevent creation of revisions with "data not attached" error.Jun 8 2015, 1:37 PM

Our stack trace is very similar -- it starts in Conduit, then calls PhabricatorApplicationTransactionEditor::buildSubscribeTransaction and the rest of the stack trace is the same as what @asteinlein posted.

[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83] [2015-06-07 23:00:36] EXCEPTION: (PhabricatorDataNotAttachedException) Attempting to access attached data on DifferentialRevision (via getRepository()), but the data is not actually attached. Before accessing attachable data on an object, you must load and attach it.\n\nData is normally attached by calling the corresponding needX() method on the Query class when the object is loaded. You can also call the corresponding attachX() method explicitly. at [<phabricator>/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:166]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83] arcanist(head=master, ref.master=8c589f1f759f), phabricator(head=master, ref.master=1e4e121956e7), phutil(head=master, ref.master=4a0e1b47a584), pytest-phabricator(head=master, ref.master=b90751495895)
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #0 <#2> PhabricatorLiskDAO::assertAttached(string) called at [<phabricator>/src/applications/differential/storage/DifferentialRevision.php:391]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #1 <#2> DifferentialRevision::getRepository() called at [<phabricator>/src/applications/differential/storage/DifferentialRevision.php:352]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #2 <#2> DifferentialRevision::getExtendedPolicy(string, PhabricatorUser) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:286]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #3 <#2> PhabricatorPolicyFilter::executeExtendedPolicyChecks(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:259]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #4 <#2> PhabricatorPolicyFilter::applyExtendedPolicyChecks(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:223]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #5 <#2> PhabricatorPolicyFilter::apply(array) called at [<phabricator>/src/applications/policy/filter/PhabricatorPolicyFilter.php:83]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #6 <#2> PhabricatorPolicyFilter::hasCapability(PhabricatorUser, DifferentialRevision, string) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1278]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #7 <#2> PhabricatorApplicationTransactionEditor::buildSubscribeTransaction(DifferentialRevision, array, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1392]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #8 <#2> PhabricatorApplicationTransactionEditor::expandSupportTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:725]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #9 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/differential/conduit/DifferentialConduitAPIMethod.php:145]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #10 <#2> DifferentialConduitAPIMethod::applyFieldEdit(ConduitAPIRequest, DifferentialRevision, DifferentialDiff, array, NULL) called at [<phabricator>/src/applications/differential/conduit/DifferentialCreateRevisionConduitAPIMethod.php:53]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #11 <#2> DifferentialCreateRevisionConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:90]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #12 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:134]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #13 <#2> ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:84]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #14 <#2> ConduitCall::execute() called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:91]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #15 phlog(PhabricatorDataNotAttachedException) called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:111]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #16 PhabricatorConduitAPIController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #17 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:226]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #18 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:140]
[Sun Jun 07 23:00:36 2015] [error] [client 172.16.86.83]   #19 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:21]
epriestley claimed this task.

I believe this is now resolved in HEAD, but let me know if you still see it after upgrading.

Thanks, can no longer repro after upgrading.

angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 9 2015, 9:47 PM
angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 16 2015, 8:54 PM