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 6F039FB2C for ; Wed, 17 Apr 2013 08:18:00 +0000 (UTC) Received: (qmail 44496 invoked by uid 500); 17 Apr 2013 08:17:56 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 44409 invoked by uid 500); 17 Apr 2013 08:17:56 -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 44184 invoked by uid 99); 17 Apr 2013 08:17:56 -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:17:56 +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.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2013 08:17:52 +0000 Received: by mail-vb0-f45.google.com with SMTP id w15so1059575vbf.4 for ; Wed, 17 Apr 2013 01:17:11 -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=Rvs/vb3elmj8cshpLtSI6bpKvlLdiRp7H4WeUlHlSvM=; b=U0qKQwOKKmEltuFDsHzXL29cekMk7SJUedEZEi6g0dsqBQeO+HlWPHLMWYMrztyYw1 WeQ8/tBgCnfm9nN2HL5QNdj7FUhTPJzi1aYZyx2lGHDbNMH09UA0UsViGtbZPtldRT8N 3hSJkLowmQhq12uAYUpNevifbu4ykSBL0kuvLV3XA/iQWcdcoMs4sSWyjxB1wIq+ELRO VVI5uU8r1rO0/O4VnJJdNDbYHc1T8nG5VLWR5GRNiw5tm44v/uO7EVnRy6Y8xhhWVG3w E/AKU+DHF0WMzhMJwtTZc8nOrEqrbqXyCMsycZjQqXFUwAhsyyon1ROgdPle0nDnMJYl 8odw== MIME-Version: 1.0 X-Received: by 10.52.26.16 with SMTP id h16mr3497543vdg.47.1366186631092; Wed, 17 Apr 2013 01:17:11 -0700 (PDT) Received: by 10.58.56.229 with HTTP; Wed, 17 Apr 2013 01:17:10 -0700 (PDT) Received: by 10.58.56.229 with HTTP; Wed, 17 Apr 2013 01:17:10 -0700 (PDT) In-Reply-To: References: Date: Wed, 17 Apr 2013 01:17:10 -0700 Message-ID: Subject: Re: startkey endkey problem From: Stanley Iriele To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf307d056ed81f0e04da8a1cbc X-Gm-Message-State: ALoCoQlRKJZnqvUf/X5UqEAo8liUR5WaKhuGBBS6t/AOjDkfUXwtYqdi4rN2o29ks87aVCqP6vBO X-Virus-Checked: Checked by ClamAV on apache.org --20cf307d056ed81f0e04da8a1cbc Content-Type: text/plain; charset=ISO-8859-1 And if yes...will this never not be the case?... Or is this a working feature addition? On Apr 17, 2013 1:16 AM, "Stanley Iriele" wrote: > No worries... But I had question regarding that so I'm glad you > responded...in the rewrites Json array...is this why it ignores the formats > clause??? I was just curious... Since you're here and all and this is the > first time anyone has replied to any of my posts...:-D > On Apr 17, 2013 1:08 AM, "Benoit Chesneau" wrote: > > > I mixed maills... sorry :) > > > > On Wed, Apr 17, 2013 at 10:04 AM, Stanley Iriele > > wrote: > > > 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 < > siriele2x3@gmail.com > > > > > >> > 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 < > > dch@jsonified.com> > > >> > wrote: > > >> > > > > >> > >> On 17 April 2013 00:29, Stanley Iriele < > > siriele@breaktimestudios.com> > > >> > >> 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}] > > >> > >> >> > > >> > >> > > >> > > > >> > > > --20cf307d056ed81f0e04da8a1cbc--