Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Add Large GPG Key #20894

Closed
lekoOwO opened this issue Aug 21, 2022 · 3 comments · Fixed by #20896
Closed

Cannot Add Large GPG Key #20894

lekoOwO opened this issue Aug 21, 2022 · 3 comments · Fixed by #20896
Labels

Comments

@lekoOwO
Copy link

lekoOwO commented Aug 21, 2022

Description

AddPublicKey: Error 1406: Data too long for column 'content' at row 1 happens when importing a longer GPG Key (e.g. 4096 key size often reaches the 64KB limit in case of MySQL's TEXT field)

Using MySQL 8.

Gitea Version

1.18.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Using Docker.

Database

MySQL

zeripath added a commit to zeripath/gitea that referenced this issue Aug 21, 2022
Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Aug 22, 2022
…20896)

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix #20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Aug 22, 2022
…o-gitea#20896)

Backport go-gitea#20896

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Unfortunately the migration in go-gitea#20896 cannot be backported to 1.17 so
affected users will have to use `gitea doctor recreate-table gpg_key public_key`

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Aug 22, 2022
…20896) (#20911)

Backport #20896

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Unfortunately the migration in #20896 cannot be backported to 1.17 so
affected users will have to use `gitea doctor recreate-table gpg_key public_key`

Fix #20894

Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 28, 2022
…o-gitea#20896)

Unfortunately some keys are too big to fix within the 65535 limit of TEXT on MySQL
this causes issues with these large keys.

Therefore increase these fields to MEDIUMTEXT.

Fix go-gitea#20894

Signed-off-by: Andrew Thornton <art27@cantab.net>
@fsologureng
Copy link
Contributor

Hello,
This bug should be reopened because importing gpg keys suffered from the same issue.

Reported in @Codeberg-org and @forgejo here.

The error log involved is

2023/02/12 15:37:27 ...user/setting/keys.go:117:KeysPost() [E] [63e907b5-20] AddPublicKey: Error 1406: Data too long for column 'content' at row 1

The table gpg_key_import should also be migrated to enlarge its content field size.

@zeripath
Copy link
Contributor

Instead of commenting on bugs that have been closed for over 6 months it's better to open a new one and reference the old one.

@zeripath zeripath reopened this Feb 13, 2023
@fsologureng
Copy link
Contributor

Ok. No problem.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants