Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D8A3DB2C for ; Thu, 14 Mar 2013 18:58:15 +0000 (UTC) Received: (qmail 25640 invoked by uid 500); 14 Mar 2013 18:58:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 25598 invoked by uid 500); 14 Mar 2013 18:58:13 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 25546 invoked by uid 99); 14 Mar 2013 18:58:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Mar 2013 18:58:13 +0000 Date: Thu, 14 Mar 2013 18:58:13 +0000 (UTC) From: "Ryan Ramage (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (COUCHDB-1706) function_clause error when querying views with cors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1706?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan Ramage closed COUCHDB-1706. -------------------------------- Resolution: Duplicate Thanks for the report. This has been fixed in COUCHDB-1697. The fix should = be applied to the 1.3.x branch.=20 =20 > function_clause error when querying views with cors > --------------------------------------------------- > > Key: COUCHDB-1706 > URL: https://issues.apache.org/jira/browse/COUCHDB-1706 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Reporter: Sander Dijkhuis > > When querying views using the new cross-origin support, CouchDB sometimes= raises a function_clause error instead of returning the results. It doesn= =E2=80=99t do so consistently. For example, if the other-origin webpage mak= es two requests after each other, one may work and the other may fail (in a= ny order). I haven=E2=80=99t seen this error yet when querying views withou= t using cors. Rebuilding CouchDB, remaking the databases or refreshing the = views doesn=E2=80=99t work and the view itself doesn=E2=80=99t do much that= can go wrong: > {code:title=3DThe view} > profiles: { > map: function(doc) { > if (doc.type && doc.type =3D=3D 'profile') emit(doc.user, null); > } > } > {code} > I=E2=80=99m running CouchDB 1.3 commit 8be3ec0218873fa3516f564678dbd2c74e= bb5246 with build-couchdb commit fabf7c51c8c5b278b72ffe95f12915016f104996. > {code:title=3DThe stacktrace} > [error] [<0.653.0>] function_clause error in HTTP request > [info] [<0.653.0>] Stacktrace: [{string,to_lower, = = =20 > [undefined], > [{file,"string.erl"},{line,468}]}, = = =20 > {couch_httpd_cors,maybe_apply_cors_header= s,2, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/couchdb/couch_httpd_cors.erl"}, > {line,219}]}, = = =20 > {couch_httpd,send_response,4, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/couchdb/couch_httpd.erl"}, > {line,704}]}, = = =20 > {couch_mrview_http,design_doc_view,5, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/couch_mrview/src/couch_mrview_http.erl"}, > {line,147}]}, = = =20 > {couch_httpd_db,do_db_req,2, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/couchdb/couch_httpd_db.erl"}, > {line,234}]}, = = =20 > {couch_httpd,handle_request_int,5, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/couchdb/couch_httpd.erl"}, > {line,329}]}, = = =20 > {mochiweb_http,headers,5, > [{file, = = =20 > "/home/sander/git/build-couchdb1.3/dep= endencies/couchdb/src/mochiweb/mochiweb_http.erl"}, > {line,136}]}, = = =20 > {proc_lib,init_p_do_apply,3, > [{file,"proc_lib.erl"},{line,227}]}] = = =20 > [info] [<0.653.0>] 83.255.2.0 - - GET /lunacy%2Fuser%2Fsander/_design/use= r/_view/profiles?include_docs=3Dtrue&key=3D%22Bot%203%22&reduce=3Dfalse 500 > [error] [<0.653.0>] httpd 500 error response: = = =20 > {"error":"unknown_error","reason":"function_clause"} > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira