Skip to content

After an initial failure, subsequent online backups will not work #6229

Closed
@progier389

Description

@progier389

Issue Description

Several issues related to failing backup tasks:

  • backends stays marked as busy , preventing further backup tasks to complete successfully.
  • Null Pointer Exception if failing to open directory
  • Task exit code is 0

Package Version and Platform:

  • Platform: RHEL
  • Package and version: 389-ds-base-2.2

Steps to Reproduce
I hit the 3 issues with the following python script:

import os
import time
from lib389._constants import PW_DM, DN_DM
from lib389 import DirSrv
from lib389.properties import TASK_WAIT
import tempfile


def test_backup_task_after_failure():
    inst = DirSrv()
    inst.local_simple_allocate('standalone1', binddn=DN_DM, password=PW_DM);
    with tempfile.TemporaryDirectory() as backup_dir:
        inst.open()
        archive_dir1 = f'{backup_dir}/bak1'
        archive_dir1b = f'{backup_dir}/bak1b'
        archive_dir2 = f'{backup_dir}/bak2'
        tasks = inst.tasks
        # Perform a backup
        tasks.db2bak(backup_dir=archive_dir1)
        # Wait until task is completed, trying to rename backup directory
        done,exitCode,warningCode = (False, None, None)
        while not done:
            if os.path.isdir(archive_dir1):
                os.rename(archive_dir1, archive_dir1b)
            done,exitCode,warningCode = tasks.checkTask(tasks.entry)
            time.sleep(0.1)
        print(f'bak1: done,exitCode,warningCode= {done},{exitCode},{warningCode}')
        assert exitCode != 0
        exitCode = tasks.db2bak(backup_dir=archive_dir2, args={TASK_WAIT: True})
        print(f'bak2: exitCode= {exitCode}')
        assert exitCode == 0

test_backup_task_after_failure()

Additional context
Already triaged: https://issues.redhat.com/browse/IDMDS-3967

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions