humhub / humhub

HumHub is an Open Source Enterprise Social Network. Easy to install, intuitive to use and extendable with countless freely available modules.
https://www.humhub.com
Other
6.31k stars 1.66k forks source link

Error with a database migration to the new content search #7119

Closed marc-farre closed 3 months ago

marc-farre commented 3 months ago

What steps will reproduce the problem?

Upgrade to HumHub 1.16

What is the expected result?

No error

What do you get instead?

Because of the m240203_112155_search.php migration, this error occurs:

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.

Additional info

Original issue: https://github.com/humhub/wiki/issues/340#issuecomment-2228227851

Q A
HumHub version 1.16
marc-farre commented 3 months ago

@aronbos What is your SQL server? MariaDB? MySQL? Which version?

Can you check the HumHub prerequisites in Administration -> Information -> Prerequisites? Have you got a warning about the database?

Thanks!

aronbos commented 3 months ago

MySQL - Versie - 8.0.37-0ubuntu0.22.04.3 MySQL - Gegevensbank-sortering - utf8mb4_general_ci MySQL - Tabel sorteringen - utf8mb4_unicode_ci, utf8mb4_general_ci MySQL - Tabel-opslagsystemen - InnoDB

Your database is up-to-date.

No warnings about the database.

yurabakhtin commented 3 months ago

@marc-farre I see the log has the old query ALTER TABLE content_fulltext ADD FULLTEXT INDEX ftx (contents ASC, comments ASC, files ASC) which was fixed to ALTER TABLE content_fulltext ADD FULLTEXT INDEX ftx (contents, comments, files) as we discussed here.

Probably we should create a new migration to create the fulltext index if it was not created before. Do you agree?

marc-farre commented 3 months ago

@yurabakhtin Yes, exactly, I forgot about this issue. Yes, recreating a new migration by renaming the file and the class name will fix the current issue, and thanks to the safe methods, it's not a problem for HumHub instances where this migration already applied.

marc-farre commented 3 months ago

@aronbos Thanks for the info. This issue will be fixed in the next version of HumHub, but if you need a quick fix, you can already rename this file and class (in protected/humhub/modules/content/migrations): image

E.g. to m240203_112156_search and then apply the migration in Administration -> Information -> Database.

yurabakhtin commented 3 months ago

@yurabakhtin Yes, exactly, I forgot about this issue. Yes, recreating a new migration by renaming the file and the class name will fix the current issue, and thanks to the safe methods, it's not a problem for HumHub instances where this migration already applied.

@marc-farre @luke- Done in the PR https://github.com/humhub/humhub/pull/7120.

krseguros commented 3 months ago

Greetings.

Thanks for the follow-up and the intention to help.

image

Search index reconstruction underway. The name of the main HumHub database is krseguro_humh575 Your database is up to date.

HumHub  Community Edition Versión: 1.16.1

The issue persists, should I wait for a future update?

marc-farre commented 3 months ago

You can add this file on your server: https://github.com/humhub/humhub/pull/7120/files And then go back to the Database page (the one on your screenshot).

krseguros commented 3 months ago

I'm afraid I don't have the necessary knowledge to do this, I have the humhub instance on shared hosting.

Could you tell me the path where to place this file?

krseguros commented 3 months ago

Dear, thank you very much for the help, I was able to do it, add the indicated file and that's it. This corrected the problem.

It also solved the search problem I had reported before.

THANK YOU. image image