databacker / mysql-backup

image to enable automated backups of mysql databases in containers
636 stars 178 forks source link

tgz file not extractable #321

Closed topsnet-holgerd closed 2 months ago

topsnet-holgerd commented 2 months ago

produced several dumps as *.tgz files, none of them can be extracted:

$ tar -xzf db_backup_2024-07-11T23:23:02Z.tgz tar (child): Cannot connect to db_backup_2024-07-11T23: resolve failed gzip: stdin: unexpected end of file tar: Child returned status 128 tar: Error is not recoverable: exiting now

$ gzip -dk db_backup_2024-07-12T08:53:02Z.tgz $ tar -xvf db_backup_2024-07-12T08:53:02Z.tar tar: Cannot connect to db_backup_2024-07-12T08: resolve failed

deitch commented 2 months ago

Hi @topsnet-holgerd can you share exactly how to reproduce? Or if you have one such file that doesn't have confidential data, upload it here?

topsnet-holgerd commented 2 months ago

Sorry, although tgz files are supported, I received this message: "We don’t support that file type. Try again with GIF, JPEG, JPG, MOV, MP4, PNG, SVG, WEBM, CPUPROFILE, CSV, DMP, DOCX, FODG, FODP, FODS, FODT, GZ, JSON, JSONC, LOG, MD, ODF, ODG, ODP, ODS, ODT, PATCH, PDF, PPTX, TGZ, TXT, XLS, XLSX or ZIP."

The Database that should be dumped belongs to Pimcore in a Docker environment.

Launched Container with schedule once config: docker run -d --rm --network=topsnet-pimcore-tbs_default -v /opt/bsc/backup/mysql-bkpC.conf:/mysql-bkp.conf -v /opt/bsc/backup/mysql:/backup databack/mysql-backup:master --config-file=/mysql-bkp.conf dump

This is our config file:

version: config.databack.io/v1
kind: local
spec:
  logging: debug
  database:
    server: database
    port: 3306
    credentials:
      username: root
      password: root
  targets:
    local-backup:
      type: file
      url: /backup
  dump:
    targets:
      - local-backup
    schedule:
      once: true
#      frequency: 1440 # in minutes
#      begin: +1 # What time to do the first dump. Must be in one of two formats: Absolute: HHMM, e.g. `2330` or `0415`; or Relative: +MM, i.e. how many minutes after starting the container, e.g. `+0` (immediate), `+10` (in 10 minutes), or `+90` in an hour and a half"
#     cron: "3 18 1-31 1-12 0-6"
#    compression: gzip # defaults to gzip
    filenamePattern: db_backup_first.{{ .compression }}
#    scripts:
#      preBackup: /path/to/prescripts/
#      postBackup: /path/to/postscripts/

filenamePattern option and cron option did not work as well.

deitch commented 2 months ago

I received this message: "We don’t support that file type. Try again with GIF, JPEG, JPG, MOV, MP4, PNG, SVG, WEBM, CPUPROFILE, CSV, DMP, DOCX, FODG, FODP, FODS, FODT, GZ, JSON, JSONC, LOG, MD, ODF, ODG, ODP, ODS, ODT, PATCH, PDF, PPTX, TGZ, TXT, XLS, XLSX or ZIP."

From where did you receive that message?

Also, your original error says:

tar: Cannot connect to db_backup_2024-07-12T08: resolve failed

"Cannot connect" and "resolve failed" implies that it is trying to connect somewhere over the Internet. Can your shell handle all of the characters correctly? Try running tar with verbosity or debug? Did you quote the filename?

topsnet-holgerd commented 2 months ago

The message came directly beneath the input field.

Allright, I'm sorry. It seemed to be the colons in the name, that prevents tar to extract the file. When replaced by underscores, the file can be extracted. I close this issue.