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

Large uploads fail in web client #31017

Closed
exodrifter opened this issue May 18, 2024 · 6 comments
Closed

Large uploads fail in web client #31017

exodrifter opened this issue May 18, 2024 · 6 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@exodrifter
Copy link

exodrifter commented May 18, 2024

Description

I'm trying to upload large release binaries (~300MB) to a tagged release Gitea.

The following curl request works and attaches the upload to the release as expected:

curl -vv -X POST -H "Authorization: token $key" "https://$url/api/v1/repos/user/repository/releases/99/assets?name=linux.zip" -F "attachment=@linux.zip"

However, uploading the same attachment through the web interface will hang when the upload progress bar fills up. In my case, Gitea is running in a Docker container behind nginx, so eventually nginx times out. Gitea reports the nginx response as an error and the upload fails to be attached to the release.

I tried to test what would happen if I did the same upload on try.gitea.io but it appears to be down at the moment. I'll try to update this issue later when I'm able to test it there. Unfortunately, I couldn't figure out how to run my Gitea without nginx, since logging in doesn't seem to work.

I found an issue that might be related (#11906), but the fix for it appears to still exist.

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/exodrifter/2ee2aee15835ea0e4e8f7e007c89b0af

Screenshots

Here's what the web interface looks like when the upload fails:

The error in plaintext:

<html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>nginx</center> </body> </html> 

Git Version

2.34.1

Operating System

Ubuntu 22.04.4 LTS

How are you running Gitea?

We are running Gitea from docker, which is behind an nginx reverse proxy which is being run in a SWAG container.

Database

PostgreSQL

@eeyrjmr
Copy link
Contributor

eeyrjmr commented May 18, 2024

What is your nginx setting with respect to payload?

@KN4CK3R KN4CK3R added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed type/bug labels May 19, 2024
@KN4CK3R
Copy link
Member

KN4CK3R commented May 19, 2024

Check your client_max_body_size setting in nginx.

@exodrifter
Copy link
Author

exodrifter commented May 20, 2024

client_max_body_size is 0, which I believe disables checking of the client request body size.

As an aside, I tried testing this on try.gitea.io again, but trying to register an account returns a 500. I'll try again a different day.

@wxiaoguang
Copy link
Contributor

There are some guesses for this problem:

  1. The uploading on nginx side timeouts (eg: improper timeout setting, laggy network, browser proxy, etc)
  2. The uploading on Gitea side timeouts

For the first case, you could try to double-check your config/environment.

For the second case, could you provide a reproducible setup with detailed steps? eg: a docker compose file, and the steps to reproduce. If it could be reproduced on a developer's machine, then it could be fixed soon.

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea labels May 27, 2024
@exodrifter
Copy link
Author

I am planning on putting aside some time in two weeks to see if I can create a reproducible setup.

@exodrifter
Copy link
Author

I was able to test this locally with a docker installation on 1.21.11 as well as on the demo site (which is on 1.23.0+dev-197-gab1948d4a3), and was unable to reproduce it.

I mistakenly assumed that if it worked with cURL that it would be a problem with Gitea, but it is clear to me now that is an issue with how the forward proxy is configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

4 participants