Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-34999

cbbackupmgr duplicates log files on log collection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: User Error
    • 6.5.0, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4
    • 6.5.0
    • tools
    • Triaged
    • No

    Description

      When logs are collected with cbbackupmgr, it generates a zip archive with the backup's metadata and logs directory. When this happens, the existing log file(s) in the logs directory of the backup archive aren't deleted. These backup files are redundant, so we should clean these up.

      Eg: running collect logs on a backup archive with one backup produces two files in the logs directory:

      backup-01.log
      cbbackupmgr-collectinfo-backup-2019-07-10T140710.zip 

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          I could not reproduce this issue.

          pvarley Patrick Varley added a comment - I could not reproduce this issue.
          toby.wilds Toby Wilds added a comment -

          I might not have explained this in enough detail, my bad. 

          Steps to reproduce:

          Create a backup backup config and do a backup:

          $ /opt/couchbase/bin/cbbackupmgr config --archive /tmp/entbackup --repo backup
          $ /opt/couchbase/bin//cbbackupmgr backup --archive /tmp/entbackup --repo backup --cluster http://10.112.191.101:8091 --username Administrator  --password password  --no-progress-bar
          

          Run collect-logs on the backup archive:

          $ /opt/couchbase/bin/cbbackupmgr  collect-logs -a /tmp/entbackup
          

          Observation
           
          In the logs directory, we see both backup-0.log, alongside the zipped logs archive:

          $ ls /tmp/entbackup/logs/
          backup-0.log  cbbackupmgr-collectinfo-entbackup-2019-07-12T120351.zip
          

          If we extract the logs archive, we find a backup-0.log file within that is identical to the backup-0.log we observed at the top level, alongside the backup archive:

          $ cd /tmp/entbackup/logs/
          $ unzip cbbackupmgr-collectinfo-entbackup-2019-07-12T115813.zip
          $ diff backup-0.log cbbackupmgr-collectinfo-entbackup-2019-07-12T120351/logs/backup-0.log
          

          If this is intended then by all means mark this closed. However, my understanding was the log collection was intended to give additional information by extracting the logs with relevant additional metadata and also save space by cleaning up rotating log files and compressing them into a zip file.

          toby.wilds Toby Wilds added a comment - I might not have explained this in enough detail, my bad.  Steps to reproduce: Create a backup backup config and do a backup: $ /opt/couchbase/bin/cbbackupmgr config --archive /tmp/entbackup --repo backup $ /opt/couchbase/bin//cbbackupmgr backup --archive /tmp/entbackup --repo backup --cluster http://10.112.191.101:8091 --username Administrator --password password --no-progress-bar Run collect-logs on the backup archive: $ /opt/couchbase/bin/cbbackupmgr collect-logs -a /tmp/entbackup Observation   In the logs directory, we see both backup-0.log, alongside the zipped logs archive: $ ls /tmp/entbackup/logs/ backup-0.log cbbackupmgr-collectinfo-entbackup-2019-07-12T120351.zip If we extract the logs archive, we find a backup-0.log file within that is identical to the backup-0.log we observed at the top level, alongside the backup archive: $ cd /tmp/entbackup/logs/ $ unzip cbbackupmgr-collectinfo-entbackup-2019-07-12T115813.zip $ diff backup-0.log cbbackupmgr-collectinfo-entbackup-2019-07-12T120351/logs/backup-0.log If this is intended then by all means mark this closed. However, my understanding was the log collection was intended to give additional information by extracting the logs with relevant additional metadata and also save space by cleaning up rotating log files and compressing them into a zip file.

          So this seems to be a misunderstanding on what collect-logs is supposed to do. A normal archive looks as follows:

          ├── logs
          │   └── backup-0.log
          └── backup_repository
              ├── 2019-07-11T15_24_01.158858+01_00
               /* ect */ 

          the cbbackupmgr collect-logs command will collect the backup logs located in the log directory as well as some other information to help debbuging and create a zip archive, if no output directory is provided this archive is stored on the logs/ directory by default. But it can be saved to any arbitrary output directory. Collect logs does and should not delete the original logs as those should stay there. I'll close this issue as this is the correct behaviour.

          carlos.gonzalez Carlos Gonzalez Betancort (Inactive) added a comment - So this seems to be a misunderstanding on what collect-logs is supposed to do. A normal archive looks as follows: ├── logs │ └── backup-0.log └── backup_repository ├── 2019-07-11T15_24_01.158858+01_00 /* ect */ the cbbackupmgr collect-logs command will collect the backup logs located in the log directory as well as some other information to help debbuging and create a zip archive, if no output directory is provided this archive is stored on the logs/ directory by default. But it can be saved to any arbitrary output directory. Collect logs does and should not delete the original logs as those should stay there. I'll close this issue as this is the correct behaviour.

          People

            pvarley Patrick Varley
            toby.wilds Toby Wilds
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty