Error adding GPG Key #11325

Closed
opened 2025-11-02 09:34:26 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @STaRDoGG on GitHub (Jul 24, 2023).

Description

When I go to add my public gpg key at https://gitea.domain.rocks/user/settings/keys I'm getting this error:

An error occurred:

AddPublicKey, Error 1264 (22003): Out of range value for column 'expired_unix' at row 1

Gitea Version

1.20.1

Git Version

2.40.1, Wire Protocol Version 2 Enabled

How are you running Gitea?

Official Docker container

Database

MySql / MariaDB

Screenshots

image

Originally created by @STaRDoGG on GitHub (Jul 24, 2023). ### Description When I go to add my public gpg key at https://gitea.domain.rocks/user/settings/keys I'm getting this error: > An error occurred: > > AddPublicKey, Error 1264 (22003): Out of range value for column 'expired_unix' at row 1 ### Gitea Version 1.20.1 ### Git Version 2.40.1, Wire Protocol Version 2 Enabled ### How are you running Gitea? Official Docker container ### Database MySql / MariaDB ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/1524526/1c9e91fb-60c0-4132-bc38-d330db926fa5)
GiteaMirror added the type/bug label 2025-11-02 09:34:26 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jul 25, 2023):

Thanks for this report, could you share your public key that you uploaded?

@techknowlogick commented on GitHub (Jul 25, 2023): Thanks for this report, could you share your **public** key that you uploaded?
Author
Owner

@STaRDoGG commented on GitHub (Jul 25, 2023):

@techknowlogick Sure thing:

-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEZLxUJhYJKwYBBAHaRw8BAQdAPC+7z3gBawAIuttYV4fbjwlgqBsC782r5TUP
8i9JDv20JUouIFNjb3R0IEVsYmxlaW4gPHN0YXJkb2dnQGdtYWlsLmNvbT6IkwQT
FgoAOxYhBBbsV4Q3umu57TrprgSKH0n69vOCBQJkvFQmAhsjBQsJCAcCAiICBhUK
CQgLAgQWAgMBAh4HAheAAAoJEASKH0n69vOCdmQBANo460PNWuxgd079E5eWsY/c
nX8xevEAP7UFkPzvOOckAP0SiTdae7kZUz6dLKuFopXyiayzNnYVfjYzfSd3twva
Bbg4BGS8VCYSCisGAQQBl1UBBQEBB0B6oqJZgzL5aDCn8nW+XBNQSQraYmr91BNS
xFVD5PWbEgMBCAeIeAQYFgoAIBYhBBbsV4Q3umu57TrprgSKH0n69vOCBQJkvFQm
AhsMAAoJEASKH0n69vOCkTgBAPtlGp4LsiI/qDSDkFyFYMvYb9P42c6RdxA8vqj9
xi5MAP96F64ZxRjYja3YfCHZaE6rowKcaIefQSml8o6twQGyAA==
=ZlkT
-----END PGP PUBLIC KEY BLOCK-----
@STaRDoGG commented on GitHub (Jul 25, 2023): @techknowlogick Sure thing: ``` -----BEGIN PGP PUBLIC KEY BLOCK----- mDMEZLxUJhYJKwYBBAHaRw8BAQdAPC+7z3gBawAIuttYV4fbjwlgqBsC782r5TUP 8i9JDv20JUouIFNjb3R0IEVsYmxlaW4gPHN0YXJkb2dnQGdtYWlsLmNvbT6IkwQT FgoAOxYhBBbsV4Q3umu57TrprgSKH0n69vOCBQJkvFQmAhsjBQsJCAcCAiICBhUK CQgLAgQWAgMBAh4HAheAAAoJEASKH0n69vOCdmQBANo460PNWuxgd079E5eWsY/c nX8xevEAP7UFkPzvOOckAP0SiTdae7kZUz6dLKuFopXyiayzNnYVfjYzfSd3twva Bbg4BGS8VCYSCisGAQQBl1UBBQEBB0B6oqJZgzL5aDCn8nW+XBNQSQraYmr91BNS xFVD5PWbEgMBCAeIeAQYFgoAIBYhBBbsV4Q3umu57TrprgSKH0n69vOCBQJkvFQm AhsMAAoJEASKH0n69vOCkTgBAPtlGp4LsiI/qDSDkFyFYMvYb9P42c6RdxA8vqj9 xi5MAP96F64ZxRjYja3YfCHZaE6rowKcaIefQSml8o6twQGyAA== =ZlkT -----END PGP PUBLIC KEY BLOCK----- ```
Author
Owner

@STaRDoGG commented on GitHub (Jul 25, 2023):

Oops, just realized that I had forgotten that I was successful at switching the db from sqlite to my mariadb server. Updated the OP. Sorry bout that!

@STaRDoGG commented on GitHub (Jul 25, 2023): Oops, just realized that I had forgotten that I was successful at switching the db from sqlite to my mariadb server. Updated the OP. Sorry bout that!
Author
Owner

@STaRDoGG commented on GitHub (Jul 25, 2023):

If it helps any, here's my table:

image

@STaRDoGG commented on GitHub (Jul 25, 2023): If it helps any, here's my table: ![image](https://github.com/go-gitea/gitea/assets/1524526/b09017d4-602a-4662-a460-4784e62977b8)
Author
Owner

@lunny commented on GitHub (Jul 25, 2023):

Maybe those columns should be bigint but not int(11). How did you convert the database?

@lunny commented on GitHub (Jul 25, 2023): Maybe those columns should be `bigint` but not `int(11)`. How did you convert the database?
Author
Owner

@STaRDoGG commented on GitHub (Jul 27, 2023):

@lunny

You the man. =)

Changed it to bigint and re-tried to enter my key and it worked. I wish I could remember exactly how I did the conversion but it was awhile ago. I vaguely think I might remember the Gitea docs had some sort of instruction how to do it?

One questions, as I'm not the hugest SQL guru; when I go to change the column to bigint here:

image

and delete the "11" from the Length column, leaving it blank; then click Save, it ends up saving as bigint(20) rather than just 'bigint`. Any idea why? And is that fine, or?

Update:
Scratch that last question; I dug up the answer. Thanks for pointing out the fix!

@STaRDoGG commented on GitHub (Jul 27, 2023): @lunny You the man. =) Changed it to `bigint` and re-tried to enter my key and it worked. I wish I could remember exactly how I did the conversion but it was awhile ago. I vaguely think I might remember the Gitea docs had some sort of instruction how to do it? One questions, as I'm not the hugest SQL guru; when I go to change the column to `bigint` here: ![image](https://github.com/go-gitea/gitea/assets/1524526/963efd86-0184-4376-b310-2548409f4d3b) and delete the "11" from the Length column, leaving it blank; then click Save, it ends up saving as `bigint(20)` rather than just 'bigint`. Any idea why? And is that fine, or? Update: Scratch that last question; I dug up the [answer](https://stackoverflow.com/a/22015006/553663). Thanks for pointing out the fix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11325