Bug 453919 - Backup folder not created for external disk plans
Summary: Backup folder not created for external disk plans
Status: RESOLVED FIXED
Alias: None
Product: kup
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Simon Persson
URL:
Keywords:
: 468269 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-05-17 02:08 UTC by Miguel Guthridge
Modified: 2023-04-10 18:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Guthridge 2022-05-17 02:08:25 UTC
SUMMARY
I recently set up my system to back up to an external drive, but nothing I do appears to actually trigger the backup.

STEPS TO REPRODUCE
1. Go to System Settings -> Backup
2. Create a backup to an external drive.
3. When prompted with a notification, choose to back up now. Nothing happens.
4. Use the backup menu in the system tray to backup now. Nothing happens.
5. In the same menu, choose to browse the backup files. Nothing happens.
6. In the same menu, reload the backup plans, and observe that you are prompted to create your first backup again. Choose yes again. Nothing happens.

OBSERVED RESULT
Nothing happens when I choose to create my first backup from the notification.
Nothing happens when I choose to back up now from the system tray menu.
Nothing happens when I choose to view the backup files - no windows open.
When I reload the backup plans, I am prompted to create a backup again.
Restarting my PC does nothing.
Reconnecting the backup drive does nothing.
Checking the expected location of the backup, I see nothing in the file manager. The backup folder is never created.

EXPECTED RESULT
Backup works seamlessly without me needing to do anything.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Comment 1 Simon Persson 2022-05-17 13:39:14 UTC
Is it possible that you had bup or rsync installed when you enabled backups? Then when making and running the backup plan you no longer have it on your computer? Just an idea to maybe explain what happened.
Comment 2 Miguel Guthridge 2022-05-17 13:42:48 UTC
(In reply to Simon Persson from comment #1)
> Is it possible that you had bup or rsync installed when you enabled backups?
> Then when making and running the backup plan you no longer have it on your
> computer? Just an idea to maybe explain what happened.

To clarify, backups never worked, so there was about 2 minutes between me enabling them and me realising they weren't working.

I have rsync installed, as I use it for a few other things, but I don't think bup has ever been installed. Should I install it?

If the issue is due to missing dependencies, I think the error could be handled in a much more logical manner (telling me it couldn't find the tools, for example) which would be far easier to resolve.
Comment 3 Christian Hartmann 2022-05-18 13:25:30 UTC
same thing here ...

had to manually 'init' bup(1) with:

$ bup --bup-dir=<the-directory-to-backup-files-to> init

assuming an external disk device named 'EXTERNAL',
the command template above would result to:

$ bup --bup-dir="/media/$USER/EXTERNAL/Backups" init

(tested on Neon und Kubuntu 22.04)
Comment 4 Christian Hartmann 2022-05-18 15:58:16 UTC
after initing it manualy .. the log file (~/.cache/kup/...) says:

bup "-d" "/media/christian/MyBook/Datensicherungen" "init"
bup "-d" "/media/christian/MyBook/Datensicherungen" "index" "-u" "/home/christian/Arbeit"
Comment 5 Miguel Guthridge 2022-05-19 10:19:06 UTC
(In reply to Christian Hartmann from comment #3)
> same thing here ...
> 
> had to manually 'init' bup(1) with:
> 
> $ bup --bup-dir=<the-directory-to-backup-files-to> init
> 
> assuming an external disk device named 'EXTERNAL',
> the command template above would result to:
> 
> $ bup --bup-dir="/media/$USER/EXTERNAL/Backups" init
> 
> (tested on Neon und Kubuntu 22.04)

This worked for me as well, thanks.

I suppose that some error checking needs to be run to make sure that
a) bup and rsync are installed
b) the backup repository has been initialised

Seems like a fix that I might be able to do... I'll have a glance through the code later
Comment 6 HD 2022-10-29 18:17:36 UTC
I had the same issue with kup-backup. Configured using version backup after installing bup, selected  external drive destination. I went through almost same procedures as OP did to activate the backup but nothing happened. My search landed me here. 

When I configured the destination it automatically selected "Backups" folder. I assumed that the service created or would create the destination folder when activated, so I left at that.

I found that destination folder was not created so I went ahead and did so manually, then ran backup and It worked. 

Don't know if that is the case for all of you. But try it, if you relied on the destination folder being created automatically.

For the developers, you may want to incorporate the automatic creation of the destination folder "Backups".
Comment 7 Simon Persson 2022-11-06 03:52:41 UTC
Had some time to look at this one now. I think the problem could be line 111 of edexecutor.cpp. 

https://invent.kde.org/system/kup/-/blob/master/daemon/edexecutor.cpp#L111

That should be mkpath instead of mkdir.

I don't have a computer to test it on, would appreciate of someone could try to make that change, test and report.
Comment 8 al F 2022-12-13 16:02:03 UTC
(In reply to HD from comment #6)
> When I configured the destination it automatically selected "Backups"
> folder. I assumed that the service created or would create the destination
> folder when activated, so I left at that.
> 
> I found that destination folder was not created so I went ahead and did so
> manually, then ran backup and It worked. 
> 
> Don't know if that is the case for all of you. But try it, if you relied on
> the destination folder being created automatically.
> 
> For the developers, you may want to incorporate the automatic creation of
> the destination folder "Backups".

I can confirm that unless you set the backup directory by opening the folder selection dialog, no backup will be created. No error message, just a silent exit with no result.
Comment 9 Simon Persson 2023-02-22 22:03:27 UTC
Git commit e78e02a49bce15fa8cc81070da0ba1b42e01d119 by Simon Persson.
Committed on 22/02/2023 at 22:02.
Pushed by persson into branch 'master'.

Create multiple levels of directories for backup destination

For external disk executor, user can specify a path to use on the
destination storage volume. This change makes destination directory
creation work also for paths more than 1 level deep.

M  +1    -1    daemon/edexecutor.cpp

https://invent.kde.org/system/kup/commit/e78e02a49bce15fa8cc81070da0ba1b42e01d119
Comment 10 Simon Persson 2023-02-22 22:26:09 UTC
I have tried reproducing this bug but failed, the destination folder always gets created for me. Except if you set a destination path like "Backu/ps" (more than one directory that needs to be created). That has now been fixed.
For any of the people reporting this bug, please try to provide more details. I don't really know what details to be honest, I have no good idea what could be happening. 
All reporters say that you needed to create the folder yourself and then saving backups started working (except some user that also needed to run bup init). Has anybody tried deleting the folder after a backup was saved there? Does kup go back to not doing anything again? (It should still work, and does still work when I tested)
Comment 11 Bug Janitor Service 2023-03-09 03:45:33 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Christian Hartmann 2023-03-09 14:26:45 UTC
(In reply to Simon Persson from comment #10)
> Has anybody tried deleting the folder after a backup was saved there?
> Does kup go back to not doing anything again? (It should still work, and
> does still work when I tested)

i tried this...

1. i moved (actualy just renamed) the used beforehand directory (on my external disk).
2. checked kup config via system settings - all unchanged
3. tried to create backup via system tray symbol (with a so configured but currently no existing directory)
4. nothing happened / quite exit

5. renamed the renamed folder to its original name
6. tried to create backup via system tray symbol (with the so configured and now existing again directory)
7. backup is created ...

if it is helpful i can supply screenshots all of that
Comment 13 Simon Persson 2023-03-10 22:53:58 UTC
(In reply to Christian Hartmann from comment #12)
> (In reply to Simon Persson from comment #10)
> > Has anybody tried deleting the folder after a backup was saved there?
> > Does kup go back to not doing anything again? (It should still work, and
> > does still work when I tested)
> 
> i tried this...
> 
> 1. i moved (actualy just renamed) the used beforehand directory (on my
> external disk).
> 2. checked kup config via system settings - all unchanged
> 3. tried to create backup via system tray symbol (with a so configured but
> currently no existing directory)
> 4. nothing happened / quite exit
> 
> 5. renamed the renamed folder to its original name
> 6. tried to create backup via system tray symbol (with the so configured and
> now existing again directory)
> 7. backup is created ...
> 
> if it is helpful i can supply screenshots all of that

Thank you, Christian, for trying!

I see now that I actually made a fix for this problem almost two years ago and had completely forgotten about that. So I was of course testing with the latest version and could not see any problem. So sorry for my confusion here! At least, good thing that I have an explanation. So.... Already fixed, will be solved for users once I find the time to make a new release. Thanks again to all who reported and commented!
Comment 14 Simon Persson 2023-04-10 18:51:27 UTC
*** Bug 468269 has been marked as a duplicate of this bug. ***