Skip to content

Migration module doesn't corectly delete old backup #30

@TobiPeterG

Description

@TobiPeterG

Describe the bug
The installer asks when a backup exists whether it should be reused or not. When no is selected, the mig directory is tried to be emptied. However, since the bluetooth subdirectory can contain folders, it fails, since rm is called without -r. This leads to the rmdir command to fail and on every tik run it will detect the uncleaned directory and thinks a backup exists.

Is there a reason /var/lib/tik/mig isn't just removed with rm -r in one cleanup command and created when a backup is actually requested (instead of at the top of the mig module)?

To Reproduce
Steps to reproduce the behavior:

  1. Make backup of existing install
  2. restart tik, it will ask if you want to reuse the backup, select no
  3. restart tk, it will ask you again

Expected behavior
Tik doesn't ask me again if I want to reuse the backup that I just deleted

tik log
I guess this is the relevant part:

rm: cannot remove '/var/lib/tik/mig/bluetooth/*': No such file or directory
[/usr/lib/tik/modules/pre/20-mig][20251218-19:47:09][LOG] [pkexec][1] /usr/bin/rm /var/lib/tik/mig/bluetooth/*
rmdir: failed to remove '/var/lib/tik/mig/bluetooth': Directory not empty
[/usr/lib/tik/modules/pre/20-mig][20251218-19:47:09][LOG] [pkexec][1] /usr/bin/rmdir /var/lib/tik/mig/bluetooth

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions