gitea dump is broken when total size of repositories is bigger than half of memory #5802

Closed
opened 2025-11-02 06:36:24 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @basilrabi on GitHub (Jul 29, 2020).

  • Gitea version (or commit ref): 1.12.2
  • Git version: 2.26.2
  • Operating system: Fedora 32
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

gitea dump -c /etc/gitea/app.ini uses /tmp to temporarily store the zip dump. This method is broken once the zip is larger than half of memory since modern OS uses tmpfs for /tmp which has a capacity of equal to half of memory. According to the documentation, /var/tmp can be used for large files.

Originally created by @basilrabi on GitHub (Jul 29, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.12.2 - Git version: 2.26.2 - Operating system: Fedora 32 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description `gitea dump -c /etc/gitea/app.ini` uses `/tmp` to temporarily store the zip dump. This method is broken once the zip is larger than half of memory since modern OS uses `tmpfs` for `/tmp` which has a capacity of equal to half of memory. According to the [documentation](https://fedoraproject.org/wiki/Features/tmp-on-tmpfs), `/var/tmp` can be used for large files.
Author
Owner

@warnat commented on GitHub (Sep 13, 2020):

this is a fedora thing and has nothing to do with gitea. please close.

@warnat commented on GitHub (Sep 13, 2020): this is a fedora thing and has nothing to do with gitea. please close.
Author
Owner

@zeripath commented on GitHub (Sep 13, 2020):

There is a --tempdir option to set this to whatever is required:

https://docs.gitea.io/en-us/command-line/#dump

@zeripath commented on GitHub (Sep 13, 2020): There is a `--tempdir` option to set this to whatever is required: https://docs.gitea.io/en-us/command-line/#dump
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5802