Skip to content

[API] Payloads too large for the database schema cause errors 500 #19471

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

Closed
cghislai opened this issue Apr 23, 2022 · 3 comments
Closed

[API] Payloads too large for the database schema cause errors 500 #19471

cghislai opened this issue Apr 23, 2022 · 3 comments
Labels

Comments

@cghislai
Copy link

Description

While setuping a renovate bot to include release notes in its pull requests, i noticed that the gitea api was sometimes returning errors 500, causing the renovate job to fail.
The cause was a pull requests comment too large for the database schema, from what i get in the logs:

Mon, Apr 18 2022 2:04:24 pm | 2022/04/18 12:04:24 modules/web/route.go:70:func1() [I] [SQL] ROLLBACK [] - 224.592µs
Mon, Apr 18 2022 2:04:24 pm | 2022/04/18 12:04:24 .../api/v1/repo/pull.go:599:EditPullRequest() [E] UpdateIssueByAPI: Error 1406: Data too long for column 'content' at row 1
Mon, Apr 18 2022 2:04:24 pm | 2022/04/18 12:04:24 Completed PATCH /api/v1/repos/Valuya/embedded-webview/pulls/6 500 Internal Server Error in 40.601052ms

I think gitea should return a client error in the 4xx range in such cases, probably with a dedicated message.
That would be easier to handle by api consumers.

See also #18783 dealing with user input size limit in the UI
See also renovatebot/renovate#15162 for the related renovate issue

Gitea Version

1.15.10

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 the helm chart deployed on a kubernetes cluster

Database

PostgreSQL

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 23, 2022

Please use latest release, the field size of content has been fixed to correct value.

@cghislai
Copy link
Author

thx, sorry i hadn't checked that :/

@wxiaoguang
Copy link
Contributor

Feel free to re-open if there is still a 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

No branches or pull requests

2 participants