Problem after upgrading to v15.8.0 (Categories are not displayed)

Hello,

We have successfully upgraded a test instance from v12.17.0 to v15.8.0. After the upgrade completes successfully, the categories no longer appear in the KMC. They do still exist in the database.

When I run /opt/kaltura/bin/kaltura-sphinx-reindex.sh, we receive the following error:

PHP Catchable fatal error: Argument 1 passed to kSphinxSearchManager::saveToSphinx() must be an instance of IIndexable, instance of CaptionAssetItem given, called in /opt/kaltura/app/deployment/base/scripts/populateSphinxCaptionAssetItem.php on line 33 and defined in /opt/kaltura/app/plugins/search/providers/sphinx_search/lib/kSphinxSearchManager.php on line 532
Failed to run /opt/kaltura/app/deployment/base/scripts/populateSphinxCaptionAssetItem.php.
Please try to run it manually and look at the logs

I have seen this post suggesting to run:

mysql> mysql -h $DB1_HOST -u $DB1_USER -p$DB1_PASS kaltura_sphinx_log < /opt/kaltura/app/deployment/updates/sql/2019_05_19_alter_table_sphinx_log.sql

The table already includes this column.

I then referred to this other post and followed the suggestion to add support for IIndexable back to /opt/kaltura/app/plugins/content/caption/search/lib/model/CaptionAssetItem.php, by adding the following changes back in.


- class CaptionAssetItem extends BaseCaptionAssetItem implements IBaseObject
+ class CaptionAssetItem extends BaseCaptionAssetItem implements IBaseObject, IIndexable

+        public function getIndexObjectName() {
+                return "CaptionAssetItemIndex";
+        }

+        /* (non-PHPdoc)
+         * @see IIndexable::setUpdatedAt()
+         */
+        public function setUpdatedAt($time)
+        {
+                return $this; // updates nothing
+        }

Once I do this and rerun kaltura-sphinx-reindex.sh, it completes successfully and the categories appear in the KMC as expected.

When I change the file back to the current v15.8.0 version and reindex, it fails again with the IIndexable error.

While it appears to be working with the modification in place, is there any advice to correct the situation so that it works without modifying the v15.8.0 CaptionAssetItem model?

Thanks in advance!

Hello @trevor_c1,

What PHP version are you running?

Thanks,

Hi @jess,

It looks like it is PHP 5.4.16. I’m guessing that PHP 7.x would be preferred now?

Thanks.

Hi @trevor_c1,

Please upgrade to PHP 5.6 or above. We support everything up to 7.2 (perhaps 7.3 as well but that was never fully tested).

Hi @jess,

We’ve upgraded to PHP 5.6.40 but are still seeing the same issue.

When I use the 15.8.0 version of CaptionAssetItem.php and run kaltura-sphinx-reindex, I get the same error mentioned above. When I change to the modified file that includes IIndexable and re-run kaltura-sphinx-reindex, it works as expected and the categories appear.

We’re going to try taking it up to PHP 7.2 and test again. Do you have any other thoughts?

Thanks again,

Hello @trevor_c1,

While, generally speaking, upgrading to PHP 7.n is a good idea, especially from a performance standpoint, I am not positive it is related to the issue at hand.

I’ll look into it shortly.

Regardless, with relation to PHP 7 and performance, you may find this post interesting:

Cheers,

Thanks @jess.

We’ve updated to PHP 7.2.24 now and are still seeing the same error when using the unmodified code for CaptionAssetItem.php. When you do have a moment, any further thoughts will be appreciated.

Thanks again!