Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B83E89C96 for ; Tue, 31 Jan 2012 18:25:07 +0000 (UTC) Received: (qmail 16173 invoked by uid 500); 31 Jan 2012 18:25:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 16100 invoked by uid 500); 31 Jan 2012 18:25:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 16084 invoked by uid 99); 31 Jan 2012 18:25:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2012 18:25:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2012 18:24:58 +0000 Received: by iabz7 with SMTP id z7so445661iab.11 for ; Tue, 31 Jan 2012 10:24:37 -0800 (PST) Received: by 10.42.150.200 with SMTP id b8mr18334851icw.43.1328034276962; Tue, 31 Jan 2012 10:24:36 -0800 (PST) Received: from [10.10.20.58] (74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113]) by mx.google.com with ESMTPS id ch2sm123096igb.4.2012.01.31.10.24.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jan 2012 10:24:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1251.1) Subject: Re: Badarg error in HTTP request From: Milan Andric In-Reply-To: <9823253058AC564A994FAF1B393ED88307DC3D@ipmtmb01.ipaymentinc.com> Date: Tue, 31 Jan 2012 12:24:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <01B8D125-77E9-45A0-ABCE-A1101E5C1D34@medicmobile.org> References: <9823253058AC564A994FAF1B393ED88307DC3D@ipmtmb01.ipaymentinc.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1251.1) Tim, I'm pretty sure you need to make your query args strings, try = query: { limit: "1" }. -- Milan On Jan 31, 2012, at 12:12 PM, Tim Doherty wrote: > Hello, >=20 > I am new to CouchDB, having just inherited a CouchApp project. I have = successfully replicated the production app to my local CouchDB = installation (1.1.1 on Windows 7) >=20 > I am getting 'Badarg error in HTTP request' on _rewrite requests for = views on my local machine, while identical requests are fine on the = production server, i.e.: >=20 > This works: = production.server.com:5984/arp/_design/arp/_rewrite/emailpresent >=20 > But this doesn't: localhost:5984/arp/_design/arp/_rewrite/emailpresent >=20 > rewrites.json is as follows: >=20 > [ > { > "from": "/index.html", > "to":"/index.html" > }, > { > "from": "/css/*", > "to":"/css/*" > }, > { > "from": "/images/*", > "to":"/images/*" > }, > { > "from": "/js/*", > "to":"/js/*" > }, > { > "from": "/vendor/*", > "to":"/vendor/*" > }, > { > "from": "/emailpresent", > "to": "/_view/emailpresent", > "query": { > "limit": 1 > } > }, > { > "from": "/session/*", > "to": "/_show/session/*", > "query": { > "limit": 1 > } > }, > { > "from": "/sessionvalidate", > "to": "/_show/sessionvalidate", > "query": { > "limit": 1 > } > }, > { > "from": "/jsdate", > "to": "/_show/jsdate" > }, > { > "from": "/signin", > "to": "/_view/signin", > "query": { > "limit": 1 > } > }, > { > "from": "/agentreginfo", > "to": "/_view/agentreginfo", > "query": { > "limit": 1 > } > }, > { > "from": "/agentreg/*", > "to": "/_update/agentreg/*" > }, > { > "from": "/vendorreginfo", > "to": "/_view/vendorreginfo", > "query": { > "limit": 1 > } > }, > { > "from": "/vendorreg/*", > "to": "/_update/vendorreg/*" > }, > { > "from": "/cancelreg/*", > "to": "/_update/cancelreg/*" > }, > { > "from": "/agentexport/*", > "to": = "/_list/agentexport/agentreginfo/*" > }, > { > "from": "/vendorexport/*", > "to": = "/_list/vendorexport/vendorreginfo" > }, > { > "from": "/", > "to": "/index.html" > } > ] >=20 > And _view/emailpresent/map.js is as follows: >=20 > function(doc) { > if (doc.type =3D=3D "profile") > emit(doc.email, "true"); > } >=20 > Stack trace from the log is as follows: >=20 > [Tue, 31 Jan 2012 17:36:50 GMT] [error] [<0.12525.0>] Badarg error in = HTTP request > [Tue, 31 Jan 2012 17:36:50 GMT] [info] [<0.12525.0>] Stacktrace: = [{erlang,iolist_to_binary,[1]}, > {couch_httpd_rewrite, > = '-maybe_encode_bindings/1-fun-0-',2}, > {lists,foldl,3}, > = {couch_httpd_rewrite,handle_rewrite_req,3}, > {couch_httpd_db,do_db_req,2}, > {couch_httpd,handle_request_int,5}, > {mochiweb_http,headers,5}, > {proc_lib,init_p_do_apply,3}] > [Tue, 31 Jan 2012 17:36:50 GMT] [info] [<0.12525.0>] 127.0.0.1 - - = 'GET' /arp/_design/arp/_rewrite/emailpresent 500 > [Tue, 31 Jan 2012 17:36:50 GMT] [debug] [<0.12525.0>] httpd 500 error = response: > {"error":"unknown_error","reason":"badarg"} >=20 > Thanks in advance! >=20 > Tim >=20