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 16A88FA95 for ; Wed, 17 Apr 2013 08:05:21 +0000 (UTC) Received: (qmail 92206 invoked by uid 500); 17 Apr 2013 08:05:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 92077 invoked by uid 500); 17 Apr 2013 08:05:19 -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 92060 invoked by uid 99); 17 Apr 2013 08:05:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2013 08:05:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.220.173] (HELO mail-vc0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2013 08:05:14 +0000 Received: by mail-vc0-f173.google.com with SMTP id gf12so1106546vcb.18 for ; Wed, 17 Apr 2013 01:04:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:x-gm-message-state; bh=YDx4981cXO08x0AbexZvXXUmkEaKCYydvvwIuYbGVXY=; b=KkKY3mNI+H6Ezu2ql0Xg68NpnzAYwO8aFNm6c9A7YVKVzR/ABjdnOO46XBC+lqHRZm SyBmrhXI/aHQXs3jcS8sYQbavehE8LZe6j/xgk+LDpI0X0/mHA8UPwt7sbQJmUmdD9wp a4ArTwMydz33Ryg49++kpdBKefUojLZ/17Lj/w1utthUBAyW9i9K3xTXOXMNW2LEiZ3i 8Gdz3Qr09WJfWQCxw4wSO3Ri9iXGIdXoyvW86pipSpZ47/7QRlgRAzhWDAhKrK9co3lk 3qG51Cbr0u7IuiSu63nj6wF2jYbjMKesEJzxBD6r5vK62bOIfNVg8zBwfCTZ6vkDVf59 o44g== MIME-Version: 1.0 X-Received: by 10.220.77.138 with SMTP id g10mr4048733vck.69.1366185873441; Wed, 17 Apr 2013 01:04:33 -0700 (PDT) Received: by 10.58.56.229 with HTTP; Wed, 17 Apr 2013 01:04:33 -0700 (PDT) Received: by 10.58.56.229 with HTTP; Wed, 17 Apr 2013 01:04:33 -0700 (PDT) In-Reply-To: References: Date: Wed, 17 Apr 2013 01:04:33 -0700 Message-ID: Subject: Re: startkey endkey problem From: Stanley Iriele To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7b3a8d04af4a1304da89ef32 X-Gm-Message-State: ALoCoQmSo0c2malyw7Fl2L5jZg5P/gIeUYbN6z//mRzexe1aBQbFaxPt+Zd6kQM7aD8LE8WC4BeY X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a8d04af4a1304da89ef32 Content-Type: text/plain; charset=ISO-8859-1 Hopefully this helps someone somewhere... I'll make a tucket for this tomorrow... (Hopefully) On Apr 17, 2013 1:03 AM, "Stanley Iriele" wrote: > Hey....thanks for the clarity.. But that does not really apply to this > case....the way I'm requesting days fortunately doesn't bite me in the ass > :-) even though its string ordering... So..1..and 10..come before 2 for > those who care but ....this is the case when there are you go into a list > function and you don't call send.... It just blows up with a 500 ... > And it didn't not do this is couchdb 1.2.1...but it does now... > > originally I thought it was a view problem because it only happened when > the keys were of an invalid range... But that was just a symptom.. Not the > cause.... So that explains the misleading subject > On Apr 17, 2013 12:48 AM, "Benoit Chesneau" wrote: > > > So let say it one time for the good. In the current version the > > rewriter doesn't parse the variables in nested lists. Maybe it should > > be written somewhere in the doc. > > > > > > Some detailed explanation on how work the variable replacement in the > > rewriter: > > > > The current difficulty with variables replacement in the rewriter is > > the same yoou have in Erlang. The URL parameters in the URL are > > received as strings. Strings in Erlang are list of integers. Unless > > you know it you have no way to know if foo=1 is an integer or a list, > > or if true is a boolean or a list. Also if you are passing "foo" to a > > view should it be json encoded or not. The way we bypass that in views > > is considering that values given to startkey and endkey are json > > encoded. By default all params are url decoded, and json decoded if > > needed, > > > > In the current rewriter we have no expectation on how variables are > > passed except for some known parameters (keys, endkeys, startkeys, > > end_key, start_key, key) that are considered as json values. To tell > > if the parameter "foo" is an integer you have to use the "format" > > property. > > > > Nested list: > > > > We are for now only replacing the first level in lists [1]. I need to > > revisit the code to understand why it does, but I suspect i made a > > premature optimization. I will try to fix that asap. > > > > - benoit > > > > > > > > [1] > > > https://github.com/benoitc/couchdb/blob/master/src/couchdb/couch_httpd_rewrite.erl#L273 > > > > > > On Wed, Apr 17, 2013 at 8:42 AM, Stanley Iriele > > wrote: > > > sure...i was using a rewrite handler to rewrite > > > /:game/channels/:year/:month/:day/ > > > > > > though these are strings they work for my case and they map to > > > > > > > > > db/_design/ddoc/_list/bats/viewname?startkey=[":game",":year",":month",":day"]&endkey=[":game",":year",":month",":day",{}] > > > > > > this worked just fine before in couchdb 1.2.1 when selecting days that > > were > > > not populated.... > > > but the view works fine and returns empty rows...the list function > > however > > > is where it blew up..aparently if you write start({}) for setting > > > headers...but you dont ever call the send function...it blows up with > > > > > > [Tue, 16 Apr 2013 02:15:20 GMT] [error] [<0.2125.1>] Uncaught error in > > HTTP > > > request: {error,undef} > > > [Tue, 16 Apr 2013 02:15:20 GMT] [info] [<0.2125.1>] Stacktrace: > > > [{undefined,write_chunk,[[]]}, > > > {couch_httpd,last_chunk,1}, > > > {couch_mrview_show,list_cb,2}, > > > {couch_mrview,finish_fold,2}, > > > > {couch_query_servers,with_ddoc_proc,2}, > > > {couch_httpd,etag_maybe,2}, > > > {couch_httpd_db,do_db_req,2}, > > > {couch_httpd,handle_request_int,5}] > > > > > > but if you just add: > > > > > > send("") sending an empty string it works just fine..so my work around > is > > > sending this empty string...it does not pollute the response in > > > anyway...but existing code does break > > > > > > > > > On Tue, Apr 16, 2013 at 9:44 PM, Dave Cottlehuber > > wrote: > > > > > >> On 17 April 2013 00:29, Stanley Iriele > > >> wrote: > > >> > nevermind..I found the cause...It is clearly a couhdb bug...but I > > found a > > >> > work around for it that seems to make everyone happy..if anyone gets > > this > > >> > error...or even sees this message I'll happily follow up > > >> > > >> Hi Stanley, > > >> > > >> Glad to hear you found a solution! Can you share the HTTP query syntax > > >> you are using, and also what your workaround is? > > >> > > >> If it's a bug a JIRA ticket would be welcomed > > >> https://issues.apache.org/jira/browse/COUCHDB with the details. > > >> > > >> A+ > > >> Dave > > >> > > >> > On Mon, Apr 15, 2013 at 8:00 PM, Stanley Iriele < > > >> > siriele@breaktimestudios.com> wrote: > > >> > > > >> >> Hi,,,I have just upgraded to using couchdb 1.3.0 from 1.2.1 and now > > this > > >> >> stack trace is showing up when i query startkey and endkey values > > that > > >> are > > >> >> out of range of the view..is there a flag i need to set or config i > > >> need to > > >> >> change because this was not hapening before > > >> >> > > >> >> > > >> >> [Tue, 16 Apr 2013 02:15:20 GMT] [error] [<0.2125.1>] Uncaught error > > in > > >> >> HTTP request: {error,undef} > > >> >> [Tue, 16 Apr 2013 02:15:20 GMT] [info] [<0.2125.1>] Stacktrace: > > >> >> [{undefined,write_chunk,[[]]}, > > >> >> {couch_httpd,last_chunk,1}, > > >> >> {couch_mrview_show,list_cb,2}, > > >> >> {couch_mrview,finish_fold,2}, > > >> >> > > {couch_query_servers,with_ddoc_proc,2}, > > >> >> {couch_httpd,etag_maybe,2}, > > >> >> {couch_httpd_db,do_db_req,2}, > > >> >> > {couch_httpd,handle_request_int,5}] > > >> >> > > >> > > > --047d7b3a8d04af4a1304da89ef32--