Cannot Add Large GPG Key #9441

Closed
opened 2025-11-02 08:38:58 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @lekoOwO on GitHub (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

Originally created by @lekoOwO on GitHub (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
GiteaMirror added the type/bug label 2025-11-02 08:38:58 -06:00
Author
Owner

@fsologureng commented on GitHub (Feb 13, 2023):

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.

@fsologureng commented on GitHub (Feb 13, 2023): Hello, This bug should be reopened because importing gpg keys suffered from the same issue. Reported in @Codeberg-org and @Forgejo [here](https://codeberg.org/forgejo/forgejo/issues/359). 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.
Author
Owner

@zeripath commented on GitHub (Feb 13, 2023):

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 commented on GitHub (Feb 13, 2023): 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.
Author
Owner

@fsologureng commented on GitHub (Feb 13, 2023):

Ok. No problem.

@fsologureng commented on GitHub (Feb 13, 2023): Ok. No problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9441