?
avatar brian-j
brian-j
8 May 2020

Steps to reproduce the issue

Cronjob triggers Smart Search plugin to index the content:
php /home/[...........]/public_html/otherdomain.com/cli/finder_indexer.php

Note that this is an add-on domain (since my provider allows me to host several domains - hence the path includes 'otherdomain.com', and of course the relevant cli directory is under that level).

Expected result

All batches processed without any errors

Actual result

Starting Indexer
Setting up Smart Search plugins
Setup 115 items in 0.34 seconds.
JLIB_APPLICATION_ERROR_INVALID_CONTROLLER

Warning: Use of undefined constant JPATH_COMPONENT - assumed 'JPATH_COMPONENT' (this will throw an Error in a future version of PHP) in /home/...../public_html/otherdomain.com/libraries/src/MVC/Controller/BaseController.php on line 232

System information (as much as possible)

Joomla 3.9.18
PHP 7.2.29

Additional comments

Note that this is an add-on domain (since my provider allows me to host several domains - hence the path includes 'otherdomain.com', and of course the relevant cli directory is under that level).

This happens either as a cron job, or directly by ssh into the server.

I tried this suggestion from #24607:
Why not adding an additional
define('JPATH_COMPONENT', JPATH_COMPONENT_ADMINISTRATOR);
inside cli script.

That gave me the following error:
Starting Indexer
Setting up Smart Search plugins
Setup 115 items in 0.242 seconds.
JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS
There was no WARNING: output.

avatar brian-j brian-j - open - 8 May 2020
avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 May 2020
avatar brian-j
brian-j - comment - 9 May 2020

One further comment - the articles being indexed DO have custom fields applied to them, which was why I tried out 24607.

avatar SharkyKZ
SharkyKZ - comment - 12 May 2020

I can't reproduce this issue. Do you have any extensions installed?

avatar Hackwar
Hackwar - comment - 6 Jun 2020

JPATH_COMPONENT normally points to the current component of the request. Since you are calling a CLI script, there isn't really a component that is being loaded. It seems like you have a third party extension that is not set up to run in a CLI environment. I don't think this is a core Joomla issue.

avatar Quy Quy - close - 7 Jun 2020
avatar Quy
Quy - comment - 7 Jun 2020

Closing as non-core issue.

avatar Quy Quy - change - 7 Jun 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-06-07 15:40:11
Closed_By Quy

Add a Comment

Login with GitHub to post a comment