You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to upgrade from 1.4.3 to 1.5.0 following the docs. Starting gitea 1.5.0 triggers DB migration, which then fails to complete and gitea crashes instead. From gitea.log:
2018/08/13 16:06:29 [I] Log Mode: File(Info)
2018/08/13 16:06:29 [I] XORM Log Mode: File(Info)
2018/08/13 16:06:29 [I] Cache Service Enabled
2018/08/13 16:06:29 [I] Session Service Enabled
2018/08/13 16:06:29 [I] Migration: Reformat and remove incorrect topics
2018/08/13 16:06:29 [I] This migration could take up to minutes, please be patient.
2018/08/13 16:06:30 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Sync2: Error 1071: Specified key was too long; max key length is 767 bytes
The problem might be the MySQL DB character set:
# mysql -e 'show create database gitea'
+----------+-------------------------------------------------------------------+
| Database | Create Database |
+----------+-------------------------------------------------------------------+
| gitea | CREATE DATABASE `gitea` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+-------------------------------------------------------------------+
According to this stackoverflow answer, the problem lies within the fact that utf8mb4 uses up to 4 bytes per char. Creating a unique index on a varchar(255) field then exceeds the max key length of 767 bytes, as 4*255 = 1020.
Prefix limits are measured in bytes. However, prefix lengths for index specifications in CREATE TABLE, ALTER TABLE, and CREATE INDEX statements are interpreted as number of characters for nonbinary string types (CHAR, VARCHAR, TEXT) and number of bytes for binary string types (BINARY, VARBINARY, BLOB). Take this into account when specifying a prefix length for a nonbinary string column that uses a multibyte character set.
Is there any way to keep using gitea with a utfmb4 character set, or is this simply not supported (yet)?
The text was updated successfully, but these errors were encountered:
[x]
):Description
I'm trying to upgrade from 1.4.3 to 1.5.0 following the docs. Starting gitea 1.5.0 triggers DB migration, which then fails to complete and gitea crashes instead. From gitea.log:
The problem might be the MySQL DB character set:
According to this stackoverflow answer, the problem lies within the fact that
utf8mb4
uses up to 4 bytes per char. Creating a unique index on avarchar(255)
field then exceeds the max key length of 767 bytes, as 4*255 = 1020.The MySQL docs state that:
Is there any way to keep using gitea with a utfmb4 character set, or is this simply not supported (yet)?
The text was updated successfully, but these errors were encountered: