Page MenuHomePhabricator

Exception, Cursor "1" does not identify a valid object
Closed, ResolvedPublic

Assigned To
Authored By
chad
Jul 7 2015, 4:05 PM
Referenced Files
F596643: pasted_file
Jul 7 2015, 7:40 PM
F596640: stack.png
Jul 7 2015, 7:39 PM
Subscribers

Description

Updated my dev box this am and I can't log into it, every page gives me:

Exception
Cursor "1" does not identify a valid object.

Related Objects

Event Timeline

chad raised the priority of this task from to Needs Triage.
chad updated the task description. (Show Details)
chad added subscribers: chad, epriestley.

So, nothing in Apache logs, and when I git bisect, every result is "good" and the server works fine. However when I run my upgrade script, it goes back to failing.

Do you have a full stack trace? You might need to bin/config set phabricator.developer-mode 1 to get one, although presumably you're already in developer mode...

Oh, sorry, I just mean the web UI itself -- I'd expect it to look like this if you have developer-mode enabled:

stack.png (1×1 px, 129 KB)

Are you not seeing that?

Ah, okay. Let me fix that UI to respect developer mode so we can get a stack trace.

Actually, I guess we can't check the environment that early to see if the setting is set. Let me just start by tailoring the error message, and maybe that'll give me enough to go on that I can figure it out.

You can also probably do this to get a meaningful stack trace, near line 410 of PhabricatorCursorPagedPolicyAwareQuery.php:

    $object = $query->executeOne();
    if (!$object) {
+     phlog(new Exception("uhoh"));
      throw new Exception(
        pht(
          'Cursor "%s" does not identify a valid object in query "%s".',
          $cursor,
          get_class($this)));
    }

Cursor "1" does not identify a valid object in query "AlmanacServiceQuery".

[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16] [2015-07-07 12:57:46] EXCEPTION: (Exception) uhoh at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:411]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16] arcanist(head=master, ref.master=4d6d3feb7fc1), phabricator(head=master, ref.master=9979952e71a5), phutil(head=master, ref.master=3753a09dfc7e)
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #0 phlog(Exception) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:411]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #1 PhabricatorCursorPagedPolicyAwareQuery::loadCursorObject(string) called at [<phabricator>/src/applications/almanac/query/AlmanacServiceQuery.php:198]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #2 AlmanacServiceQuery::getPagingValueMap(string, array) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:359]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #3 PhabricatorCursorPagedPolicyAwareQuery::buildPagingClause(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:274]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #4 PhabricatorCursorPagedPolicyAwareQuery::buildWhereClauseParts(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/applications/almanac/query/AlmanacServiceQuery.php:80]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #5 AlmanacServiceQuery::buildWhereClauseParts(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:264]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #6 PhabricatorCursorPagedPolicyAwareQuery::buildWhereClause(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:95]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #7 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPageRows(AlmanacService) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:81]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #8 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPage(AlmanacService) called at [<phabricator>/src/applications/almanac/query/AlmanacServiceQuery.php:63]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #9 AlmanacServiceQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:227]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #10 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/config/check/PhabricatorRepositoriesSetupCheck.php:18]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #11 PhabricatorRepositoriesSetupCheck::executeChecks() called at [<phabricator>/src/applications/config/check/PhabricatorSetupCheck.php:45]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #12 PhabricatorSetupCheck::runSetupChecks() called at [<phabricator>/src/applications/config/check/PhabricatorSetupCheck.php:126]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #13 PhabricatorSetupCheck::runAllChecks() called at [<phabricator>/src/applications/config/check/PhabricatorSetupCheck.php:91]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #14 PhabricatorSetupCheck::willProcessRequest() called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:94]
[Tue Jul 07 12:57:46 2015] [error] [client 10.1.10.16]   #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:21]

Do you have stuff in almanac_service?

SELECT count(*) FROM phabricator_almanac.almanac_service;

My theory here is that your services table is kinda messed up, but I'm having a hard time coming up with a clean way to fix this in the general case. I think I'm just going to soften the failure here for now, unless that query produces surprises.

I have one item in it, im sure just test data

Show me the row?

SELECT count(*) FROM phabricator_almanac.almanac_service;

Sorry:

SELECT * FROM phabricator_almanac.almanac_service;
MariaDB [(none)]> SELECT * FROM phabricator_almanac.almanac_service;
+----+--------------------------------+----------+--------------+----------------------+------------+------------+-------------+--------------+-------------------------------------+----------+
| id | phid                           | name     | nameIndex    | mailKey              | viewPolicy | editPolicy | dateCreated | dateModified | serviceClass                        | isLocked |
+----+--------------------------------+----------+--------------+----------------------+------------+------------+-------------+--------------+-------------------------------------+----------+
|  1 | PHID-ASRV-d37knvokh4nbdgpgi7a5 | asdfasdf | i2t2Auj466uu | 4mdskgdbpsvfmhdwhy3c | users      | admin      |  1420570588 |   1422406407 | AlmanacClusterRepositoryServiceType |        0 |
+----+--------------------------------+----------+--------------+----------------------+------------+------------+-------------+--------------+-------------------------------------+----------+

Also, this is on two machines (though one is a clone of the other).

chad claimed this task.

Works

good catch.

ヽ༼ ຈل͜ຈ༼ ▀̿̿Ĺ̯̿̿▀̿ ̿༽Ɵ͆ل͜Ɵ͆ ༽ノ