Skip to content
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

Database dump no longer works #7913

Closed
2 of 7 tasks
marbetschar opened this issue Aug 19, 2019 · 2 comments
Closed
2 of 7 tasks

Database dump no longer works #7913

marbetschar opened this issue Aug 19, 2019 · 2 comments

Comments

@marbetschar
Copy link

marbetschar commented 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

@guillep2k
Copy link
Member

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

@marbetschar
Copy link
Author

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!!

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants