appleboy / appleboy/docker-backup-database

MySQL backup archive is missing (no such file or directory)

Open
#17 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
135
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Hi!

I have a Docker Compose config that looks something like this:

```
services:
mysql:
image: mysql:8
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-app}
MYSQL_RANDOM_ROOT_PASSWORD: true
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-password}
MYSQL_USER: ${MYSQL_USER:-app}
volumes:
- mysql_data:/var/lib/mysql
hostname: mysql.local

mysql_backup:
image: appleboy/docker-backup-database:mysql8
environment:
STORAGE_DRIVER: disk
STORAGE_BUCKET: mysql
TIME_SCHEDULE: * * * * *
DATABASE_DRIVER: mysql
DATABASE_HOST: mysql.local
DATABASE_USERNAME: ${MYSQL_USER:-app}
DATABASE_PASSWORD: ${MYSQL_PASSWORD:-password}
DATABASE_NAME: ${MYSQL_DATABASE:-app}
DATABASE_OPTS: "--no-tablespaces"
volumes:
- mysql_data_backup:/backup/mysql

volumes:
mysql_data:
mysql_data_backup:
```

When trying to perform a backup, an error occurs:

```
mysql_backup-1 | 2025/01/29 18:20:00 INFO start backup database now schedule="* * * * *"
mysql_backup-1 | ׆xaLH󠮋¿䗛ª ʺ[
¥^r[AuH]𐆮󤵵¤BewH]ވ¹¡ч45¤؊4ڴ
L烬
s疃¿󀶚⸿­ť@󡢠mysqldump --version
mysql_backup-1 | mysqldump Ver 8.4.4 for Linux on x86_64 (MySQL Community Server - GPL)
mysql_backup-1 | $ mysqldump -h mysql.local -P 3306 -u app app
mysql_backup-1 | $ gzip
mysql_backup-1 |ܚmsنþ\~Ƶq
mysql_backup-1 | qŵų& )϶𝓙¹Zo
±ÿ}O�1-cψԮߞ߳쟄`þ¼󻮝󿿳𣷮ـ댱ĸ�H
W¯ÿ׫a!,Wº,Hǫl(4QEE¦W²,Lċτİjኻଣ~s<ǃ¥ ;E©Ȣ2U¤Cp*¬ߞܕ
񢬬AសqqʼU

𩣔jv]΅;㹋e8~ڛʢ甀ծL?e¾{«ṙ~¾䗊P!ɕDΕY¸ϴr²󿿳Yª󿾿'񍇶«°P
mysql_prod_backup-1 | 川[²¢
¯C¹ݬ¡|뤭$󛑾nz<´úҼ¨[~Ɛp| ̄Xt[c'X«hc`@)hÿ~4¶֐
W5¨颰}𗃏qO鸆򽸩!̧/"򤰎{怐ߋ«¢eٳ·`&¼Px4·芓촯¼&b¥}(l֢񤾢=f®ꅸřF¿¢*¤󾶰hٙ¸¾ѥц´ ³+¹0okB½½HMί+Ǣ׾aa·£￷EћF|?Sȃ蜍溄
ں8°Fh؉½䄃ƍ󿶄^|ӏw峩_"
C{´g$[ҞϹ
󕚠fFؗĞ񄖲ٷ"±Lۑշ}d$°[Ŗ¶t
mysql_backup-1 | º܌6܅DﳼSǙ
Y6R¶.¥lɓ_`}&񼵨I
mysql_backup-1 |
¶ⷣ񴸽اh®<©¦(ܽª"ࠇ¦⺡a´+㝬¯UrZdb%z¡-¥}¸eeY󜰃©뱑Œ𒗰᠞<#k¨؂̤󒌣
mysql_backup-1 | R/̀'9[0ԮH¨ܭ{¬¬¬3·.ߢ` ̼*eUa%£򴌐樔"¿愣<9{6ᐽQYO㈍󤘸
mysql_backup-1 | GI&m³²£塏
s®}󷓯ZᄹX쓌Il
mysql_backup-1 | 2025/01/29 18:20:00 ERROR can't backup database err="can't open the gzip file: open dump.sql.gz: no such file or directory"
```

![Image](https://github.com/user-attachments/assets/b0c5e272-368c-4666-be13-3b0c2f4b17ef)

It seems the error is related to the file being displayed on the screen instead of being saved to disk?

**Note: Rolling back to 1.0.1 version solves this issue**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.