Skip to content

Gitea server keeps filling up with bundle/zip archives #34003

Open
@toloveru

Description

@toloveru

Description

Hi, I am the maintainer of git.nixmagic.com. After using Gitea on it since 2020-06-04, I recently started experiencing storage issues on both gitea-1.23.5-linux-amd64 and gitea-1.22.1-linux-amd64 (both upstream binary releases). This may have been present before too, but unlikely. Currently its instance is on a 64GB storage quota (applied after this incident consumed a whole ZFS pool instead), which it exceeded in less than 48 hours from 13GB base. This was temporarily resolved by executing the command below.

Directory: ~/data/repo-archives
User: git
Command: for file in $(find . | grep -E 'zip|bundle'); do rm $file; done

This leads me to believe that zip and bundle archives are being generated at an unreasonable pace. In other issues and related documentation, I found that such files are generated on-demand by users of the instance. However, my edge nodes that terminate TLS for this node do not confirm this being an active attack. They don't seem to have much traffic at all. That leads me to believe that this is an internal issue. For the time being, I'll apply a cron job to periodically flush these files as mentioned there. But that's a band-aid, not a solution. Both generating and eliminating these files consumes unneccesary CPU and IO resources.

If you're willing to take a look into the source code to narrow this down, much appreciated. Similarly, I'll keep track of this issue to offer any information I can from my instance. Thank you!

As a side note, is it possible to downgrade Gitea? I tried to replace my symlink from 1.23.5 to 1.22.1, but this caused the associated service to fail. Both files are/were executable, but I don't remember why exactly it failed. I can start this service both in systemd and manually, so troubleshooting here is possible. However, it does incur service downtime that I'd prefer to avoid unless necessary.

If need be, I can clone this entire instance into a local replica. This replica would have a filesystem-level one-to-one copy on account of ZFS, but would not necessarily be tethered to the production instance and its reverse proxy. The replica will require network and other such client-side changes. This may be useful to determine whether this issue is truly local at the application level. If determined useful, I will make such replica and document it accordingly.

Tracking on snapshot ssd/lxc/ct/gitea@2025-03-25_GitHub, created / completed on 02:02 CET.

Gitea Version

1.23.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

nixmagic.com/pub/2025-03-24_Gitea - I'll publish logs here as needed. So far I'm thinking of e1.nixmagic.com and e2.nixmagic.com's NGINX logs for git.nixmagic.com. Those should offer an overview into the Internet's requests towards this Gitea instance. Internally, the only user is yours truly. But infected hosts may exist. Logs from Gitea itself may provide equally useful, if not more so. Please let me know.

Screenshots

No response

Git Version

2.39.5

Operating System

Debian 12 amd64

How are you running Gitea?

My deployment of Gitea is from upstream binary release, for amd64 target architecture. This is on a Debian 12 stable system, running within LXC. The storage system is ZFS, which is how the quota has been applied from the host system.

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions