Run php cli/joomla.php finder:index on a site with 30000+ articles
Indexing completed
Argument 2 passed to Joomla\Component\Finder\Administrator\Indexer\Result::
addNestedTaxonomy() must implement interface Joomla\CMS\Tree\ImmutableNodeI
nterface, null given, called in /var/www/clients/client1/web367/web/plugins
/finder/content/content.php on line 323
J 4.0.3
indexing 30000 articles on J4.03 running index from cli i get the same error about half way through indexing... I have tried to disable the content - smart search plugin, but i get the same error.
PHP Notice: Trying to get property 'published' of non-object in /var/www/clients/client1/web367/web/plugins/finder/content/content.php on line 323
PHP Notice: Trying to get property 'access' of non-object in /var/www/clients/client1/web367/web/plugins/finder/content/content.php on line 323
PHP Notice: Trying to get property 'language' of non-object in /var/www/clients/client1/web367/web/plugins/finder/content/content.php on line 323
In Result.php line 427:
Argument 2 passed to Joomla\Component\Finder\Administrator\Indexer\Result::
addNestedTaxonomy() must implement interface Joomla\CMS\Tree\ImmutableNodeI
nterface, null given, called in /var/www/clients/client1/web367/web/plugins
/finder/content/content.php on line 323
Labels |
Added:
No Code Attached Yet
|
--verbose
In Result.php line 427:
[TypeError]
Argument 2 passed to Joomla\Component\Finder\Administrator\Indexer\Result::addNestedTaxonomy() mus
t implement interface Joomla\CMS\Tree\ImmutableNodeInterface, null given, called in /var/www/clien
ts/client1/web367/web/plugins/finder/content/content.php on line 323
Exception trace:
at /var/www/clients/client1/web367/web/administrator/components/com_finder/src/Indexer/Result.php:427
Joomla\Component\Finder\Administrator\Indexer\Result->addNestedTaxonomy() at /var/www/clients/client1/web367/web/plugins/finder/content/content.php:323
PlgFinderContent->index() at /var/www/clients/client1/web367/web/administrator/components/com_finder/src/Indexer/Adapter.php:249
Joomla\Component\Finder\Administrator\Indexer\Adapter->onBuildIndex() at /var/www/clients/client1/web367/web/libraries/src/Plugin/CMSPlugin.php:285
Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin{closure}() at /var/www/clients/client1/web367/web/libraries/vendor/joomla/event/src/Dispatcher.php:486
Joomla\Event\Dispatcher->dispatch() at /var/www/clients/client1/web367/web/libraries/src/Application/EventAware.php:111
Joomla\CMS\Application\ConsoleApplication->triggerEvent() at /var/www/clients/client1/web367/web/libraries/src/Console/FinderIndexCommand.php:397
Joomla\CMS\Console\FinderIndexCommand->index() at /var/www/clients/client1/web367/web/libraries/src/Console/FinderIndexCommand.php:212
Joomla\CMS\Console\FinderIndexCommand->doExecute() at /var/www/clients/client1/web367/web/libraries/vendor/joomla/console/src/Command/AbstractCommand.php:235
Joomla\Console\Command\AbstractCommand->execute() at /var/www/clients/client1/web367/web/libraries/vendor/joomla/console/src/Application.php:1181
Joomla\Console\Application->runCommand() at /var/www/clients/client1/web367/web/libraries/vendor/joomla/console/src/Application.php:403
Joomla\Console\Application->doExecute() at /var/www/clients/client1/web367/web/libraries/src/Application/ConsoleApplication.php:188
Joomla\CMS\Application\ConsoleApplication->doExecute() at /var/www/clients/client1/web367/web/libraries/vendor/joomla/console/src/Application.php:448
Joomla\Console\Application->execute() at /var/www/clients/client1/web367/web/libraries/src/Application/ConsoleApplication.php:231
Joomla\CMS\Application\ConsoleApplication->execute() at /var/www/clients/client1/web367/web/cli/joomla.php:76
relevant? #26235
I have no unpublished categories, or even unpublished articles in any of my categories,
So not relevant, sorry.
But thank you.
Argument 2 passed to Joomla\Component\Finder\Administrator\Indexer\Result::addNestedTaxonomy() mus
t implement interface Joomla\CMS\Tree\ImmutableNodeInterface, null given, called in /var/www/clien
ts/client1/web367/web/plugins/finder/content/content.php on line 323
It crashes when category is unpublished or not exists in any reason.
And so $category = $categories->get($item->catid);
returns null
which leads to error you got.
joomla-cms/plugins/finder/content/content.php
Lines 320 to 324 in 6550d2a
It probably need extra check if($category)
or something
Can i easily do a sanity check on all articles to find out which one has a non-existing category? (without browsing 30000 articles manually)
or test with an "if($category)" fix?
Sincerely
Mikael.
Probably can run some SQL query in phpmyadmin or similar to find "dirty article". But I cannot help which one :)
or test with an "if($category)" fix?
I think it will be easiest, kind of:
if($category)
{
$item->addNestedTaxonomy('Category', $category, $this->translateState($category->published), $category->access, $category->language);
}
However it just a workaround. For now.
I have tried implementing the workaround in /plugins/finder/content/content.php:
if($category)
{
$item->addNestedTaxonomy('Category', $category, $this->translateState($category->published), $category->access, $category->language);
}
It gets a little bit further, and the new error is:
[ERROR] Data too long for column 'term' at row 1
Any idea if that is still the same bug, or a new one?
Sincerely
Mikael
Is it possible to easily implement a limit on the column 'term' data when reading the article info, so the error is avoided on writing the index?
Sincerely
Mikael.
Which order is it indexing articles in (asset_id?)
I have changed the number of articles in each batch to 100,
it indexes 21500 articles before it throws the error below.
I have tried to delete 500 articles at a time, "before, at and after", where the the asset_id order is about where article number 21500 should be.
Indexing still fails.
Is there another input check i can test, to get it to at least index the titles, or even better, finish indexing.
Sincerely
Mikael.
[ERROR] Data too long for column 'term' at row 1
The 'term' field have a limit 75.
It sounds like your content have words longer than 75 symbols. That not usual. Another "dirty articles".
As idea, try hack this part
joomla-cms/administrator/components/com_finder/src/Indexer/Indexer.php
Lines 935 to 945 in 771acef
And add extra IF:
if ($token->length > 70)
{
continue;
}
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-29 15:32:12 |
Closed_By | ⇒ | MikaelWinther1 |
With both workarounds implemented the indexing completed.
Thank you very much for all your hard work.
Just gets to show what we can do as a community! Joomla4ever!
Total Processing Time: 635.205 seconds.
Peak memory usage: 41,955,328 bytes
PHP Built On Linux 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64
Database Type mysql
Database Version 10.5.11-MariaDB-1
Database Collation utf8mb4_general_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 7.4.23
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 4.0.3 Stable [ Furaha ] 12-September-2021 10:39 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35676.