Mark, looks like it's the file:sync calls. Can you try this patch?

Index: src/couchdb/couch_file.erl
===================================================================
--- src/couchdb/couch_file.erl  (revision 957790)
+++ src/couchdb/couch_file.erl  (working copy)
@@ -148,7 +148,7 @@
 %%----------------------------------------------------------------------
 
 sync(Filepath) when is_list(Filepath) ->
-    {ok, Fd} = file:open(Filepath, [read, raw]),
+    {ok, Fd} = file:open(Filepath, [write, raw]),
     try file:sync(Fd) after file:close(Fd) end;
 sync(Fd) ->
     gen_server:call(Fd, sync, infinity).


On Jun 26, 2010, at 6:50 PM, Mark Hammond wrote:

> On 27/06/2010 5:35 AM, Damien Katz wrote:
>> This looks like the auth_cache process can't create the _users db,
>> though I'm not sure why it would have that problem. It might be
>> windows can't create dbs at all.
> 
> It did create var/lib/couchdb/_users.couch before it failed.
>> 
>> Can you remove this from your default.ini:
>> auth_cache={couch_auth_cache, start_link, []}
>> 
>> Then try to create a new db from futon?
> 
> That seems to work.  The test suite fails in all kinds of ways - but none 
> appear to be permissions related as we saw before.  It is now in the state 
> where tests are all reporting I'm not a server admin and are refusing to 
> re-run until I restart couch.
> 
> At least some of the failures report the same traceback as before - eg, the 
> first test, 'basics', reports as below.
> 
> Also, I forgot to mention I'm doing this from the trunk - even after reading 
> the other messages in this thread I'm not sure if that is correct or not...
> 
> Cheers,
> 
> Mark
> 
> 1> [error] [<0.123.0>] ** Generic server <0.123.0> terminating
> ** Last message in was full_commit
> ** When Server state == {db,<0.122.0>,<0.123.0>,nil,<<"1277603206803340">>,
>                            <0.120.0>,<0.124.0>,
>                            {db_header,5,0,0,nil,nil,nil,0,nil,nil,1000},
>                            0,
>                            {btree,<0.120.0>,
>                                   {3865,{5,1}},
>                                   #Fun<couch_db_updater.7.22788535>,
>                                   #Fun<couch_db_updater.8.125873265>,
>                                   #Fun<couch_btree.5.124754102>,
>                                   #Fun<couch_db_updater.9.64028419>},
>                            {btree,<0.120.0>,
>                                   {4382,6},
>                                   #Fun<couch_db_updater.10.43731383>,
>                                   #Fun<couch_db_updater.11.52950010>,
>                                   #Fun<couch_btree.5.124754102>,
>                                   #Fun<couch_db_updater.12.74260996>},
> {btree,<0.120.0>,nil,#Fun<couch_btree.0.83553141>,
>                                   #Fun<couch_btree.1.30790806>,
>                                   #Fun<couch_btree.2.124754102>,nil},
>                            8,<<"test_suite_db">>,
>                            "../var/lib/couchdb/test_suite_db.couch",[],[],
>                            nil,
>                            {user_ctx,null,[],undefined},
>                            #Ref<0.0.0.339>,1000,
>                            [before_header,after_header,on_file_open],
>                            false}
> ** Reason for termination ==
> ** {{badmatch,{error,unknown}},
>    [{couch_db_updater,commit_data,2},
>     {couch_db_updater,handle_call,3},
>     {gen_server,handle_msg,5},
>     {proc_lib,init_p_do_apply,3}]}
> 
> 1>
> 

Reply via email to