[Csync2] I/O Error 'No such file or directory' while opening data file for writing in rsync-patch

Lars Ellenberg lars.ellenberg at linbit.com
Mon Oct 22 19:55:44 CEST 2007


On Fri, Oct 19, 2007 at 03:50:00PM +0200, Sebastian Albrecht wrote:
> Hello list,
> I am having a problem with one of my csync2 systems. I keep getting this
> error:
> 
> ERROR from peer **HOST**: I/O Error 'No such file or directory' while
> opening data file for writing in rsync-patch: **FILE**
> 
> Where **HOST** is the host of the peer I am trying to sync to
> and **FILE** is the complete file with directory path.
> 
> The problem is the directory of the file does not exist on the peer. So
> if I go to the peer and create the directory, the sync works fine. I was
> under the impression that the sync should create any paths that are
> inside of the include directive (set in the config file) if i use the -r
> option on csync2. Am I missing anything?


situation:
     X			  Y
  a/b/c			a/b/c
       in sync.
			# rm -r a/b
	result:
  a/b/c			a
	for some reason, no sync done  X <- Y,
	which would be expected to remove c from X,
	and also rmdir b from X,
	if empty (no untracked/unsynced files).

  later, modified c on X.

  a/b/c  | c dirty.	a

	trying to sync c from X -> Y.
        (arguably wrong) expectation:
                both b and c would get (re)created.
        but csync2 fails: No such file or directory.

design question:
        should csync2 (try to) create leading path components
        for a certain dirty to-be-synced file?

  yes: "because it makes it work like I want to use it."
  no: how should we deal with existing non-directory objects,
      which happen to "be in the way"?

        anyways, the way csync2 is designed, it does not do this.

        next question would be, how to handle removal of non-empty
        target directories, when you try to sync a tree removal?
        there are more similar things.

        I think, for conflicting changes,
        csync2 should not try to second guess what you could mean.
        It would get it wrong.

        for the design question:
        when csync2 gets it wrong for non-conflicting changes, that
        would be a bug, and worth complaining.
        for _conflicting_ changes, if needs your help.

        admittedly, error messages could probably be better,
        pointing out _how_ you could help.
        also, it could try to make as much progress on "the rest of it",
        and could move more fatal errors to non-fatal errors/warnings.

        but, such things are corner cases.
        at least, they should be.
        otherwiss I'd suggest you are not
        using the right tool for the job :->


Work Around:
        for that specific situation (missing parent directory,
        no non-directory object in the way),
        provided that "a/b" is in fact also tracked by csync2:

        directories get marked dirty only when they are created/removed,
        when they change permissions or ownership. not when they change
        mtime, because that happens on almost every file change whithin.

        so mark it dirty explicitly:
        # csync2 -rvm a/b
        tell it to win (we expect that b and c are "dirty" on Y, too.
        # csync2 -rvf a/b
        and sync it
        # csync2 -urv a/b

        diretory b and all its contents are now marked dirty,
        will be synced, will win on conflicts, and thus be recreated.

solution:
        don't get you into such a situation.
        don't do conflicting changes to directory trees.
        (better yet, don't do conflicting changes at all).
        sync early, sync often.

On Mon, Oct 22, 2007 at 04:57:56PM +0200, Sebastian Albrecht wrote:
> Hallo Lars,
> ich hoffe du kannst mir bei einem Csync2-Problem helfen, da ich auf
> der Mailing-List keine Antwort bekommen und ehrlich gesagt auch nich
> erwarte.
> Mein gewünschter Sync läuft soweit auch ok, das Problem:
> - Ich lösche auf dem remote-host eine Datei und deren Eltern-Verzeichnis
> - Auf dem local-host ist beides noch vorhanden
> - die Datei wird geändert
> - Irgendwann später synche ich vom local-host auf den remote-host ->
> Fehlermeldung
> 
> Beispiel:
> Datei 'file' in /test/1/2/3/file
> auf beiden hosts vorhanden und synchron
> remote-host: rm -r /test/1/2/3
> local: touch /test/1/2/3/file; csync2 -xr /test
> Fehler:
> While syncing file %homedir%/test/1/2/3/file:
> ERROR from peer quadron: I/O Error 'No such file or directory' while
> opening data file for writing in rsync-patch: /test/1/2/3/4/file
> ERROR: Auto-resolving failed. Giving up.
> ERROR from peer quadron: No such file or directory
> Finished with 3 errors.
> 
> Das ärgerliche ist auch, dass csync2 dann auch komplett abbricht und
> nicht wenigstens den Rest weiter syncht.
> Würde mich freuen, Tipps zu bekommen.


-- 
: Lars Ellenberg			    Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH	    Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna/Europe    http://www.linbit.com :


More information about the Csync2 mailing list