You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Luca Morandini <lm...@ieee.org> on 2014/08/08 10:18:11 UTC

Missing function error

Folks,

we have been happily using CouchDB 1.2.0 some years now, but now we encountered a 
puzzling issue: in a otherwise correct design document, all of a sudden CouchDB is 
no longer able to find the views and list functions 
({"error":"not_found","reason":"missing function"}).

We tried to solve this issue by upgrading to 1.5.1 (we had unearthed an old bug 
with the same symptom) and replicated the offending database to the new one,... to 
no avail: any clues ?

Thanks in advance,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


[SOLVED] Re: Missing function error

Posted by Luca Morandini <lm...@ieee.org>.
On 11/08/14 11:18, Luca Morandini wrote:

It turned out that this error is triggered when the string declaring the function 
does not contain a function, like in:
"by_type": {
        "map": "function (doc) {\n    if (doc.type) {\n        emit(doc.org, 
doc);\n    }\n}",
        "reduce": ""
    }

(note the empty reduce function)

We are glad the issue turned out to be easily solved, but a more descriptive error 
message would have helped us.

Regards,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Re: Missing function error

Posted by Dave Cottlehuber <dc...@jsonified.com>.
 
> On 08/08/14 18:18, Luca Morandini wrote:
>  
> Update on this issue: we dropped the database, recreated it (ant its views) on
> CouchDB 1.5.1 and this apparently solved the issue.
>  
> Next thing we are about to do is to add documents (one by one) from the old
> database and see which one breaks it.
>  

Depending on how long it takes to rebuild your views, it should be sufficient to rebuild the view on the complete db (or the old view/db if you have them still), and then query the view to see what the “last” built sequence number is, then use the changes feed with since=<seqnum>&limit=1 to see what that doc would be.

ref http://docs.couchdb.org/en/latest/api/ddoc/views.html?highlight=update_seq and https://couchdb.readthedocs.org/en/latest/api/database/changes.html 

—  
Dave Cottlehuber
dch@jsonified.com
Sent from my Couch





Re: Missing function error

Posted by Luca Morandini <lm...@ieee.org>.
On 08/08/14 18:18, Luca Morandini wrote:

Update on this issue: we dropped the database, recreated it (ant its views) on 
CouchDB 1.5.1 and this apparently solved the issue.

Next thing we are about to do is to add documents (one by one) from the old 
database and see which one breaks it.

Regards,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Re: Missing function error

Posted by Luca Morandini <lm...@ieee.org>.
On 08/08/14 18:57, Aurélien Bénel wrote:
>> We tried from the admin interface as well.
>
> In Futon, can you see the view?

Yes.


> If yes, what does it say when you select it?

It spins for a few seconds, then:
<<Error not found
missing funciton>>

Regards,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Re: Missing function error

Posted by Luca Morandini <lm...@ieee.org>.
On 08/08/14 18:57, Aurélien Bénel wrote:
>> We tried from the admin interface as well.
>
> In Futon, can you see the view?

Yes.


> If yes, what does it say when you select it?

It spins for a few seconds, then:
<<Error not found
missing funciton>>

Regards,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Re: Missing function error

Posted by Aurélien Bénel <au...@utt.fr>.
> We tried from the admin interface as well.

In Futon, can you see the view? 
If yes, what does it say when you select it?


Regards,

Aurélien

Re: Missing function error

Posted by Luca Morandini <lm...@ieee.org>.
On 08/08/14 18:24, Aurélien Bénel wrote:
> Hi Luca,
>
>> ({"error":"not_found","reason":"missing function"}).
>
> Two questions:
> 1. Could you tell us the URI you tried?

curl 
"http://db2.aurin.org.au:5984/myaurin-development/_design/persistence/_view/find_by_id"

We tried from the admin interface as well.

By the way, another design document on the same database works fine.


> 2. Do you use the rewrite handler? If yes, could you send your `rewrites.json` file?

We don't use rewrite handlers.

Thanks for the prompt reply,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Re: Missing function error

Posted by Aurélien Bénel <au...@utt.fr>.
Hi Luca,

> ({"error":"not_found","reason":"missing function"}).

Two questions:
1. Could you tell us the URI you tried?
2. Do you use the rewrite handler? If yes, could you send your `rewrites.json` file?


Regards,

Aurélien