Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 53661 invoked from network); 17 Mar 2010 00:49:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Mar 2010 00:49:34 -0000 Received: (qmail 6163 invoked by uid 500); 17 Mar 2010 00:49:33 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 6122 invoked by uid 500); 17 Mar 2010 00:49:33 -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 6114 invoked by uid 99); 17 Mar 2010 00:49:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 00:49:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erich.oliphant@gmail.com designates 72.14.220.153 as permitted sender) Received: from [72.14.220.153] (HELO fg-out-1718.google.com) (72.14.220.153) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 00:49:25 +0000 Received: by fg-out-1718.google.com with SMTP id 16so187756fgg.5 for ; Tue, 16 Mar 2010 17:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=p/Mt3/ewRzz+uFyTYanyHFbWF6Zi/wZff79DECKyBEk=; b=cM3abOYvHz2FBnPwruSWQtnDFjn/+QDX2j97ioKBZVEmPZNjHlDKkk75mkknDl3uEh wYJa4+GtoS8RY6fV+lVw2l/KoU5YduQ5L5cwF0H/8eRGNM8+Dx137DaK+dHv5arUoRcx L3ZS2kiVGu1b9wruokzywUOrR6kBLl6rhFYVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lKHUKnPgvj8qW+7qjvvZ1LKuPotlbu84HB7/BkhfMsPZX8DZc0KmMxQsJDJWd2Fb5e dfbjPrrYin3Xt/C9Fo7OVzTptvUJCtYjAzB+J1hkyR+udhrpPnxAcMrXQGTwQltyu3VH c/J2RrvLKYF5RUZ0c5KZXbyYQP1+voqxVmAY0= MIME-Version: 1.0 Received: by 10.239.196.14 with SMTP id t14mr3068hbi.429.1268786941497; Tue, 16 Mar 2010 17:49:01 -0700 (PDT) In-Reply-To: References: <49ba0cc11003161733q7dcd1ee2wb828e09bb677b472@mail.gmail.com> Date: Tue, 16 Mar 2010 20:49:01 -0400 Message-ID: <49ba0cc11003161749r1da8af72va66a8eb105109dc@mail.gmail.com> Subject: Re: "invalid UTF-8 JSON" 400 error accessing view with 'key' parameter From: erich oliphant To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0014850b6b80f191a00481f47a70 X-Virus-Checked: Checked by ClamAV on apache.org --0014850b6b80f191a00481f47a70 Content-Type: text/plain; charset=ISO-8859-1 Thanks worked like a charm! On Tue, Mar 16, 2010 at 8:45 PM, Jan Lehnardt wrote: > Hi Erich, > > On 16 Mar 2010, at 19:33, erich oliphant wrote: > > > I am a new CouchDB user. > > Welcome :) > > > I've populated my db with some documents and I've > > begun delving into views. I have a simple view that seems to work fine > with > > no params, like so: > > > > curl -X GET > http://localhost:5984/testerp1/_design/onestop/_view/PONumbers > > {"total_rows":104,"offset":0,"rows":[ > > > {"id":"d15d7d12-af01-4137-b56e-2bb2fdea5721","key":"AAA-99036","value":"d15d7d12-af01-4137-b56e-2bb2fdea5721"}, > > > {"id":"3e1d30ba-759f-4bff-b6c7-64536d772b09","key":"AAA-99057","value":"3e1d30ba-759f-4bff-b6c7-64536d772b09"}, > > ... > > However trying to grab a single result, causes a 400 > > curl -vX GET > > http://localhost:5984/testerp1/_design/onestop/_view/PONumbers?key= > > "AAA-99057" > > Your shell interprets the double quotes. Try this: > > curl -vX GET ' > http://localhost:5984/testerp1/_design/onestop/_view/PONumbers?key= > "AAA-99057"' > > Cheers > Jan > -- > > > > > * About to connect() to localhost port 5984 (#0) > > * Trying ::1... Connection refused > > * Trying fe80::1... Connection refused > > * Trying 127.0.0.1... connected > > * Connected to localhost (127.0.0.1) port 5984 (#0) > >> GET /testerp1/_design/onestop/_view/PONumbers?key=AAA-99057 HTTP/1.1 > >> User-Agent: curl/7.20.0 (i386-apple-darwin10.2.0) libcurl/7.20.0 > > OpenSSL/0.9.8m zlib/1.2.4 libidn/1.16 > >> Host: localhost:5984 > >> Accept: */* > >> > > < HTTP/1.1 400 Bad Request > > < Server: CouchDB/0.10.1 (Erlang OTP/R13B) > > < Date: Wed, 17 Mar 2010 00:28:46 GMT > > < Content-Type: text/plain;charset=utf-8 > > < Content-Length: 54 > > < Cache-Control: must-revalidate > > < > > {"error":"bad_request","reason":"invalid UTF-8 JSON"} > > * Connection #0 to host localhost left intact > > * Closing connection #0 > > > > I've tried the key param with and without quotes,etc but get the same > > issue. All of the other issues I've seen online have been related to > PUT > > bodies not being encoded correctly, but I've seen nothing similar to my > > case. > > > > Thanks In Advance > > -- > > Erich Oliphant > > > > "There are, in fact, two things, science and opinion, the former begets > > knowledge, the latter ignorance" > > -- Hippocrates of Cos > > -- Erich Oliphant "There are, in fact, two things, science and opinion, the former begets knowledge, the latter ignorance" -- Hippocrates of Cos --0014850b6b80f191a00481f47a70--