Backup - out of disk space

I deployed new gitea with rootless podman (+ postgres).
I created one empty repository (readme + license).
I attempted to backup gitea. Inside container I executed: gitea dump -c /etc/gitea/app.ini
It failed with message: no space left on device
When inspected the unfinished backup file, it was 18,5 GB in size…
image

Obviously I am missing something…
Because this cannot be right.
Any thoughts?

My guess is it is entering an infinite loop of files and directories through a symbolic link. Are you able to list the files inside through something like unzip -lv gitea-dump-xxx.zip? If so, posting the result could help troubleshoot further (just the first thousandish lines would be OK).

You can pipe it to a file as well to avoid terminal buffer limits unzip -lv gitea-dump-xxx.zip > output.txt

The zip file is damaged…
image

The backup file is created in /var/lib/gitea and not in /tmp - that is I think the problem.

1 Like

Default paths in container:
image

I resolved the issue with mounting dedicated volume for backups and running:

gitea dump -c /etc/gitea/app.ini -f /backup/backup.zip

I have limits on included media files… and number of posts per minute too… :slight_smile:

2 Likes

No worries, glad you got it resolved! I think your hypothesis of the dump command trying to backup the dump zip is probably right.

Hi,

  • I am also facing the same issue. I have a repo, it is just has readme file only.

  • I have tried both sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f backup.zip and sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini
    But still I am facing the same error.

  • I have created VM with 800GB memory space for root, then I installed gitea, but the gitea dump utilized the 96% memory space(751G).

  • Please explain more about mounting dedicated volume for backups

  • Please let me know yours gitea backup size, please share your system memory size.

automation-gitea-clone:~$ df -hl
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              197M  1.3M  196M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  784G  751G     0
100% /
tmpfs                              982M     0  982M   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  131M  1.7G   8% /boot
/dev/sda1                          1.1G  6.1M  1.1G   1% /boot/efi
tmpfs                              197M  4.0K  197M   1% /run/user/1000

Without -f :

automation-gitea-clone:/usr/bin/data$ sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini

2024/05/02 04:58:50 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
2024/05/02 04:58:50 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
2024/05/02 04:58:50 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2024/05/02 04:58:50 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2024/05/02 04:58:50 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2024/05/02 04:58:50 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/attachments
2024/05/02 04:58:50 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/avatars
2024/05/02 04:58:50 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-avatars
2024/05/02 04:58:50 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2024/05/02 04:58:50 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-archive
2024/05/02 04:58:50 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
2024/05/02 04:58:50 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/packages
2024/05/02 04:58:50 cmd/dump.go:246:runDump() [I] Dumping local repositories... /var/lib/gitea/data/gitea-repositories
2024/05/02 04:58:50 cmd/dump.go:287:runDump() [I] Dumping database...
2024/05/02 04:58:50 cmd/dump.go:299:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2024/05/02 04:58:50 cmd/dump.go:318:runDump() [I] Custom dir /usr/bin/custom doesn't exist, skipped
2024/05/02 04:58:50 cmd/dump.go:327:runDump() [I] Packing data directory.../usr/bin/data
**Failed to include data directory: data/gitea-dump-1714625930.zip: copying contents: write gitea-dump-1714625930.zip: no space left on device**
2024/05/02 05:25:41 cmd/dump.go:162:fatal() [F] Failed to include data directory: data/gitea-dump-1714625930.zip: copying contents: write gitea-dump-1714625930.zip: no space left on device

Used -f :

automation-gitea-clone:/usr/bin/data$ sudo -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f backup.zip
2024/05/02 11:36:46 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
2024/05/02 11:36:46 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
2024/05/02 11:36:46 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2024/05/02 11:36:46 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2024/05/02 11:36:46 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2024/05/02 11:36:46 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/attachments
2024/05/02 11:36:46 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/avatars
2024/05/02 11:36:46 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-avatars
2024/05/02 11:36:46 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2024/05/02 11:36:46 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/repo-archive
2024/05/02 11:36:46 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
2024/05/02 11:36:46 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /usr/bin/data/packages
2024/05/02 11:36:46 cmd/dump.go:246:runDump() [I] Dumping local repositories... /var/lib/gitea/data/gitea-repositories
2024/05/02 11:36:46 cmd/dump.go:287:runDump() [I] Dumping database...
2024/05/02 11:36:46 cmd/dump.go:299:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2024/05/02 11:36:46 cmd/dump.go:318:runDump() [I] Custom dir /usr/bin/custom doesn't exist, skipped
2024/05/02 11:36:46 cmd/dump.go:327:runDump() [I] Packing data directory.../usr/bin/data
Failed to include data directory: data/backup.zip: copying contents: write backup.zip: no space left on device
2024/05/02 12:02:27 cmd/dump.go:162:fatal() [F] Failed to include data directory: data/backup.zip: copying contents: write backup.zip: no space left on device
automation-gitea-clone:/usr/bin/data$ df -hl
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              197M  1.3M  196M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  784G  751G     0 100% /
tmpfs                              982M     0  982M   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  131M  1.7G   8% /boot
/dev/sda1                          1.1G  6.1M  1.1G   1% /boot/efi
tmpfs                              197M  4.0K  197M   1% /run/user/1000

automation-gitea-clone:/usr/bin/data$ ls -lrt
total 780082208
drwxrwxr-x 3 git git         4096 May  2 11:36 tmp
drwxrwxr-x 2 git git         4096 May  2 11:36 repo-avatars
drwxrwxr-x 2 git git         4096 May  2 11:36 repo-archive
drwxrwxr-x 2 git git         4096 May  2 11:36 packages
drwxrwxr-x 2 git git         4096 May  2 11:36 avatars
drwxrwxr-x 2 git git         4096 May  2 11:36 attachments
-rw-rw-r-- 1 git git 798804058112 May  2 12:02 backup.zip
automation-gitea-clone:/usr/bin/data$

Thanks

Works fine.

sudo -H -u git /usr/bin/gitea dump -c /etc/gitea/app.ini -f /tmp/git_backup/gitea-dump.zip

sudo -H -u git /usr/bin/gitea restore -c /etc/gitea/app.ini -f /tmp/gitea_restore
2 Likes