rebuildSearchIndex fails silently (OJS 3.3.0-19). How to diagnose the issue?

When I run rebuildSearchIndex from the command line, it begins work and starts indexing the first journal. It goes slowly but eventually, when it has put maybe 35000 entries in the submissions, things just hang. No more processing…no errors…just seems to be sitting there. Is there a log I can check to track down the issue? Is there something I can add to the source code to kick out an error message? I don’t see any PHP errors so I am at a loss.

I have gotten a bit deeper into the issue…I’m now thinking it’s a data problem but I’m at a loss to determine where it is (so I can fix it). As OJS is rebuilding the index on the first of our journals, php throws this error a few minutes in

[21-Nov-2024 11:02:59 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getData() on null in /opt/local/htdocs/ojs33019/classes/search/ArticleSearchIndex.inc.php:38

Stack trace:

#0 /opt/local/htdocs/ojs33019/classes/search/ArticleSearchIndex.inc.php(280): ArticleSearchIndex->submissionMetadataChanged()

#1 /opt/local/htdocs/ojs33019/tools/rebuildSearchIndex.php(59): ArticleSearchIndex->rebuildIndex()

#2 /opt/local/htdocs/ojs33019/tools/rebuildSearchIndex.php(75): rebuildSearchIndex->execute()

#3 {main}

thrown in /opt/local/htdocs/ojs33019/classes/search/ArticleSearchIndex.inc.php on line 38

Hi @grotophorst,

It looks like you have a submission without a publication, which should be impossible. You can identify the data with the following MySQL query:

SELECT s.* FROM submissions s
LEFT JOIN publications p ON (s.current_publication_id = p.publication_id)
WHERE p.publication_id IS NULL;

Regards,
Alec Smecher
Public Knowledge Project Team