No Code Attached Yet
avatar MikaelWinther1
MikaelWinther1
26 Sep 2021

Steps to reproduce the issue

Run php cli/joomla.php finder:index on a site with 30000+ articles

Expected result

Indexing completed

Actual result

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

System information (as much as possible)

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.

Additional comments

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

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar MikaelWinther1 MikaelWinther1 - open - 26 Sep 2021
avatar joomla-cms-bot joomla-cms-bot - change - 26 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Sep 2021
avatar MikaelWinther1
MikaelWinther1 - comment - 26 Sep 2021

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.

avatar MikaelWinther1
MikaelWinther1 - comment - 26 Sep 2021

--verbose

  • Skipping pause, as previous batch had a very low processing time (0.112s < 1s)
  • Processed batch 424 in 0.111 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.111s < 1s)
  • Processed batch 425 in 0.103 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.103s < 1s)
  • Processed batch 426 in 0.102 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.102s < 1s)
  • Processed batch 427 in 0.103 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.103s < 1s)
  • Processed batch 428 in 0.108 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.108s < 1s)
    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:

[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


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35676.
avatar ChristineWk
ChristineWk - comment - 26 Sep 2021

relevant? #26235


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35676.

avatar MikaelWinther1
MikaelWinther1 - comment - 26 Sep 2021

I have no unpublished categories, or even unpublished articles in any of my categories,
So not relevant, sorry.

But thank you.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35676.

avatar Fedik
Fedik - comment - 27 Sep 2021

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.

// Add the category taxonomy data.
$categories = Categories::getInstance('com_content', ['published' => false, 'access' => false]);
$category = $categories->get($item->catid);
$item->addNestedTaxonomy('Category', $category, $this->translateState($category->published), $category->access, $category->language);

It probably need extra check if($category) or something

avatar MikaelWinther1
MikaelWinther1 - comment - 27 Sep 2021

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35676.
avatar Fedik
Fedik - comment - 27 Sep 2021

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.

avatar MikaelWinther1
MikaelWinther1 - comment - 27 Sep 2021

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:

  • Processed batch 423 in 1.31 seconds.
  • Processed batch 424 in 1.626 seconds.
  • Processed batch 425 in 1.281 seconds.
  • Processed batch 426 in 1.172 seconds.
  • Processed batch 427 in 1.109 seconds.
  • Processed batch 428 in 1.94 seconds.
  • Processed batch 429 in 2.06 seconds.
  • Processed batch 430 in 1.619 seconds.
  • Processed batch 431 in 1.446 seconds.

[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

avatar MikaelWinther1
MikaelWinther1 - comment - 27 Sep 2021

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.

avatar Fedik
Fedik - comment - 28 Sep 2021

It something new, I do not know why it happen.
Maybe @Hackwar can give a hint

avatar MikaelWinther1
MikaelWinther1 - comment - 28 Sep 2021

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.

  • Processed batch 213 in 0.167 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.167s < 1s)
  • Processed batch 214 in 0.157 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.157s < 1s)
  • Processed batch 215 in 0.156 seconds.
  • Skipping pause, as previous batch had a very low processing time (0.156s < 1s)

[ERROR] Data too long for column 'term' at row 1

avatar Fedik
Fedik - comment - 29 Sep 2021

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

foreach ($tokens as $token)
{
if ($filterCommon && $token->common)
{
continue;
}
if ($filterNumeric && $token->numeric)
{
continue;
}

And add extra IF:

if ($token->length > 70)
{
  continue;
}
avatar MikaelWinther1 MikaelWinther1 - change - 29 Sep 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-09-29 15:32:12
Closed_By MikaelWinther1
avatar MikaelWinther1
MikaelWinther1 - comment - 29 Sep 2021

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!

  • Pausing processing for 1 seconds ...
  • Continuing processing of batch ...
  • Processed batch 298 in 4.431 seconds.
  • Pausing processing for 1 seconds ...
  • Continuing processing of batch ...
  • Processed batch 299 in 12.466 seconds.
  • Pausing processing for 2 seconds ...
  • Continuing processing of batch ...

Total Processing Time: 635.205 seconds.
Peak memory usage: 41,955,328 bytes

avatar MikaelWinther1 MikaelWinther1 - close - 29 Sep 2021
avatar Fedik
Fedik - comment - 29 Sep 2021

I have made a PR based on it, please test #35701

Add a Comment

Login with GitHub to post a comment