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 import large GPG key #22896

Closed
fsologureng opened this issue Feb 13, 2023 · 6 comments · Fixed by #22897
Closed

Cannot import large GPG key #22896

fsologureng opened this issue Feb 13, 2023 · 6 comments · Fixed by #22897
Labels

Comments

@fsologureng
Copy link
Contributor

fsologureng commented Feb 13, 2023

Description

Hello,
This bug has been reported in @Codeberg-org and @forgejo here.

The problem is related with #20894.

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.

Gitea Version

Codeberg

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?

Forgejo latest build https://codeberg.org/forgejo/forgejo/commits/branch/v1.18/forgejo

Database

MySQL

@zeripath
Copy link
Contributor

We won't be able to backport this I'm afraid as there are quite a few migrations in 1.19 that are not in 1.18.

I think if you just run ALTER TABLE `gpg_import_key` CHANGE `content` `content` MEDIUMTEXT I'm fairly certain that Gitea should just work, and I think the migration should just no-op when time comes to upgrade to 1.19.

@fsologureng
Copy link
Contributor Author

Thanks @zeripath

@zeripath
Copy link
Contributor

I guess it's worth just double checking that gpg_import_key is the only thing that is left to do here and/or if you could provide a test case that fails then we could confirm for sure that this works.

zeripath added a commit to zeripath/gitea that referenced this issue Feb 13, 2023
Unfortunately go-gitea#20896 does not completely prevent Data too long issues and
GPGImportKey needs to be increased too.

Fix go-gitea#22896

Signed-off-by: Andrew Thornton <[email protected]>
@fsologureng
Copy link
Contributor Author

I guess it's worth just double checking that gpg_import_key is the only thing that is left to do here and/or if you could provide a test case that fails then we could confirm for sure that this works.

The test case is detailed in the linked bug report, with a link to a public gpg key grater than 64kb.

If your suggestion is implemented in Codeberg and works, I will report back here.

@zeripath
Copy link
Contributor

Unfortunately I don't think that test case would be suitable to add to our test cases - as we'd probably need to add that person's email address in to our testcases! I guess what we need is to create a big keyring for one our test users e.g. [email protected] - this is a bit involved for me to do right now.

@fsologureng
Copy link
Contributor Author

Sorry, I misunderstood your request at first.

jolheiser pushed a commit that referenced this issue Feb 16, 2023
Unfortunately #20896 does not completely prevent Data too long issues
and GPGKeyImport needs to be increased too.

Fix #22896

Signed-off-by: Andrew Thornton <[email protected]>
@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.

2 participants