uploading rpm with large metadata fails with mysql/mariadb database #14742

Closed
opened 2025-11-02 11:21:46 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @alexth4ef9 on GitHub (Jul 10, 2025).

Description

same bug as #29110

log:

2025/07/10 17:22:29 .../packages/packages.go:312:addFileToPackageVersionUnchecked() [I] [SQL] INSERT INTO package_property (ref_type,ref_id,name,value) VALUES (?,?,?,?) [1 4535 rpm.metadata {"architecture":"x86_64","epoch":"0","version":"6.15.4","release":"200.fc42","vendor":"Fedora Project","group":"Unspecified","packager":"Fedora

... 1.7MB json ...

Linux v6.14.0-0.rc0.95ec54a420b8"}]}] - 36.435431ms
2025/07/10 17:22:29 .../packages/packages.go:313:addFileToPackageVersionUnchecked() [E] Error setting package file property: Error 1406 (22001): Data too long for column 'value' at row 1
2025/07/10 17:22:29 .../api/packages/rpm/rpm.go:172:UploadPackageFile() [I] [SQL] ROLLBACK [] - 2.011846ms
2025/07/10 17:22:29 .../api/packages/rpm/rpm.go:29:apiError() [E] Error 1406 (22001): Data too long for column 'value' at row 1
2025/07/10 17:22:29 HTTPRequest [I] router: completed PUT /api/packages/shardborn/rpm/fedora/f42/upload?sign=true for 10.89.0.6:0, 500 Internal Server Error in 413.7ms @ packages/api.go:553(packages.CommonRoutes.func1.(*Router).Group.CommonRoutes.func1.18.65)

according to https://github.com/go-gitea/gitea/blob/main/models/packages/package_property.go#L35 value column is of type TEXT (64kB on MySQL/MariaDB, unlimited on PostgreSQL)

this is similar to #16656

rpm to reproduce fedora 42 kernel-core (dnf download kernel-core)

no problem to upload it on demo.gitea.com (other database)

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

rootless podman container on fedora coreos 42

How are you running Gitea?

running gitea/gitea:latest-rootless

Database

MySQL/MariaDB

Originally created by @alexth4ef9 on GitHub (Jul 10, 2025). ### Description same bug as #29110 log: 2025/07/10 17:22:29 .../packages/packages.go:312:addFileToPackageVersionUnchecked() [I] [SQL] INSERT INTO `package_property` (`ref_type`,`ref_id`,`name`,`value`) VALUES (?,?,?,?) [1 4535 rpm.metadata {"architecture":"x86_64","epoch":"0","version":"6.15.4","release":"200.fc42","vendor":"Fedora Project","group":"Unspecified","packager":"Fedora ... 1.7MB json ... Linux v6.14.0-0.rc0.95ec54a420b8"}]}] - 36.435431ms 2025/07/10 17:22:29 .../packages/packages.go:313:addFileToPackageVersionUnchecked() [E] Error setting package file property: Error 1406 (22001): Data too long for column 'value' at row 1 2025/07/10 17:22:29 .../api/packages/rpm/rpm.go:172:UploadPackageFile() [I] [SQL] ROLLBACK [] - 2.011846ms 2025/07/10 17:22:29 .../api/packages/rpm/rpm.go:29:apiError() [E] Error 1406 (22001): Data too long for column 'value' at row 1 2025/07/10 17:22:29 HTTPRequest [I] router: completed PUT /api/packages/shardborn/rpm/fedora/f42/upload?sign=true for 10.89.0.6:0, 500 Internal Server Error in 413.7ms @ packages/api.go:553(packages.CommonRoutes.func1.(*Router).Group.CommonRoutes.func1.18.65) according to https://github.com/go-gitea/gitea/blob/main/models/packages/package_property.go#L35 value column is of type TEXT (64kB on MySQL/MariaDB, unlimited on PostgreSQL) this is similar to #16656 rpm to reproduce fedora 42 kernel-core (dnf download kernel-core) no problem to upload it on demo.gitea.com (other database) ### Gitea Version 1.24.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System rootless podman container on fedora coreos 42 ### How are you running Gitea? running gitea/gitea:latest-rootless ### Database MySQL/MariaDB
GiteaMirror added the type/bugissue/workaround labels 2025-11-02 11:21:46 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 11, 2025):

MySQL LONGTEXT problem is still not resolved. @lunny

And also this one:

As a workaround, you can manually alter that column to "LONGTEXT" type.

@wxiaoguang commented on GitHub (Jul 11, 2025): MySQL LONGTEXT problem is still not resolved. @lunny And also this one: * https://github.com/go-gitea/gitea/issues/34764#issuecomment-2986102920 > As a workaround, you can manually alter that column to "LONGTEXT" type.
Author
Owner

@wxiaoguang commented on GitHub (Jul 17, 2025):

@lunny

@wxiaoguang commented on GitHub (Jul 17, 2025): @lunny
Author
Owner

@lunny commented on GitHub (Jul 17, 2025):

Image

In MySQL, the TEXT type has a size limit of 64KB. Therefore, I believe we should change the Value column to LONGTEXT to support larger data. This change will require a migration to update the column type accordingly.
For other supported databases, the TEXT type typically allows for larger sizes, but we should still ensure compatibility across all of them.

@lunny commented on GitHub (Jul 17, 2025): <img width="523" height="167" alt="Image" src="https://github.com/user-attachments/assets/98b8b077-90a7-4352-be69-cb2bf089b901" /> In MySQL, the TEXT type has a size limit of 64KB. Therefore, I believe we should change the Value column to LONGTEXT to support larger data. This change will require a migration to update the column type accordingly. For other supported databases, the TEXT type typically allows for larger sizes, but we should still ensure compatibility across all of them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14742