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

cbbackup throws an exception and hangs when disk is full

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.0
    • 5.0.0
    • tools
    • Untriaged
    • Unknown

    Description

      Cbbackup does not handle full disk gracefully

      vagrant@node1-cb400-ubuntu12:/tmp$ /opt/couchbase/bin/cbbackup -u Administrator -p password -b travel-sample http://127.0.0.1:8091 /tmp/backup-`date +%Y%m%d-%H%M%S`
      Exception in thread s1:
      Traceback (most recent call last):
        File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
          self.run()
        File "/usr/lib/python2.7/threading.py", line 504, in run
          self.__target(*self.__args, **self.__kwargs)
        File "/opt/couchbase/lib/python/pump_bfd.py", line 627, in run
          rv, db, db_dir = self.create_db(cbb)
        File "/opt/couchbase/lib/python/pump_bfd.py", line 753, in create_db
          rv, dir = self.mkdirs()
        File "/opt/couchbase/lib/python/pump_bfd.py", line 813, in mkdirs
          if error.errno != errno.EEXIST:
      NameError: global name 'errno' is not defined
       
      ## command does not exit after this
      

      The exception here is generated because pump_bfd.py does not import errno and fails at line 813, if it was imported I believe it would have exited correctly with a clear error message

      808
              spec = os.path.normpath(self.spec)
      809
              if not os.path.isdir(spec):
      810
                  try:
      811
                      os.mkdir(spec)
      812
                  except OSError as error:
      813
                      if error.errno != errno.EEXIST:
      814
                          return "error: could not mkdir: %s; exception: %s" % (spec, error.strerror)
      

      Attachments

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

        Activity

          Using flake8 would have protected again this:

          flake8 pump_bfd.py  | grep errno
          pump_bfd.py:813:35: F821 undefined name 'errno'
          

          pvarley Patrick Varley added a comment - Using flake8 would have protected again this: flake8 pump_bfd.py | grep errno pump_bfd.py:813:35: F821 undefined name 'errno'

          Code change is up for review.

          pvarley Patrick Varley added a comment - Code change is up for review.

          Build 4.7.0-1215 contains couchbase-cli commit db91c446dc4cfe9be4863c074be5b321cfa9bdaa with commit message:
          MB-21010 import errno to handle file errors
          https://github.com/couchbase/couchbase-cli/commit/db91c446dc4cfe9be4863c074be5b321cfa9bdaa

          build-team Couchbase Build Team added a comment - Build 4.7.0-1215 contains couchbase-cli commit db91c446dc4cfe9be4863c074be5b321cfa9bdaa with commit message: MB-21010 import errno to handle file errors https://github.com/couchbase/couchbase-cli/commit/db91c446dc4cfe9be4863c074be5b321cfa9bdaa

          Thuan Nguyen please verify and close this bug against spock

          arunkumar Arunkumar Senthilnathan added a comment - Thuan Nguyen please verify and close this bug against spock
          thuan Thuan Nguyen added a comment -

          Verified in build 5.0.0-3450. I could not reproduce it.

          [root@s44015 ~]# /opt/couchbase/bin/cbbackup  couchbase://172.23.121.224:8091 /cbqe3043/backup/ -u Administrator -p password
          2017-08-03 13:25:47,962: s0 error: async operation: error: db error: database or disk is full on sink: /cbqe3043/backup/(default@s44015.sc.couchbase.com:8091)
          error: db error: database or disk is full
          [root@s44015 ~]# 
          

          thuan Thuan Nguyen added a comment - Verified in build 5.0.0-3450. I could not reproduce it. [root@s44015 ~]# /opt/couchbase/bin/cbbackup couchbase://172.23.121.224:8091 /cbqe3043/backup/ -u Administrator -p password 2017-08-03 13:25:47,962: s0 error: async operation: error: db error: database or disk is full on sink: /cbqe3043/backup/(default@s44015.sc.couchbase.com:8091) error: db error: database or disk is full [root@s44015 ~]#

          People

            thuan Thuan Nguyen
            pvarley Patrick Varley
            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