It was because the max key length is 767 byte, and repository_id was varchar(250), if we use utf8mbt4, then the actural length might be 1000 which is exceed the 767 limit. Change to utf8, 250*3=750 was not exceed the 767 limit, so it works.