humhub / wiki

Create and edit pages with this powerful tool. Build a collaborative knowledge base, view and share information with your colleagues.
28 stars 35 forks source link

Search doesn't work anymore: Invalid database configuration #340

Closed marc-farre closed 3 months ago

marc-farre commented 4 months ago

Original discussion: https://community.humhub.com/content/perma?id=279490

Tested with Wiki module version 2.3.3 on HumHub 1.16.1.

When searching a keyword, the following error displays:

Invalid database configuration
SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list The SQL being executed was: SELECT COUNT(*) FROM `content` LEFT JOIN `contentcontainer` ON `content`.`contentcontainer_id` = `contentcontainer`.`id` LEFT JOIN `content_fulltext` ON content_fulltext.content_id=content.id LEFT JOIN `space` ON contentcontainer . pk = space . id and contentcontainer .class='humhub\\modules\\space\\models\\Space' LEFT JOIN `user` `cuser` ON contentcontainer . pk = cuser . id and contentcontainer .class='humhub\\modules\\user\\models\\User' LEFT JOIN `space_membership` ON contentcontainer . pk = space_membership . space_id and contentcontainer .class='humhub\\modules\\space\\models\\Space' and space_membership . user_id =50100 LEFT JOIN `user_friendship` `cff` ON cuser.id=cff.user_id AND cff.friend_user_id=50100 WHERE (content_fulltext.content_id IS NOT NULL) AND (MATCH(content_fulltext.contents, content_fulltext.comments, content_fulltext.files) AGAINST ('+test*' IN BOOLEAN MODE)) AND (`content`.`object_model`='humhub\\modules\\wiki\\models\\WikiPage') AND (`content`.`state`=1) AND (space.id IS NOT NULL AND ( space_membership.status=3 OR (content.visibility=1 AND space.visibility != 0) ) OR cuser.id IS NOT NULL AND ( (content.visibility = 1) OR (content.visibility = 0 AND content.contentcontainer_id=50135) OR (content.visibility = 0 AND cff.id IS NOT NULL))OR content.created_by=50100 OR content.contentcontainer_id IS NULL)

The following connection string was used:
mysql:host=localhost;dbname=humhub

Technical information
["yii\\db\\Exception","HY000",1191,"Can't find FULLTEXT index matching the column list"]

PDOException: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list in /var/www/humhub/protected/vendor/yiisoft/yii2/db/Command.php:1320
Stack trace:
#0 /var/www/humhub/protected/vendor/yiisoft/yii2/db/Command.php(1320): PDOStatement->execute()
#1 /var/www/humhub/protected/vendor/yiisoft/yii2/db/Command.php(1186): yii\db\Command->internalExecute()
#2 /var/www/humhub/protected/vendor/yiisoft/yii2/db/Command.php(443): yii\db\Command->queryInternal()
#3 /var/www/humhub/protected/vendor/yiisoft/yii2/db/Query.php(497): yii\db\Command->queryScalar()
#4 /var/www/humhub/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(352): yii\db\Query->queryScalar()
#5 /var/www/humhub/protected/vendor/yiisoft/yii2/db/Query.php(368): yii\db\ActiveQuery->queryScalar()
#6 /var/www/humhub/protected/humhub/modules/content/search/driver/MysqlDriver.php(125): yii\db\Query->count()
#7 /var/www/humhub/protected/humhub/modules/content/search/driver/AbstractDriver.php(59): humhub\modules\content\search\driver\MysqlDriver->search()
#8 [internal function]: humhub\modules\content\search\driver\AbstractDriver->humhub\modules\content\search\driver\{closure}()
#9 /var/www/humhub/protected/vendor/yiisoft/yii2/caching/Cache.php(608): call_user_func()
#10 /var/www/humhub/protected/humhub/modules/content/search/driver/AbstractDriver.php(58): yii\caching\Cache->getOrSet()
#11 /var/www/humhub/protected/modulesnoncuzy/wiki/controllers/OverviewController.php(99): humhub\modules\content\search\driver\AbstractDriver->searchCached()
#12 [internal function]: humhub\modules\wiki\controllers\OverviewController->actionSearch()
#13 /var/www/humhub/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#14 /var/www/humhub/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#15 /var/www/humhub/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#16 /var/www/humhub/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#17 /var/www/humhub/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#18 /var/www/humhub/index.php(28): yii\base\Application->run()
#19 {main}
yurabakhtin commented 3 months ago

@marc-farre @luke- The error tells "Can't find FULLTEXT index matching the column list" because the FULLTEXT index is not found for the columns. I think the core migration is not applied. I think DB should be updated here:

db_update

marc-farre commented 3 months ago

@yurabakhtin Thanks.

I have "Your database is up-to-date.".

However, I cloned the migration m240203_112155_search.php file to force this migration again and now it works...

So no sure why it didn't apply with the original one, and why it seems that I'm not the only one having this issue.

I close this issue as it's not related to the Wiki module, and I'll open another one on humhub repository if needed.

aronbos commented 3 months ago

In my log is: Could not execute content fulltext search migration: SQLSTATE[HY000]: General error: 1221 Incorrect usage of spatial/fulltext/hash index and explicit index order The SQL being executed was: ALTER TABLE content_fulltext ADD FULLTEXT INDEX ftx (contents ASC, comments ASC, files ASC)

Doing it by SQL gives the same error.

marc-farre commented 3 months ago

@aronbos Thanks for the error log. @yurabakhtin I've created a new issue for it: https://github.com/humhub/humhub/issues/7119