mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-16 13:20:06 -05:00
MySql/MariaDB issue: Error 1709: Index column size too large. The maximum column size is 767 bytes. #1278
Closed
opened 2025-11-02 03:55:09 -06:00 by GiteaMirror
·
26 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.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1.4.0-rc2
v1.3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/question
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#1278
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ulorentz on GitHub (Nov 26, 2017).
[x]):Description
While trying to install from the binary version, I had this error message: " Error 1709: Index column size too large. The maximum column size is 767 bytes."
I run Debian 9, where it is installed MariaDB (equivalent of MySQL) database.
I tried running:
SET GLOBAL innodb_large_prefix = ON;
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=ON;
but nothing happened.
It seems to be a mariaDB related issue. I have just tried in a virtual machine with Debian 8 (wich runs mysql 5.5, very old...). I had no problem: installation succeeded! The fact is that in Debian 9 mariaDB comes in place of mysql, so I guess every user using Debian 9 should have this issue (I'v tried in different virtua machine running Debian 9, even in a fresh install, and all produced that error), it's not only a problem of Gitea, also Gogs produces the same error.
What else to do?
@lafriks commented on GitHub (Nov 26, 2017):
Please use latest stable version 1.2.3 as 1.0.1 is quite old
@ulorentz commented on GitHub (Nov 26, 2017):
I upgrated to 1.2.3, same issue. Nothing changed.
@lafriks commented on GitHub (Nov 26, 2017):
Did you try
set global innodb_large_prefix = ON;?@ulorentz commented on GitHub (Nov 26, 2017):
Yes, sorry i didn't write in the first post, but I used this command before the other two. I'll add in the first post.
@lafriks commented on GitHub (Nov 26, 2017):
@lunny can this be related to xorm?
@ulorentz commented on GitHub (Nov 26, 2017):
It seems to be a mariaDB related issue. I have just tried in a virtual machine with Debian 8 (wich runs mysql 5.5, very old...). I had no problem: installation succeeded! The problem is that in Debian 9 mariaDB comes in place of mysql, so I guess every user using Debian 9 should have this issue (I tried in different virtuamachine running Debian 9, even a fresh install and all produced that error), it's not only a problem of Gitea, also Gogs produces the same error.
@lunny commented on GitHub (Nov 27, 2017):
I will try with mariabd
@ulorentz commented on GitHub (Nov 27, 2017):
I opened a thread issue on gogs repository. An user answered me, giving a method that solved the problem. It's very laborious, but maybe it gives you an hint on what to change in gitea code to work properly:
"1- Create your gogs database as usual.
2- Visit the install page
3- Type in your data (database, user, etc.)
4- Click on Button "Install" -> It will fail with: 'Error 1709: Index column size too large. The maximum column size is 767 bytes.'
BUT the tables were partially created.
5- Now connect to your mariadb, use your gogs database and alter the tables with the following command:
ALTER TABLE tablename ROW_FORMAT=DYNAMIC;
6- Now go back to step 2 and repeat it. Always alter all "new" tables which were created.
After 4 or 5 rounds you get every needed table and it's done."
After it it works.
Any idea of what's wrong between mariadb and gitea/gogs?
@lunny commented on GitHub (Nov 28, 2017):
I cannot reproduce this issue on my macOS with mariadb docker on gitea master and gitea v1.2.3.
@appleboy commented on GitHub (Apr 6, 2018):
Please upgrade MariaDB to
10.2.14. The10.1version is not working for me.@SagePtr commented on GitHub (Aug 13, 2018):
Another temporary solution for MariaDB or for older MySQL (if you can't update it) is to put
innodb_large_prefixinto my.cnf (which is default starting from certain versions of MySQL and MariaDB).@CountMurphy commented on GitHub (Aug 14, 2018):
I had to do a little bit more to get this working.
See https://stackoverflow.com/a/43403017
Also this sql for those who don't want to type it out:
ALTER TABLE access ROW_FORMAT=DYNAMIC;
ALTER TABLE access_token ROW_FORMAT=DYNAMIC;
ALTER TABLE action ROW_FORMAT=DYNAMIC;
ALTER TABLE attachment ROW_FORMAT=DYNAMIC;
ALTER TABLE collaboration ROW_FORMAT=DYNAMIC;
ALTER TABLE comment ROW_FORMAT=DYNAMIC;
ALTER TABLE commit_status ROW_FORMAT=DYNAMIC;
ALTER TABLE deleted_branch ROW_FORMAT=DYNAMIC;
ALTER TABLE deploy_key ROW_FORMAT=DYNAMIC;
ALTER TABLE email_address ROW_FORMAT=DYNAMIC;
ALTER TABLE external_login_user ROW_FORMAT=DYNAMIC;
ALTER TABLE follow ROW_FORMAT=DYNAMIC;
ALTER TABLE gpg_key ROW_FORMAT=DYNAMIC;
ALTER TABLE hook_task ROW_FORMAT=DYNAMIC;
ALTER TABLE issue ROW_FORMAT=DYNAMIC;
ALTER TABLE issue_assignees ROW_FORMAT=DYNAMIC;
ALTER TABLE issue_label ROW_FORMAT=DYNAMIC;
ALTER TABLE issue_user ROW_FORMAT=DYNAMIC;
ALTER TABLE issue_watch ROW_FORMAT=DYNAMIC;
ALTER TABLE label ROW_FORMAT=DYNAMIC;
ALTER TABLE lfs_lock ROW_FORMAT=DYNAMIC;
ALTER TABLE lfs_meta_object ROW_FORMAT=DYNAMIC;
ALTER TABLE login_source ROW_FORMAT=DYNAMIC;
ALTER TABLE milestone ROW_FORMAT=DYNAMIC;
ALTER TABLE mirror ROW_FORMAT=DYNAMIC;
ALTER TABLE notice ROW_FORMAT=DYNAMIC;
ALTER TABLE notification ROW_FORMAT=DYNAMIC;
ALTER TABLE org_user ROW_FORMAT=DYNAMIC;
ALTER TABLE protected_branch ROW_FORMAT=DYNAMIC;
ALTER TABLE public_key ROW_FORMAT=DYNAMIC;
ALTER TABLE pull_request ROW_FORMAT=DYNAMIC;
ALTER TABLE reaction ROW_FORMAT=DYNAMIC;
ALTER TABLE release ROW_FORMAT=DYNAMIC;
ALTER TABLE repo_indexer_status ROW_FORMAT=DYNAMIC;
ALTER TABLE repo_redirect ROW_FORMAT=DYNAMIC;
ALTER TABLE repo_unit ROW_FORMAT=DYNAMIC;
ALTER TABLE repository ROW_FORMAT=DYNAMIC;
ALTER TABLE star ROW_FORMAT=DYNAMIC;
ALTER TABLE stopwatch ROW_FORMAT=DYNAMIC;
ALTER TABLE team ROW_FORMAT=DYNAMIC;
ALTER TABLE team_repo ROW_FORMAT=DYNAMIC;
ALTER TABLE team_user ROW_FORMAT=DYNAMIC;
ALTER TABLE topic ROW_FORMAT=DYNAMIC;
ALTER TABLE tracked_time ROW_FORMAT=DYNAMIC;
ALTER TABLE two_factor ROW_FORMAT=DYNAMIC;
ALTER TABLE u2_f_registration ROW_FORMAT=DYNAMIC;
ALTER TABLE upload ROW_FORMAT=DYNAMIC;
ALTER TABLE user ROW_FORMAT=DYNAMIC;
ALTER TABLE user_open_id ROW_FORMAT=DYNAMIC;
ALTER TABLE version ROW_FORMAT=DYNAMIC;
ALTER TABLE watch ROW_FORMAT=DYNAMIC;
ALTER TABLE webhook ROW_FORMAT=DYNAMIC;
@zxvfxwing commented on GitHub (Aug 15, 2018):
Hi
did the trick for me.
@marlemion commented on GitHub (Aug 22, 2018):
Same here, on most recent Arch. All the suggestions above did not help!
Any other idea?
@rugk commented on GitHub (Sep 8, 2018):
One issue for me was the
releasetable.The command returned this:
So
releaseseems to be some kind of reserved keyword. As such, you need to run… instead, which syntactically makes it clear to MariaDB, that this is the table name.
@jives commented on GitHub (Sep 9, 2018):
I'm on MariaDB 10.1.35 and I had to set
innodb_default_row_format=dynamicin addition to (which I had set already)
to deal with the exact same error.
@rugk commented on GitHub (Sep 9, 2018):
Oh, yeah, i already commented that, but GitHub's markdown parsing of course used the backticks for ending my code part. 😄
@rugk commented on GitHub (Sep 9, 2018):
done
@ostaszewskik commented on GitHub (Sep 13, 2018):
Upgrading my Debian 9 stretch mariadb from 10.1 to 10.3 fixed the issue for me.
@JPabloSA commented on GitHub (Sep 16, 2018):
install mariadb 10.3 works "debian 9.5"
--Install dependency packages
sudo apt-get install software-properties-common dirmngr
--Add MariaDB 10.3 repository and Import GPG key
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.zol.co.zw/mariadb/repo/10.3/debian stretch main'
--install
sudo apt-get update && sudo apt-get install mariadb-server
@ChangePlaces commented on GitHub (Dec 24, 2018):
@JPabloSA your solution won't work on pi devices as new repositories can't be added
@cdknight commented on GitHub (Jan 5, 2019):
I just realized that
set global innodb_default_row_format=dynamicshould fix this instead of manually doing theALTER TABLE table_name ROW_FORMAT=DYNAMICfor each table. Keep in mind you have to also haveinnodb_file_format=Barracuda.@stale[bot] commented on GitHub (Mar 7, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@zeripath commented on GitHub (Jun 22, 2019):
This is another utf8mb4 issue.
We've added a few prs to help with this #7144 #6992
This particular issue is with old versions of Maria DB which do not provide a large enough index space. We simply cannot support utf8mb4 on those versions. Therefore I will close this won't fix.
@Rychu-Pawel commented on GitHub (Sep 28, 2019):
For me it was necessary to execute
But probably also adding to the config what @jives wrote should also work
innodb_default_row_format=dynamic.@asnodj commented on GitHub (Nov 27, 2019):
Work in MariaDB 9.8 ! Thanks !!!!