Error #2 with erica clone: {undef,[{couchbeam,stream_fetch_attachment

62 views
Skip to first unread message

Aaron VonderHaar

unread,
Mar 2, 2014, 2:29:26 PM3/2/14
to couc...@googlegroups.com
Thanks for the quick fix for the previous error with erica clone!  That fix worked, but now I've hit another one:

==> tmp (clone)
ERROR: clone failed while processing /Users/avh4/Documents/workspace/couchmusic/tmp: {'EXIT',{undef,[{couchbeam,stream_fetch_attachment,
                           [{db,{server,<<"https://avh4.cloudant.com">>,[]},
                                <<"erica_fail">>,[]},
                            <<"_design/couchmusic">>,"lib/typeahead.min.js",
                            <0.2.0>],
                           []},
                {erica_clone,attachments_to_fs,4,
                             [{file,"src/erica_clone.erl"},{line,107}]},
                {erica_clone,do_clone,4,
                             [{file,"src/erica_clone.erl"},{line,89}]},
                {erica_core,run_modules,4,
                            [{file,"src/erica_core.erl"},{line,97}]},
                {erica_core,execute,4,[{file,"src/erica_core.erl"},{line,67}]},
                {erica,main,1,[{file,"src/erica.erl"},{line,12}]},
                {escript,run,2,[{file,"escript.erl"},{line,747}]},
                {escript,start,1,[{file,"escript.erl"},{line,277}]}]}}

I dug into this one a bit, and it seems that `couchbeam:stream_fetch_attachment` was removed in this commit to couchbeam:

https://github.com/benoitc/couchbeam/commit/ff548cb9171f5bafcbb6bf05f7819240930b860e#diff-1e3cb81c0a78ee464f725d59c0c27d2aL38

commit ff548cb9171f5bafcbb6bf05f7819240930b860e
Author: benoitc <b...u@gmail.com>
Date:   Tue Dec 3 11:59:59 2013 +0100

    initial work to replace ibrowse by hackney in couchbeam
 
I took a stab at trying to fix it, by changing erica_clone.erl:107

@@ -107,2 +107 @@ attachments_to_fs([AttName|Rest], Db, DocId, AttDir) ->
-    {ok, Ref} = couchbeam:stream_fetch_attachment(Db, DocId, AttName1,
-        self()),
+    {ok, Ref} = couchbeam:fetch_attachment(Db, DocId, AttName1, ['stream']),

But with that change, erica simply hangs when it starts fetching the attachments (I guess the return value/callbacks are quite different with fetch_attachment vs the old stream_fetch_attachment).

Perhaps this is also an easy fix for Benoit or someone familiar with couchbeam?  :)

Cheers,
--Aaron V.
 

Benoit Chesneau

unread,
Mar 2, 2014, 5:59:18 PM3/2/14
to couc...@googlegroups.com
On Sun, Mar 2, 2014 at 8:29 PM, Aaron VonderHaar <gruen0...@gmail.com> wrote:
> Thanks for the quick fix for the previous error with erica clone! That fix
> worked, but now I've hit another one:
>
> $ erica clone https://avh4.cloudant.com/erica_fail/_design/couchmusic
> ==> tmp (clone)
> ERROR: clone failed while processing
> /Users/avh4/Documents/workspace/couchmusic/tmp:
> {'EXIT',{undef,[{couchbeam,stream_fetch_attachment,
> [{db,{server,<<"https://avh4.cloudant.com">>,[]},
> <<"erica_fail">>,[]},
> <<"_design/couchmusic">>,"lib/typeahead.min.js",
> <0.2.0>],
> []},
> {erica_clone,attachments_to_fs,4,
> [{file,"src/erica_clone.erl"},{line,107}]},
> {erica_clone,do_clone,4,
> [{file,"src/erica_clone.erl"},{line,89}]},
> {erica_core,run_modules,4,
> [{file,"src/erica_core.erl"},{line,97}]},
>
> {erica_core,execute,4,[{file,"src/erica_core.erl"},{line,67}]},
> {erica,main,1,[{file,"src/erica.erl"},{line,12}]},
> {escript,run,2,[{file,"escript.erl"},{line,747}]},
> {escript,start,1,[{file,"escript.erl"},{line,277}]}]}}
>


should be fixed now. At least I sucessfully cloned your app.

https://github.com/benoitc/erica/commit/0b2a48a2497a9ee8681a18d6bdbd60a4fe0824d6

$ ../erica clone https://avh4.cloudant.com/erica_fail/_design/couchmusic .
==> test (clone)
$ ls
_attachments db events _id kanso lists rewrites src underscore views


- benoit

Aaron VonderHaar

unread,
Mar 2, 2014, 6:32:10 PM3/2/14
to couc...@googlegroups.com
Great, the fix seems to work!

However, now I can only get erica to run on my Mac when I run it from the erica checkout folder.

If I do `make install` and then run the installed `/usr/local/bin/erica`, I get the following:

$ erica push
Uncaught error in erica: {'EXIT',
                             {{case_clause,
                                  {error,
                                      {"no such file or directory",
                                       "idna.app"}}},
                              [{couchbeam_util,ensure_started,1,
                                   [{file,"src/couchbeam_util.erl"},
                                    {line,234}]},
                               {couchbeam_util,
                                   '-start_app_deps/1-lc$^0/1-0-',1,
                                   [{file,"src/couchbeam_util.erl"},
                                    {line,228}]},
                               {couchbeam_util,start_app_deps,1,
                                   [{file,"src/couchbeam_util.erl"},
                                    {line,228}]},
                               {couchbeam,start,0,
                                   [{file,"src/couchbeam.erl"},{line,75}]},
                               {erica_core,run,1,
                                   [{file,"src/erica_core.erl"},{line,41}]},

                               {erica,main,1,
                                   [{file,"src/erica.erl"},{line,12}]},
                               {escript,run,2,
                                   [{file,"escript.erl"},{line,747}]},
                               {escript,start,1,
                                   [{file,"escript.erl"},{line,277}]}]}}

I'm afraid I don't understand erlang well enough to know where it's trying to look for idna.app.

In any case, I've been able to move forward with my project (using the latest erica run from the checkout folder to do the clone, and then using an older version of erica properly installed after that).

Cheers,
--Aaron V.



--
You received this message because you are subscribed to the Google Groups "CouchApp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to couchapp+u...@googlegroups.com.
To post to this group, send email to couc...@googlegroups.com.
Visit this group at http://groups.google.com/group/couchapp.
For more options, visit https://groups.google.com/groups/opt_out.



--
--Aaron V.
[ http://github.com/avh4 ]

Benoit Chesneau

unread,
Mar 12, 2014, 6:50:43 PM3/12/14
to couc...@googlegroups.com
fixed in latest master. Thanks!
Reply all
Reply to author
Forward
0 new messages