svn relocate fails due to bad char at end of url_uuid->uuid

View: New views
4 Messages — Rating Filter:   Alert me  

svn relocate fails due to bad char at end of url_uuid->uuid

by John McNelly :: Rate this Message:

| View Threaded | Show Only this Message

I am using SVN 1.4.5.25188 (client and server).  I have mirrored a  
repository, being sure to set the UUIDs to match.  In order, I:

        svnadmin create {mirror}
        {install hooks to discourage user checkins to mirror}
        svnadmin load --force-uuid {mirror}
        svnsync init {mirror} {original}
        svnsync synchronize {mirror}
        svnadmin verify {mirror}

Then I set up the mirror with svnserve, went to another machine, and  
tried to switch my trunk from the master repository to the mirror.

But no matter what I try, "svn switch --relocate" gives me an error:

-------
C:\chrystal\trunk>c:\svn-win32-1.4.5\bin\svn.exe switch --relocate  
svn://delmar/trunk svn://elvis/trunk
'vn: The repository at 'svn://elvis' has uuid  
'd75c9f23-f8df-ea4e-b07c-7fd4dbb7d0ff', but the WC has  
'd75c9f23-f8df-ea4e-b07c-7fd4dbb7d0ff
-------

To digress, there's a formatting issue with the error message, both  
the first and last character are wrong:
- first char should be "s" not "'"
- last char should be "'"
But BoundsChecker doesn't report any memory smashes, so I guess it's cosmetic.

The main point is that the error message shows the UUIDs are the same.

So I downloaded the symbols/etc, and set a breakpoint at  
libsvn_client\relocate.c (lines 104-108):

   /* Make sure the UUIDs match. */
   if (uuid && strcmp(uuid, url_uuid->uuid) != 0)
     return svn_error_createf
       (SVN_ERR_CLIENT_INVALID_RELOCATION, NULL,
        _("The repository at '%s' has uuid '%s', but the WC has '%s'"),
        url, uuid, url_uuid->uuid);

The debugger says that uuid and url_uuid->uuid are the same, except  
that url_uuid->uuid has a trailing 0x0d (line ending).  See attached  
JPG.

Working backwards:
        url_uuid->uuid comes from ra_uuid (relocate.c line 93)
        ra_uuid comes from svn_ra_get_uuid (relocate.c line 93)
        at which point I got a symbols issue and stopped

Is this a known issue?

I was not sure where to post the screen grab of the debugger session,  
so it is on:

        http://mcnelly.org/svn/svn-relocate.jpg
        http://mcnelly.org/svn/svn-relocate.txt

Give me the OK and I'll file an issue.

Thanks,
/ John (mcnelly.org)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: svn relocate fails due to bad char at end of url_uuid->uuid

by David Glasser-4 :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 9, 2007 1:32 PM, John McNelly <john@...> wrote:

> I am using SVN 1.4.5.25188 (client and server).  I have mirrored a
> repository, being sure to set the UUIDs to match.  In order, I:
>
>         svnadmin create {mirror}
>         {install hooks to discourage user checkins to mirror}
>         svnadmin load --force-uuid {mirror}
>         svnsync init {mirror} {original}
>         svnsync synchronize {mirror}
>         svnadmin verify {mirror}
>
> Then I set up the mirror with svnserve, went to another machine, and
> tried to switch my trunk from the master repository to the mirror.
>
> But no matter what I try, "svn switch --relocate" gives me an error:
>
> -------
> C:\chrystal\trunk>c:\svn-win32-1.4.5\bin\svn.exe switch --relocate
> svn://delmar/trunk svn://elvis/trunk
> 'vn: The repository at 'svn://elvis' has uuid
> 'd75c9f23-f8df-ea4e-b07c-7fd4dbb7d0ff', but the WC has
> 'd75c9f23-f8df-ea4e-b07c-7fd4dbb7d0ff
> -------
>
> To digress, there's a formatting issue with the error message, both
> the first and last character are wrong:
> - first char should be "s" not "'"
> - last char should be "'"
> But BoundsChecker doesn't report any memory smashes, so I guess it's cosmetic.
>
> The main point is that the error message shows the UUIDs are the same.
>
> So I downloaded the symbols/etc, and set a breakpoint at
> libsvn_client\relocate.c (lines 104-108):
>
>    /* Make sure the UUIDs match. */
>    if (uuid && strcmp(uuid, url_uuid->uuid) != 0)
>      return svn_error_createf
>        (SVN_ERR_CLIENT_INVALID_RELOCATION, NULL,
>         _("The repository at '%s' has uuid '%s', but the WC has '%s'"),
>         url, uuid, url_uuid->uuid);
>
> The debugger says that uuid and url_uuid->uuid are the same, except
> that url_uuid->uuid has a trailing 0x0d (line ending).  See attached
> JPG.
>
> Working backwards:
>         url_uuid->uuid comes from ra_uuid (relocate.c line 93)
>         ra_uuid comes from svn_ra_get_uuid (relocate.c line 93)
>         at which point I got a symbols issue and stopped
>
> Is this a known issue?

Well, there's a known issues (fixed on trunk but not backported to
1.4.x; should we?) that the error message is wrong: the UUIDs are
backwards.  The one reported as the server's is actually the wc's and
vice versa.  So contrary to what the message looks like, what's going
on is that the *server*'s UUID is being sent with a spurious 0x0d.

Hmm.  Which of the above operations were done on Windows and which on Unix?

I'm suspecting maybe this is a bug in svnadmin load --force-uuid in
some cross-platformy setup...

--dave

--
David Glasser | glasser@... | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: svn relocate fails due to bad char at end of url_uuid->uuid

by John McNelly :: Rate this Message:

| View Threaded | Show Only this Message

Quoting David Glasser <glasser@...>:

> I'm suspecting maybe this is a bug in svnadmin
> load --force-uuid in some cross-platformy setup...

Thank you thank you thank you.

The error happens when the "load --force-uuid" dumpfile has CR/LF line  
endings.

All machines involved are Windows, and all are up to date with SPs/etc:
     Master - Win2K
     Mirror - XP
     Client - XP

Here's how to turn the error on and off:

To Get The Error
----------------
Use TextPad to create a UUID.txt containing the data:

     SVN-fs-dump-format-version: 2

     UUID: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn

Save the file in PC/ANSI format (The "PC" part means CR/LF line  
endings). Run the command:

     type UUID.txt | svnadmin load --force-uuid {mirrorPath}

Go to another machine, try to relocate from the master to the mirror,  
and you will get the error.

To Not Get The Error
--------------------
Return to the mirror machine.

Resave the same UUID.txt file as UNIX/ANSI format (LF line endings),  
and rerun the --force-uuid command.

The relocate command will now work successfully.

Summary
-------
It looks like the issue is not with the Windows command shell "type"  
command, but whether the dumpfile uses LF or CR/LF line endings.

Not being a SVN developer, I have no idea whether this qualifies as a  
bug, and what the ramifications are of changing the code to tolerate  
CR/LF line endings in dumpfiles.

If you choose not to support CR/LFs, perhaps the doc (at  
http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html#svn.reposadmin.maint.replication) should note that if dumpfiles created manually should be saved in UNIX  
format.

Sorry if this should have been sent to users, it seemed like a  
clear-cut bug to me.  Let me know if I should open an issue.

/ John (mcnelly.org)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: svn relocate fails due to bad char at end of url_uuid->uuid

by David Glasser-4 :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 13, 2007 9:34 AM, John McNelly <john@...> wrote:

> It looks like the issue is not with the Windows command shell "type"
> command, but whether the dumpfile uses LF or CR/LF line endings.
>
> Not being a SVN developer, I have no idea whether this qualifies as a
> bug, and what the ramifications are of changing the code to tolerate
> CR/LF line endings in dumpfiles.
>
> If you choose not to support CR/LFs, perhaps the doc (at
> http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html#svn.reposadmin.maint.replication) should note that if dumpfiles created manually should be saved in UNIX
> format.

See the big red warning box at:

http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate

The dumpfile format is a binary format, not a text format.  Changing
newlines in it is no better than randomly adding CR characters to a
compiled program file.

--dave

--
David Glasser | glasser@... | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...