Menu

#195 File moving failed - file deleted!

v1.0_(example)
closed-fixed
nobody
None
9
2015-01-12
2014-10-17
No

I have been using XFE for many months, perhaps a year, and it has been working fine for me, but yesterday it did a very bad thing.

I was moving two files from within my home directory to a flash drive (NTFS formatted). The first file was about 160 MB and the second one about 700 MB. The first one was moved successfully, but when XFE got to moving the second one, an obscure error message appeared. Unfortunately, I do not quite remember the message. I only remember it was telling me that the file could not be copied because something was temporarily unavailable. I clicked OK, hoping that XFE will retry, provided that the problem was only "temporary", whatever it was. But the moment I clicked OK, the file was gone.

The error message was really exceptional - I had never seen it before, though I have been using Linux, XFE and the very same NTFS formatted flash drive for many months. However, the error message is not the bug I am reporting.

Moving a file onto another filesystem consists of copying and deleting. If the first part (copying) fails, then the second part (deletion) obviously must not be performed, whether the user clicks Cancel or OK. The bug is that XFE deleted the file despite its copying had failed.

As this is a data-loss bug, I dare to assign it the highest priority.

--
XFE version 1.37 (Synaptic declares 1.37-1), OS Linux Mint 17 Xfce 64-bit

Discussion

  • Roland Baudin

    Roland Baudin - 2014-10-18

    Strange! I never seen such a problem for ten years of Xfe...
    Of course, Xfe uses the first copy, then delete method to move a file. To fix the bug, I must understand what the cause of the failed copy. Do you have any idea?
    RB

     
  • Jan Lachnitt

    Jan Lachnitt - 2014-10-21

    I am sorry, I can remember no more than I have already written and there is no relevant record in kern.log and syslog from that time. Does XFE have a log?

    To rephrase what I have written in my report, the error message looked like this: "The file could not be copied because ??? is temporarily unavailable." (I can't remember what was temporarily unavailable, hence the "???".)

     
  • Jan Lachnitt

    Jan Lachnitt - 2014-12-25

    Hi Roland and Merry Christmas to you :-)
    The strange error appeared again when I tried to move some files. (This time it was on another computer with the same OS.) I have taken a screenshot but I doubt it would be helpful for you as the message is in Czech. Here is my translation: "Cannot copy file ...: The resource is temporarily unavailable" (the "..." stand for the file name; the last word may as well be "inaccessible").
    Obviously, this time I clicked Cancel, so nothing happened. Then I figured out that the true reason why it could not be copied or moved was insufficient rights - some of the files or folders were owned by root.
    Are these information helpful? I can do some testing if you wish.

     
  • Roland Baudin

    Roland Baudin - 2014-12-26

    Hi Jan,
    this is interesting but I need more information. Does the error only happen when moving files between different file systems? Does it happen when moving a single file or several? The files owned by root are the source files or the target files?
    The best for me would a complete, reproductible, test case...
    Merry Christmas to you and your family,
    RB

     
  • Roland Baudin

    Roland Baudin - 2014-12-27

    No idea about reproducing the bug?

     
  • Jan Lachnitt

    Jan Lachnitt - 2014-12-28

    Got it! The bug is very well reproducible:

    1. Open a terminal in a directory where you have write permission (e.g. your home directory).

    2. Perform these commands successively:
      su
      echo "root's file" > test.txt
      chmod g=,o= test.txt
      exit

    3. In Xfe, check that there is a file "test.txt" with these owner, group and permissions: root root -rw------- .

    4. Using Xfe (not as root), try to move the file onto another file system (e.g. an external drive), where you also have write permission.
      FIRST BUG HERE: Xfe displays a misleading error message, "resource temporarily unavailable" instead of "insufficient rights".

    5. Click OK.
      SECOND BUG HERE: The file is deleted, although it has not been copied!

    Notes:

    • Moving within a file system does not reproduce the issue as Xfe does not need to read the file in order to move it.

    • Xfe can delete the file as long as it has write permission in the directory, even if it has no permission for the file itself (somewhat surprising for me).

     
  • Roland Baudin

    Roland Baudin - 2014-12-29

    OK, I've reproduced the bug using your instructions.
    Now, I can fix it. Thanks a lot!
    I'm working on a new version of Xfe, so it's important for me to fix this nasty bug...
    RB

     
  • Roland Baudin

    Roland Baudin - 2014-12-30

    OK, I got it... It was a regression due to some changes between versions 1.35 and 1.37.
    The fix will be in the next release, to appear very soon!
    Thanks again,
    RB

     
  • Jan Lachnitt

    Jan Lachnitt - 2014-12-30

    Glad to hear that and thank you, too.

     
  • Roland Baudin

    Roland Baudin - 2015-01-12
    • status: open --> closed-fixed
     
  • Roland Baudin

    Roland Baudin - 2015-01-12

    This is fixed in Xfe 1.40.
    Thanks for the bug report.
    RB

     

Log in to post a comment.

Auth0 Logo