-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Package registry: large packages download with size of 0B #20605
Comments
Are you using any reverse-proxy, or can you try to download the file from Gitea HTTP port directly? The content-length header doesn't seem to be generated by Gitea. |
I guess the problem is that the uploaded file was empty already. There is a bug when uploading packages. When a large package is uploaded, the If I add a |
That should not be EOF. My old test upload does not have a problem. I will have a look. Edit: The error occurs only with larger files which are temporarly stored on the filesystem, so my |
Fixed with #20622 |
Thanks for the quick fix! |
Now it on 1.18-dev There will be a backport for 1.17.1 |
Backport in #20635 |
I fear, this is not solved, or there is another bug. Gitea 1.17.2 (docker) $ ll
total 1,4G
drwxrwxr-x 2 someuser someuser 4,0K Okt 11 14:47 .
drwxrwxrwt 41 root root 12K Okt 11 14:50 ..
-rw-rw-r-- 1 someuser someuser 1,4G Aug 9 18:48 ubuntu-22.04.1-live-server-amd64.iso
$ curl --user user:tockentockentockentockentockentockentock --upload-file ubuntu-22.04.1-live-server-amd64.iso https://gitea.host/api/packages/user/generic/ubuntu-live-server/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
$ wget -O downloaded.iso https://gitea.host/user/-/packages/generic/ubuntu-live-server/22.04.1/files/30
--2022-10-11 14:57:57-- https://gitea.host/user/-/packages/generic/ubuntu-live-server/22.04.1/files/30
Resolving gitea.host (gitea.host)... 198.51.100.1
Connecting to gitea.host (gitea.host)|198.51.100.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [application/octet-stream]
Saving to: ‘downloaded.iso’
downloaded.iso [ <=> ] 0 --.-KB/s in 0s
2022-10-11 14:57:57 (0,00 B/s) - ‘downloaded.iso’ saved [0/0]
$ ll
total 1,4G
drwxrwxr-x 2 someuser someuser 4,0K Okt 11 14:57 .
drwxrwxrwt 41 root root 12K Okt 11 14:57 ..
-rw-rw-r-- 1 someuser someuser 0 Okt 11 14:57 downloaded.iso
-rw-rw-r-- 1 someuser someuser 1,4G Aug 9 18:48 ubuntu-22.04.1-live-server-amd64.iso And the logs at this time:
And there no new files on disk: $ touch --date "2022-10-10" /tmp/start
$ find /data/gitea/gitea/packages/ -type f -newer /tmp/start
$ |
Do you use a reverse proxy? Tested it with a 1.5gb file and it worked without problems. |
Yes, but same happens when uploading without proxy. $ curl --user user:tockentockentockentockentockentockentock --upload-file ubuntu-22.04.1-live-server-amd64.iso http://172.19.0.4:3000/api/packages/user/generic/ubuntu-live-server/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
$ wget -O downloaded.iso http://172.19.0.4:3000/api/packages/user/generic/ubuntu-live-server/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
--2022-10-11 14:03:51-- http://172.19.0.4:3000/api/packages/user/generic/ubuntu-live-server/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
Connecting to 172.19.0.4:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [application/octet-stream]
Saving to: ‘downloaded.iso’
downloaded.iso [ <=> ] 0 --.-KB/s in 0s
2022-10-11 14:03:51 (0.00 B/s) - ‘downloaded.iso’ saved [0/0]
$ ll
total 1.4G
drwxrwxr-x 2 someuser someuser 4.0K Oct 11 14:03 ./
drwxrwxrwt 15 root root 4.0K Oct 11 13:53 ../
-rw-rw-r-- 1 someuser someuser 0 Oct 11 14:03 downloaded.iso
-rw-rw-r-- 1 someuser someuser 1.4G Aug 9 16:48 ubuntu-22.04.1-live-server-amd64.iso |
Hmm... Can you, please, give me a hint, where to look for the uploaded files (temp path, disk path for a certain package file)? |
When uploading files larger 32mb the content gets temporarly stored in And the file is then stored in |
Thank you! There was an empty file under (Not overwriting existing files is correct, otherwise there is a possibility for a hash-collision attack) |
Description
When uploading a package to the generic registry, the size is correctly stated in the UI:
When downloading it, however, it has a size of 0B:
Gitea logs:
2022/08/01 23:21:08 [62e843c4] router: completed GET /bluerock/-/packages/generic/app/0-preview-2f3f0488da9755d3e1378fd33d95aceec86a1058/files/160 for 46.114.95.2:0, 0 in 25.2ms @ user/package.go:370(user.DownloadPackageFile)
Gitea Version
1.17.0
Can you reproduce the bug on the Gitea demo site?
No, maybe because it is on
1.18.0+dev-198-g4f14c6de1
?How are you running Gitea?
I am using the
gitea/gitea
docker image on thelatest
tagDatabase
PostgreSQL
The text was updated successfully, but these errors were encountered: