Page MenuHomePhabricator

Call to a member function updateDatasourceTokens() on null at PhabricatorProjectFulltextEngine.php:20 (due to DB corruption)
Open, LowPublicBUG REPORT

Description

Some more logspam but no idea how to reproduce or even call that source code file:

[2023-09-03 14:42:29] EXCEPTION: (Error) Call to a member function updateDatasourceTokens() on null at [<phorge>/src/applications/project/search/PhabricatorProjectFulltextEngine.php:20]
arcanist(), ava(), phorge(), translations(), wmf-ext-misc()
  #0 phlog(Error) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #1 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Error) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #2 AphrontApplicationConfiguration::handleThrowable(Error) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #3 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #4 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

I wonder if this could be vaguely related to T224662

Event Timeline

Aklapper created this task.
Aklapper changed the subtype of this task from "Task" to "Bug Report".Oct 27 2023, 10:31 AM

I can reproduce “Call to a member function updateDatasourceTokens() on null” reliably by searching all documents for “quarry” (search link). Searching open documents or open tasks works fine.

image.png (376×289 px, 28 KB)

Thanks for finding reproduction steps! <3

I wonder if this could be vaguely related to T224662

It is not. Can still reproduce.

DarkConsole shows that Phab ends up in updateDatasourceTokens() in https://we.phorge.it/source/phorge/browse/master/src/applications/project/storage/PhabricatorProject.php$454 if things do go well:

query	SELECT `project`.* FROM `project` `project`  WHERE (project.id IN (800))   ORDER BY `project`.`name` ASC
query	SELECT * FROM `phabricator_project`.`project` WHERE projectPath IN ('js_H')
query	SELECT * FROM `phabricator_project`.`project_slug` WHERE projectPHID IN ('PHID-PROJ-yh2h2e536o6uq6dvw3bu')
query	SELECT * FROM `project_slug` WHERE projectPHID = 'PHID-PROJ-yh2h2e536o6uq6dvw3bu'
query	START TRANSACTION
query	DELETE FROM `project_datasourcetoken` WHERE projectID = 800
query	INSERT INTO `project_datasourcetoken` (projectID, token) VALUES (800, 'quarry')
query	COMMIT
query	SELECT `project`.* FROM `project` `project`  WHERE (project.id IN (5469))   ORDER BY `project`.`name` ASC 
query	SELECT * FROM `phabricator_project`.`project` WHERE projectPath IN ('.Z2c')

If things go wrong then there is no query call after that last line above. The result of that last query is incorrectly empty thanks to database corruption due to using a broken custom downstream script which we finally removed in T342275: Remove script to convert Phabricator parent project into subproject.

See SELECT * FROM phabricator_project.project WHERE id = 5469 OR id = 800 OR id = 832; for all involved three projects.

Aklapper renamed this task from Call to a member function updateDatasourceTokens() on null at PhabricatorProjectFulltextEngine.php:20 to Call to a member function updateDatasourceTokens() on null at PhabricatorProjectFulltextEngine.php:20 (due to DB corruption).Apr 29 2024, 11:35 AM