#44 Linux Error - Can't Rename File For (temp) Backup

None
open
None
5
2014-06-11
2014-06-07
Anonymous
No

Using FAR-1.7 on Linux (Gentoo) with java-7u60, I get the following error message when doing a replace:

16:15 ERROR net.pandoragames.far.ui.UIBean: java.io.IOException: Could not rename <file name omitted> to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.
java.io.IOException: Could not rename <file name omitted> to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.

The file has not been locked or opened by another process.

What could be the problem?

Discussion

  • Olivier Wehner
    Olivier Wehner
    2014-06-09

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     Using FAR-1.7 on Linux (Gentoo) with java-7u60, I get the following error message when doing a replace:
    
    -16:15 ERROR net.pandoragames.far.ui.UIBean: java.io.IOException: Could not rename <file name omitted> to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.
    -java.io.IOException: Could not rename <file name omitted> to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.
    +16:15 ERROR net.pandoragames.far.ui.UIBean: java.io.IOException: Could not rename &lt;file name omitted&gt; to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.
    +java.io.IOException: Could not rename &lt;file name omitted&gt; to /tmp/FAR4614645576497030624.bkp for (temporary) backup. Another process may have locked the file.
    
     The file has not been locked or opened by another process.
    
    • assigned_to: Olivier Wehner
    • Group: -->
     

  • Anonymous
    2014-06-10

    Yes, all the files I have attempted to perform a "replace" operation have failed in this manner.

    To test, I created a directory in the root diectrory and gave it all possible permissions. I then copied several files into this directory and gave each file all possible permissions. This would mean that all processes can access these files in any way, and since they are new files they cannot be locked. The /tmp directory also has all possible permissions set. But when I attempt to perform a "replace" operation, all the files fail in the same way:

    23:54 ERROR net.pandoragames.far.ui.UIBean: java.io.IOException: Could not rename /test/test01.txt to /tmp/FAR2132205050392236722.bkp for (temporary) backup. Another process may have locked the file.
    java.io.IOException: Could not rename /tester/.config-310 to /tmp/FAR2132205050392236722.bkp for (temporary) backup. Another process may have locked the file.
    at net.pandoragames.far.FileMatcher.apply(Unknown Source)
    at net.pandoragames.far.ui.UIBean.replace(Unknown Source)
    at net.pandoragames.far.ui.swing.component.listener.CommandReplace$ReplaceCommand.run(Unknown Source)

    Hopefully other Linux users will provide additional reports. Maybe the fault is some peculiarity of my system alone.

     
  • Olivier Wehner
    Olivier Wehner
    2014-06-10

    Absolutely mysterious. I frequently use FAR on Linux myself but never encountered anything like this, nor was it ever reported.

    So all I can tell you is, that the next release will completely change this code section, and there is a good chance that it will then work on your machine. Unfortunately that release will take another month or two to get ready.

    If you ever find out what it is (JDK bug? But not in 7u60! Not really...) please be so kind to post the result for the generations after us.

    I am really sorry I can not help you any further.

    Olivier

     

  • Anonymous
    2014-06-11

    I've done some more testing and it now works -- to some degree.

    The crucial difference is the setting for "Create Backup" in the FAR/Settings menu.

    If "Create Backup" is unchecked, the replace operation completes without error, and no backup files are created. However, if "Create Backup" is checked, then the replace operation fails with the aforementioned error, but the backup files are still created.

    My guess is that, with "Create Backup" checked, FAR is attempting to create two files in the same backup directory: a regular backup and a temporary backup. Somehow this causes a lock-up condition of some kind.

    That's just a guess based on incomplete knowledge.

    Whatever the cause, I can get FAR working by leaving "Create Backup" unchecked.

    Thanks for your attention.

     
  • Olivier Wehner
    Olivier Wehner
    2014-06-11

    Hi,

    thank you for hanging on. Your observation is very interesting, since FAR does create backup files in both cases, but in different ways (and deleting the backup file after a successfull replace if "create backup" is checked).

    If "create backup" is checked, it uses the relative path name of the original file (relative to the base directory).
    If "create backup" is not checked, it uses a random file name and puts the file directly into the backup directory.

    Now rereading your original post, it looks as if the "create backup" flag was twistet, since it should create /tmp/FAR2132205050392236722.bkp type of backup files only if "create backup" is NOT set.

    The other way of creating backups could fail if the process is not allowed to create subdirectories in the backup directory. But you said all permissions are set and backup files are indeed created. This again is strange, because with the error you get there should not be any backup file! FAR checks if a file with the desired name exists in the backup directory and removes it before it carries out the (failing) rename operation.

    Could you please check the file attributes (rights) of the backup files? Could it be that the backup files created by the process can not be altered by the same process? Or that the process is not allowed to create directories in the backupd directory? Both not very likely for /temp I know.

    Best regards,

    Olivier

     

  • Anonymous
    2014-06-11

    Unfortunately, I am now getting inconsistent results.

    To make it easier for me to follow the creation of the various backup files, I am changing the backup directory and the base directory. (I notice that the backup directory can't be a parent or sub-directory of the base directory.) Each time I make a change I get a different result, Now I have the backup directory set to /tmp/far (with full permissions) and now the replace operation fails with "Create Backup" both checked and unchecked. When my backup directory was set to /opt/far, which is also the installation directory, the error would happen only with "Create Backup" unchecked.

    I did not think this would happen but somehow shifting the backup or base diectories seems to cause more problems.

    I believe that the best solution for me at this time is to wait for the next update of FAR. Hopefully this will fix the problem. I do not understand the operation of FAR enough to make kind of exhaustive testing.

    If you have no problems with Linux, then the issue may be some peculiarity of my system since my system is Gentoo and it is heavily customized.

     


Anonymous


Cancel   Add attachments