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

[CBM] Panic on restore if we can't open or create the stats folder

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Critical
    • 7.1.0
    • 6.6.0, 6.6.1, 6.6.2, 6.6.3, 6.6.4, 6.6.5
    • tools
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      What is the problem
      https://github.com/couchbase/backup/blob/cheshire-cat/cmd/cbbackupmgr/restore.go#L328

      	stat, err := startStatCollector(a, "restore", ctx.repository)
      	if err != nil {
      		clog.Warnf("(Stats) Could not start stat collection: %v", err)
      	}
      	defer stat.Stop() //nolint:errcheck
      

      We create a stats collector and check the error which is correct. startStatCollector returns a nil StatCollector if there's an error, which means our call to Stop panics with a nil deref.

      What is the fix
      Whenever we call stat.Stop we should do a nil check.

      Attachments

        Issue Links

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

          Activity

            People

              Matt.Hall Matt Hall
              Matt.Hall Matt Hall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty