3.0.2: make_bak_dir mkdir ...: File exists (17) - Tools

This is a discussion on 3.0.2: make_bak_dir mkdir ...: File exists (17) - Tools ; Yesterday I upgraded rsync from 2.6.9 to 3.0.2 (as part of upgrading Fedora 8 to Fedora 9). Today, I received these unexpected errors: rsync: make_bak_dir mkdir "/backup/server/../server-before-5/var" failed: File exists (17) rsync: keep_backup failed: "/backup/server/var/lib/rpcbind/rpcbind.file" -> "../server-before-5/var/lib/rpcbind/rpcbind.file": Success (0) rsync: ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: 3.0.2: make_bak_dir mkdir ...: File exists (17)

  1. 3.0.2: make_bak_dir mkdir ...: File exists (17)

    Yesterday I upgraded rsync from 2.6.9 to 3.0.2 (as part of upgrading
    Fedora 8 to Fedora 9). Today, I received these unexpected errors:

    rsync: make_bak_dir mkdir "/backup/server/../server-before-5/var"
    failed: File exists (17)
    rsync: keep_backup failed: "/backup/server/var/lib/rpcbind/rpcbind.file"
    -> "../server-before-5/var/lib/rpcbind/rpcbind.file": Success (0)
    rsync: stat
    "/backup/server/../server-before-5/var/lib/rpcbind/rpcbind.file" failed:
    No such file or directory (2)

    from a script that had worked flawlessly for years under rsync 2.6.x:

    BKPDIR=server-before-`date +%w`
    cd /backup
    rm -rf $BKPDIR
    mkdir -m 700 $BKPDIR
    cd /backup/server
    rsync -avHx --numeric-ids --delete --delete-excluded \
    --backup --backup-dir=../$BKPDIR \
    --exclude-from=/root/bin/backupserver.excludelist \
    root@server:/ .

    Prior to the script being run, these files had been deleted from the
    sender side:

    /var/lib/rpcbind/portmap.file
    /var/lib/rpcbind/rpcbind.file

    along with the /var/lib/rpcbind directory.

    Following the rsync run, the receiver side has:

    /backup/server/var/lib/rpcbind/rpcbind.file
    /backup/server-before-5/var/lib/rpcbind/portmap.file

    i.e., only one of the deleted files was moved to the backup directory.

    Any ideas?

    --
    Jordan Russell
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: 3.0.2: make_bak_dir mkdir ...: File exists (17)

    On Fri, May 16, 2008 at 12:07:47PM -0500, Jordan Russell wrote:
    > rsync: make_bak_dir mkdir "/backup/server/../server-before-5/var" failed: File exists (17)
    > rsync: keep_backup failed: "/backup/server/var/lib/rpcbind/rpcbind.file" -> "../server-before-5/var/lib/rpcbind/rpcbind.file": Success (0)


    I tried to duplicate your failure, but rsync didn't fail for me.

    The above errors indicate that the keep_backup() function tried to
    rename the file into the backup dir, got an ENOENT error (which is the
    only time it tries to call make_bak_dir()) and the attempt to make the
    parent directory of the file failed with an EEXIST error (and then the
    errno got reset to 0 due to the outputting of the error message, a bug
    that I have fixed). Is it possible that the file rpcbind.file caused an
    ETXTBSY errno when rsync tried to rename it? The only way I can see the
    above happening is if the rename() call got ETXTBSY, tried to remove the
    destination file (which didn't exist), and then returned the ENOENT
    error from the unlink() instead of the ETXTBSY error from the rename().
    That would lead to the above deceptive series of messages. I have fixed
    that too.

    Is the backup problem reproducible? If so, please try the latest
    nightly tar file (or git checkout) and see what error you get.

    ...wayne..
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  3. Re: 3.0.2: make_bak_dir mkdir ...: File exists (17)

    Wayne Davison wrote:
    > On Fri, May 16, 2008 at 12:07:47PM -0500, Jordan Russell wrote:
    >> rsync: make_bak_dir mkdir "/backup/server/../server-before-5/var" failed: File exists (17)
    >> rsync: keep_backup failed: "/backup/server/var/lib/rpcbind/rpcbind.file" -> "../server-before-5/var/lib/rpcbind/rpcbind.file": Success (0)

    >
    > I tried to duplicate your failure, but rsync didn't fail for me.


    Thanks for checking. Unfortunately, I haven't been able to either. The
    errors do not re-appear if I manually put "var/lib/rpcbind" back in the
    destination directory and run the script again.

    (By the way, in case it makes any difference: both sides were upgraded
    from 2.6.9 to 3.0.2, so it's using the new "delete-during" default.)

    > The above errors indicate that the keep_backup() function tried to
    > rename the file into the backup dir, got an ENOENT error (which is the
    > only time it tries to call make_bak_dir()) and the attempt to make the
    > parent directory of the file failed with an EEXIST error (and then the
    > errno got reset to 0 due to the outputting of the error message, a bug
    > that I have fixed).


    I'm not sure if you caught this, but the "File exists" error was
    actually returned on the directory two levels up from the file: "var".

    > Is it possible that the file rpcbind.file caused an
    > ETXTBSY errno when rsync tried to rename it?


    Shouldn't be. On the receiving side, rsync is the only program that ever
    touches the files. (And there's never more than one rsync instance
    running at a time; the script is executed once per day from cron.)

    I suspect the ENOENT result in keep_backup() must be correct because the
    verbose output from the rsync run appears to indicate that
    "rpcbind.file" -- the file that generated these errors -- was deleted
    from the directory *first*:

    ....
    deleting var/lib/rpcbind/rpcbind.file
    deleting var/lib/rpcbind/portmap.file
    cannot delete non-empty directory: var/lib/rpcbind
    ....

    If I understand correctly, at that point, "var/lib/rpcbind" could not
    already exist in the backup directory. (There are no references to
    "var/lib/rpcbind" before that in the output.)

    --
    Jordan Russell
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


+ Reply to Thread