Skip to content

Cannot start - tmp_recreate__reaction. Error: Error 1071: Specified key was too long; max key length is 767 bytes #13588

Closed
@gsantner

Description

@gsantner
  • Gitea version (or commit ref): master
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL -- MariaDB 10.1.47-0ubuntu0.18.04
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

logfile.log

Description

Hello, since about 6 days I cannot start latest version of gitea anymore.
Checked log, and found this in log:

2020/11/16 19:16:39 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 354.86µs
2020/11/16 19:16:39 ...ations/migrations.go:344:Migrate() [I] Migration[159]: update reactions constraint
2020/11/16 19:16:39 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] BEGIN TRANSACTION [] - 98.283µs
2020/11/16 19:16:39 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] CREATE TABLE IF NOT EXISTS `tmp_recreate__reaction` (`id` BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL, `type` VARCHAR(255) NOT NULL, `issue_id` BIGINT(20) NOT NULL, `comment_id` BIGINT(20) NULL, `user_id` BIGINT(20) NOT NULL, `original_author_id` BIGINT(20) DEFAULT 0 NOT NULL, `original_author` VARCHAR(255) NULL, `created_unix` BIGINT(20) NULL) DEFAULT CHARSET utf8mb4 ROW_FORMAT=DYNAMIC [] - 195.574µs
2020/11/16 19:16:39 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] CREATE UNIQUE INDEX `UQE_tmp_recreate__reaction_s` ON `tmp_recreate__reaction` (`type`,`issue_id`,`comment_id`,`user_id`,`original_author_id`,`original_author`) [] - 146.654µs
2020/11/16 19:16:39 ...ations/migrations.go:395:recreateTable() [E] Unable to create uniques for table tmp_recreate__reaction. Error: Error 1071: Specified key was too long; max key length is 767 bytes
2020/11/16 19:16:39 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] ROLLBACK [] - 79.173µs
2020/11/16 19:16:39 routers/init.go:85:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: Error 1071: Specified key was too long; max key length is 767 bytes
2020/11/16 19:16:39 routers/init.go:86:initDBEngine() [I] Backing off for 3 seconds

So seemingly some database/orm mapper issue due too big key length.

I have these versions locally from gitea download site (current/master). The latest working version for me is from 10. November, so the bug has been introduced with a commit on/after that day.

./gitea-2020-11-10 --version  # <--- Working
Gitea version 1.14.0+dev-181-g8bae34c4b built with GNU Make 4.1, go1.15.4 : bindata, sqlite, sqlite_unlock_notify

./gitea-2020-11-13 --version # <-- Not working
Gitea version 1.14.0+dev-197-gc2e05d9f9 built with GNU Make 4.1, go1.15.4 : bindata, sqlite, sqlite_unlock_notify

./gitea-2020-11-16 --version # <-- Not working
Gitea version 1.14.0+dev-220-g0de546009 built with GNU Make 4.1, go1.15.5 : bindata, sqlite, sqlite_unlock_notify

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/upstreamThis is an issue in one of Gitea's dependencies and should be reported there

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions