Created attachment 116065 [details] Screen Shot of config and error windows SUMMARY Unable to save backup file; "Error copying file to device". STEPS TO REPRODUCE 1. Select File>Backup 2. Select destination for backup file (Note: Have tried local desktop as well as Samba share.) 3. Press okay OBSERVED RESULT An error occurs immediately following press of "Ok" button on "Backup - KMyMoney" Window. The error reads "Error copying file to device." EXPECTED RESULT Working file backed up to destination location (Samba NAS) SOFTWARE VERSIONS KMyMoney Version 5.0.80.6b49f80d Windows 10 Pro, Version 10.0.17234 Build 17134 ADDITIONAL INFORMATION
There have been some issues with Samba file shares. From memory, it was related to particular implementation of the Samba server. To avoid that issue for now, let's start with plain text file on the local file system. First, please confirm that you can do a plain File/Save or File/Save as.... If that works, then on then screen prior to the error, have you checked the box about mounting the file system before backing up? Perhaps you can attache a screen shot of that dialog.
Jack, An XML file is in use. If a local device is utilized for the backup point then a backup completes as expected. No errors are encountered, the backup file may be opened and utilized. Despite selecting the "Mount this directory before backing up" dialog, changing the backup location to either a Samba share or a mapped share results in an error. I noticed a related issue; when electing to "Mount this directory before backing up" a dialog that reads "Mounting " with a progress bar appears at the bottom of the screen. The bar never moves off zero. It remains on the screen until KMyMoney is closed. Two screen shots are attached for reference.
Created attachment 116080 [details] Set Backup Path, Mount directory Screen shot of Backup dialog window. Shows Samba path and "Mount directory..." text.
Created attachment 116081 [details] Message: Mounting Drive, Saving File Shows what happens when the "Mount directory..." option is used with a Samba.
Using the mount option on windows does not make sense. We might have to disable it. For now don't mark it. I have duplicated the problem and need to investigate this a bit.
Looks like Thomas and I replied at the same time. As Thomas suggests, be sure the share is already mounted before backing up, and try without ticking the "mount" box. Thomas - there are cases where mounting on Windows does make sense (such as a USB thumb drive, or possibly even a Samba share not normally mounted.) If the KMM code for mounting is known not to work on Windows, then it would make sense to replace the "mount" checkbox with something like "If the target directory is on an external file system, please be sure it is mounted before backing up." or something like that. Do we know whether there is a similar issue on the MacPorts version?
The current KMyMoney code simply executes mount <<path-provided-in-dialog-as-mountpoint>> when the check mark is checked. That will certainly not help on Windows. Performing the backup is done using the 'cp' (unix) and 'copy' (windows) command line utilities. I wonder if it might be more intelligent to rename the current mount-point into destination folder and use some kio slave magic to do the copy job. This code comes a long way from KDE3 (or even KDE2). Using the KDE tools we will be able to even store the file in a cloud (like nextcloud).
There were some related fixes in 4.8 branch. See bug 302945 for details.
I'll keep an eye on this thread and gladly test any changes.
Ralf, per his first post, he's using KMyMoney Version 5.0.80.6b49f80d. (I'm not sure how to designate that in the version dropdown, unless we add entries for git(4.8) and git(5.0). Anyway, given Thomas' comment, it is using copy, not cp. Robert - per several comments, what happens if the Samba share is already mounted, and you do NOT check the "mount" box?
Mapping a share to a windows drive, Y:/ in this case, results in the same error. Note the "Mount directory..." option was left unchecked.
Created attachment 116091 [details] Set Backup Path, Mapped Drive Attempt to save to a mapped drive.
(In reply to Jack from comment #10) Anyway, given Thomas' comment, it is using copy, not cp. I refer to the mentioned mount option for Windows, which is disabled by the following patch https://cgit.kde.org/kmymoney.git/commit/?id=da03f3b25c3a193b6ea0e9c9c08abe406ecdc97e. It looks that this commit is not in 5.0 branch
Robert: Did you choose that directory from the file chooser dialog or type it in? I don't think in needs the leading slash, and the second slash might need to be a backslash. Can you try it without the leading slash, and then with the other slash made a backslash? It might also be worth trying the latest version, since I think Thomas added some debugging output which might provide more information.
Created attachment 116107 [details] Set Backup Path, Local Drive (Desktop) - Using File Picker Set Backup Path, Local Drive (Desktop) - Using File Picker
Jack, I've update to the latest Unstable Nightly build; Version 5.0.80-bda8e4a0 The file name in the screen shot was entered using the file picker. I've tried omitting the first slash and changing the second slash without any change - the error persists. How do I go about securing additional data for the team to review?
(In reply to Thomas Baumgart from comment #7) > The current KMyMoney code simply executes > > mount <<path-provided-in-dialog-as-mountpoint>> > > when the check mark is checked. That will certainly not help on Windows. > > Performing the backup is done using the 'cp' (unix) and 'copy' (windows) > command line utilities. I wonder if it might be more intelligent to rename > the current mount-point into destination folder and use some kio slave magic > to do the copy job. This code comes a long way from KDE3 (or even KDE2). > Using the KDE tools we will be able to even store the file in a cloud (like > nextcloud). yes, this was fixed with bug 384139. The related commit is https://cgit.kde.org/kmymoney.git/commit/?id=9771cfa20fbf2d6bd2e63fea0aefc410d720b870 or look at the related source location at https://cgit.kde.org/kmymoney.git/tree/kmymoney/kmymoney.cpp?h=4.8#n2690
Just that this does not work in KF5 as KIO::NetAccess is deprecated (see https://community.kde.org/Frameworks/Porting_Notes#KIO_Changes for details).
I'm now running Version 5.0.80-cfd484f5. This problem is resolved.
Before we close this as FIXED, can Ralf or Thomas say if there was a KMM commit to fix this, or whether there might have been a change in some other part of KDE?
This could well be. I found a comment (my own) on bug 302945 which points to https://commits.kde.org/kmymoney/be3dfc7d78cda1794a4597abe7f0fa13b5a375bc that could solve as fix. If we have confidence that this is really solved, then we can close this one and bug 302945 and mark them as fixed in 5.0.3. The version that Rob refers to contains this fix.
I'm able to confirm backup is working in Version 5.0.80-cfd484f5.