Database dump no longer works #3810

Closed
opened 2025-11-02 05:26:05 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @marbetschar on GitHub (Aug 19, 2019).

  • Gitea version (or commit ref): 1.9.1
  • Git version: 1.8.3.1
  • Operating system: CentOS v7.6.18.10 (Core)
  • 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

Trying to execute a daily dump using the cron.daily facility which invokes the following script:

#!/bin/bash
TMP_DIR=/tmp
BACKUP_FILE=gitea-dump_$(date +%a).zip

sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "${BACKUP_FILE}" --tempdir "${TMP_DIR}"
chmod 644 "${TMP_DIR}/${BACKUP_FILE}"

The script fails to create the dump file with the following output:

$: sudo /etc/cron.daily/gitea
2019/08/19 11:24:05 ...dules/setting/git.go:83:newGit() [I] Git Version: 1.8.3.1
2019/08/19 11:24:05 ...dules/setting/log.go:226:newLogService() [I] Gitea v1.9.1 built with GNU Make 4.1, go1.12.8 : bindata, sqlite, sqlite_unlock_notify
chmod: cannot access ‘/tmp/gitea-dump_Mon.zip’: No such file or directory

FWIW: The script used to work in Gitea v1.8.0 - but stopped to do so since v1.9.0

Originally created by @marbetschar on GitHub (Aug 19, 2019). - Gitea version (or commit ref): 1.9.1 - Git version: 1.8.3.1 - Operating system: CentOS v7.6.18.10 (Core) - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description Trying to execute a daily dump using the cron.daily facility which invokes the following script: ``` #!/bin/bash TMP_DIR=/tmp BACKUP_FILE=gitea-dump_$(date +%a).zip sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "${BACKUP_FILE}" --tempdir "${TMP_DIR}" chmod 644 "${TMP_DIR}/${BACKUP_FILE}" ``` The script fails to create the dump file with the following output: ``` $: sudo /etc/cron.daily/gitea 2019/08/19 11:24:05 ...dules/setting/git.go:83:newGit() [I] Git Version: 1.8.3.1 2019/08/19 11:24:05 ...dules/setting/log.go:226:newLogService() [I] Gitea v1.9.1 built with GNU Make 4.1, go1.12.8 : bindata, sqlite, sqlite_unlock_notify chmod: cannot access ‘/tmp/gitea-dump_Mon.zip’: No such file or directory ``` FWIW: The script used to work in Gitea v1.8.0 - but stopped to do so since v1.9.0
Author
Owner

@guillep2k commented on GitHub (Aug 19, 2019):

We're missing any errors that Gitea might be showing. Could you please run the following command by hand and paste its output here?

cd /tmp ; sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "gitea_test.zip" --tempdir "/tmp" && ls -ls /tmp/gitea_test.zip
@guillep2k commented on GitHub (Aug 19, 2019): We're missing any errors that Gitea might be showing. Could you please run the following command by hand and paste its output here? ``` cd /tmp ; sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "gitea_test.zip" --tempdir "/tmp" && ls -ls /tmp/gitea_test.zip ```
Author
Owner

@marbetschar commented on GitHub (Aug 20, 2019):

Well ... your suggestion works and generates the following output:

2019/08/20 08:49:39 ...dules/setting/git.go:83:newGit() [I] Git Version: 1.8.3.1
2019/08/20 08:49:39 ...dules/setting/log.go:226:newLogService() [I] Gitea v1.9.1 built with GNU Make 4.1, go1.12.8 : bindata, sqlite, sqlite_unlock_notify
4194240 -rw-------. 1 git git 3352169795 Aug 20 08:52 /tmp/gitea_test.zip

For whatever reason my script started to work today too. Only thing that has changed is, that the machine was rebooted.

Anyway, the issue seems not to be Gitea related at all. Closing the issue for now. Thanks for your help!!

@marbetschar commented on GitHub (Aug 20, 2019): Well ... your suggestion works and generates the following output: ``` 2019/08/20 08:49:39 ...dules/setting/git.go:83:newGit() [I] Git Version: 1.8.3.1 2019/08/20 08:49:39 ...dules/setting/log.go:226:newLogService() [I] Gitea v1.9.1 built with GNU Make 4.1, go1.12.8 : bindata, sqlite, sqlite_unlock_notify 4194240 -rw-------. 1 git git 3352169795 Aug 20 08:52 /tmp/gitea_test.zip ``` For whatever reason my script started to work today too. Only thing that has changed is, that the machine was rebooted. Anyway, the issue seems not to be Gitea related at all. Closing the issue for now. Thanks for your help!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3810