Error adding index category to migxConfi: Specified key was too long; max key length is 1000 bytes

Hello there!
I am installing migx and get some errors.

Summary

I installed the packed through modx package installer, as usual. Then I get this error:

Error adding index category to migxConfig: Array ( [0] => 42000 [1] => 1071 [2] => Specified key was too long; max key length is 1000 bytes )
Error adding index field to migxFormtabField: Array ( [0] => 42000 [1] =

Any ideas how I should prevent that? I guess I have to adapt mariadb so it allows for bigger insertions or something?

Step to reproduce

Just instal migx on an ubuntu server with mariadb (default settings) and see the red log text in installer screen.

Environment

modx 2.7.3
nginx 1.18.o
10.3.25-MariaDB-0ubuntu0.20.04.1

never seen that. Seems, it has todo with the environment, but I really don’t know.
Did the installation fail completely?

hi! thanks for replying.
Installation did not fail actually. I think MIGX is working, I have not encountered any issues yet.
But the error seems a bit odd

I seems the error depends on the used charset. The maximum key length of a MyISAM table is 1000 bytes. If you use a charset like utf8mb4 that requires up to four bytes per character and the length of the field to index is 255, then you exceed this limit.

<field key="category" dbtype="varchar" phptype="string" precision="255" null="false" default="" index="index" />
2 Likes

sweet! I will try and set it another charset

Yeah, like @halftrainedharry said, it’s not possible currently to install MIGX on a database with UTF8mb4 encoding. I believe @bruno17 has fixed this in the Github repo so it should be in the next MIGX release. :slight_smile:

Note: UTF8mb4 is the default for MySQL 8.x (not sure about MariaDB) so it would need to be manually changed, or stick to MySQL 5.7 (or equivalent) for now until the new MIGX comes out.

Commit here:

1 Like

aah, there is it coming from. Seems, I have to push a new release soon

3 Likes

thanks! Will wait then :wink: