Uploaded image for project: 'Percona Backup for MongoDB'
  1. Percona Backup for MongoDB
  2. PBM-943

Pbm status fails for filesystem storage

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 1.7.0
    • 2.0.0
    • None
    • None
    • Yes
    • Yes

    Description

      Hi,

      If storage is set to filesystem, pbm status fails with error.

      pbm statusĀ 
      Error: get status of backups: get PITR chunks: get chunks list: walking the path: open /tmp/local_backups/pbmPitr: permission denied 
      

      It's caused by the fact that directory permissions were stricten, so now pbm cli (which usually runs under some random user) doesn't have access to directory.

      commit 7f094e2e48d0ad804e5f76593737c200db1f8a67
      diff --git a/pbm/storage/fs/fs.go b/pbm/storage/fs/fs.go
      index f8df5a81..1ed138be 100644
      --- a/pbm/storage/fs/fs.go
      +++ b/pbm/storage/fs/fs.go
      @@ -40 +40 @@ func (fs *FS) Save(name string, data io.Reader, _ int) error {
      -       err := os.MkdirAll(path.Dir(filepath), os.ModeDir|0775)
      +       err := os.MkdirAll(path.Dir(filepath), os.ModeDir|0700)
      @@ -49 +49,2 @@ func (fs *FS) Save(name string, data io.Reader, _ int) error {
      -       err = os.Chmod(filepath, 0664)
      +       defer fw.Close()
      +       err = os.Chmod(filepath, 0600)
      

      Attachments

        Activity

          People

            andrew.pogrebnoi Andrew Pogrebnoi
            sandra.romanchenko Sandra Romanchenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist