Re: SSL Error

2010-12-18 Thread Nick
On Fri, 2010-12-17 at 11:03 -0500, r...@elilabs.com wrote:
> Thanks for this problem description and resolution.  I was using an
> older
> version of TSVN and was asked (told) to upgrade to the latest.  Now I
> can't even log into the server.  From the description below, I think I
> have the same problem.  :-(

There's an ongoing thread about this issue on the TSVN mailing list
which contains more info and a workaround.  The latest of the thread is
here:
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2691649


Nick




Re: svn: database disk image is malformed

2010-12-18 Thread Daniel Shahaf
CC += dev@

Stefan Sperling wrote on Thu, Dec 16, 2010 at 18:49:22 +0100:
> On Thu, Dec 16, 2010 at 05:03:00PM +0100, Rainer Dorsch wrote:
> > I try to commit the change
> > 
> > $ svn commit -m "minor change"
> > SendingREADME
> > Transmitting file data .svn: Commit failed (details follow):
> > svn: database disk image is malformed
> > svn: database disk image is malformed
> > $ 
> > 
> > And get an error back.
...
> > I found several posts discussing the 
> > 
> > svn: database disk image is malformed
> > 
> > issue. The best solution is saw is to dump the repository and create a new 
> > one 
> > from the dump.
> >
> > Is there an easier way to fix the problem in a robust manner? Does maybe 
> > even 
> > svn provide some fix scripts?
> 
> This error message is coming from sqlite, not from Subversion.
> You probably have a broken sqlite database in the repository.
> 
> The only place I can think of where sqlite is used in FSFS is
> the rep-cache.db file.

[ For future archeologists, format-5 fsfs repositories (which will
created by Subversion 1.7) will also use sqlite for the revprops.db
file. ]

> Have you got rep-sharing enabled on the repository?
> See the file repos/db/fsfs.conf.
> 
> You can safely disable rep-sharing. Maybe this will get rid of the error.
> If it does, try to recover the rep-sharing.db using sqlite (though I
> don't know how you could do that). If you cannot recover rep-cache.db,
> move it out of the way and Subversion will create a new rep-cache.db
> sqlite database. But it will be empty.
> 
> Representation sharing is not required for a commit to succeed.
> This would explain why you see a successful commit in spite of the error.
> 

How about the second hunk of this patch then?

I haven't compiled it, and it abuses error codes (to use the
specific error code that clients recognize), but is the idea sound?

[[[
Index: subversion/libsvn_fs_fs/fs_fs.c
===
--- subversion/libsvn_fs_fs/fs_fs.c (revision 1044834)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -5426,9 +5426,20 @@ rep_write_contents_close(void *baton)
   /* Check and see if we already have a representation somewhere that's
  identical to the one we just wrote out. */
   if (ffd->rep_sharing_allowed)
-/* ### TODO: ignore errors opening the DB (issue #3506) * */
-SVN_ERR(svn_fs_fs__get_rep_reference(&old_rep, b->fs, rep->sha1_checksum,
- b->parent_pool));
+{
+  svn_error_t *err;
+  err = svn_fs_fs__get_rep_reference(&old_rep, b->fs, rep->sha1_checksum,
+ b->parent_pool);
+  if (err)
+{
+  /* Something's wrong with the rep-sharing index.  We can continue 
+ without rep-sharing, but warn.
+   */
+  (fs->warning)(fs->warning_baton, err);
+  svn_error_clear(err);
+  old_rep = NULL;
+}
+}
   else
 old_rep = NULL;
 
@@ -6377,12 +6388,22 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_p,
  SVN_ERR(svn_fs_fs__with_write_lock(fs, commit_body, &cb, pool));
 
   if (ffd->rep_sharing_allowed)
 {
-  /* ### TODO: ignore errors opening the DB (issue #3506) * */
-  SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
-  SVN_ERR(svn_sqlite__with_transaction(ffd->rep_cache_db,
+  svn_error_t *err = SVN_NO_ERROR;
+
+  if (! err)
+err = svn_fs_fs__open_rep_cache(fs, pool);
+
+  if (! err)
+err = svn_sqlite__with_transaction(ffd->rep_cache_db,
commit_sqlite_txn_callback,
-   &cb, pool));
+   &cb, pool);
+
+  if (err)
+/* The opposite of svn_error_quick_wrap(): same error message,
+   different error code. */
+return svn_error_create(SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED, err,
+/* TODO: svn_error_best_message() */ 
(err)->message);
 }
 
   return SVN_NO_ERROR;
]]]

> Stefan


Re: svnsync fails to connect to mirror repository but exits with code 0

2010-12-18 Thread Daniel Shahaf
Alain wrote on Thu, Dec 16, 2010 at 17:04:24 +0800:
> Hello there,
> Has anyone encountered such a scenario with svnsync, version 1.6.1 (r37116)
> on WinXP?
> 
> svnsync fails to connect to the mirror repository but it still exits with
> code 0.
> 
> Here is the test script (sensitive info has been edited) that I ran:
> 
> svnsync synchronize http://mymirror/svn/myrepo --non-interactive
> --username= --password=
> echo exitcode %ERRORLEVEL%
> 
> And this was the output:
> svnsync: OPTIONS of 'http://mymirror/svn/myrepo': could not connect to
> server (http://mymirror)
> exitcode 0
> 

I can't reproduce this with trunk:

daniel3,3:/tmp/svn% $svnsync sync file://$PWD/r2
svnsync: Unable to connect to a repository at URL 'http://localhost:8081/t/r1'
svnsync: Error running context: Connection refused
zsh: exit 1 $svnsync sync file://$PWD/r2

daniel3,3:/tmp/svn% $svnsync sync file://$PWD/r2 --config-option 
servers:global:http-library=neon
svnsync: Unable to connect to a repository at URL 'http://localhost:8081/t/r1'
svnsync: OPTIONS of 'http://localhost:8081/t/r1': could not connect to server 
(http://localhost:8081)
zsh: exit 1 $svnsync sync file://$PWD/r2 --config-option 
servers:global:http-library=neon

> 
> I intended to craft some error message if svnsync fails (i.e. based on a
> non-zero ERRORLEVEL) for whatever reason but the ERRORLEVEL value of zero
> poses a problem. Any idea/pointer to share?
> 
> Thanks,
> Alain