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 ABB617EA7 for ; Wed, 7 Dec 2011 14:29:00 +0000 (UTC) Received: (qmail 48407 invoked by uid 500); 7 Dec 2011 14:28:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 48362 invoked by uid 500); 7 Dec 2011 14:28:58 -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 48354 invoked by uid 99); 7 Dec 2011 14:28:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 14:28:58 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ramkrishna.kulkarni@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 14:28:51 +0000 Received: by faao24 with SMTP id o24so160735faa.11 for ; Wed, 07 Dec 2011 06:28:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=dlQ4TVmTRxqnCYS0hnqAtk5eb9HCNlQ+l9W9N6l7D9k=; b=K9ud8LPUQHV5ZL5W6lnFKwVqy+6fvOcN8sUOYecveYOTG1w4Tok8KTK4pWl8ADNFTj q3h316qLIEsPkPBepWDe6mMk4KBRzaSfHRT6ihhqiKYjrKc0jXFjKi495tmqKn+9ksVb LPJpqffdi7IigUZqK16AYhvaDBcjoJBFLnUuU= MIME-Version: 1.0 Received: by 10.216.156.73 with SMTP id l51mr490449wek.101.1323268111390; Wed, 07 Dec 2011 06:28:31 -0800 (PST) Received: by 10.223.79.16 with HTTP; Wed, 7 Dec 2011 06:28:31 -0800 (PST) In-Reply-To: <4EDF68BD.4060303@gmail.com> References: <4EDF5289.4010008@gmail.com> <4EDF68BD.4060303@gmail.com> Date: Wed, 7 Dec 2011 19:58:31 +0530 Message-ID: Subject: Re: Authentication failure with "Minor error in HTTP request" From: Ramkrishna Kulkarni To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your responses but I'm still not able to understand what's going on because I do not see couch_server restarting and terminating message for every request that crosses DB name limit. Most of the cases I receive '{"error":"error","reason":"enametoolong"}"' or '{"error":"not_found","reason":"no_db_file"}'. But then one of the request causes it to terminate. Pasting more detailed logs which highlight the scenario: http://pastebin.com/BmDsq4mj Also, the first set of errors in the logs are related to mochiweb and I'm not sure if these two things are related. [Wed, 07 Dec 2011 05:03:02 GMT] [error] [<0.18855.1>] {error_report,<0.31.0= >, {<0.18855.1>,crash_report, [[{initial_call,{mochiweb_socket_server,acceptor_loop,['Argument__1']}= }, {pid,<0.18855.1>}, {registered_name,[]}, {error_info, {error, {case_clause,{error,enotconn}}, [{mochiweb_request,get,2}, {couch_httpd,handle_request_int,5}, {mochiweb_http,headers,5}, {proc_lib,init_p_do_apply,3}]}}, {ancestors, [couch_httpd,couch_secondary_services,couch_server_sup,<0.32.0>]= }, {messages,[]}, {links,[<0.104.0>,#Port<0.2245>]}, {dictionary,[]}, {trap_exit,false}, {status,running}, {heap_size,17711}, {stack_size,24}, {reductions,10141}], []]}} [Wed, 07 Dec 2011 05:03:02 GMT] [error] [<0.104.0>] {error_report,<0.31.0>, {<0.104.0>,std_error, {mochiweb_socket_server,235, {child_error,{case_clause,{error,enotconn}}}}}} Thanks. On Wed, Dec 7, 2011 at 6:53 PM, CGS wrote: > There is another way to avoid the situation by limiting your script reque= sts > to a maximum number of characters. > > About terminating signal, yes, it's normal. The supervisor is instructed = to > try to restart the generic server x times per second for y seconds. If th= e > restart strategy limit is reached or breached, the supervisor terminates > definitively the child (in this case, the generic server). It seems your > script gets stubborn to send continuous messages which crashes the generi= c > server and the supervisor stops permanently the generic server due to the > above mentioned limit. > > CGS > > PS: It could be a nice idea for the developers to implement a limit for t= he > length of the names, to avoid the generic server to crash. But this is up= to > them. > > > > > > > On 12/07/2011 01:55 PM, Ramkrishna Kulkarni wrote: >> >> Thanks. Restarting does solves the problem but I was hoping if there >> is a way to avoid ending up in that situation. >> >> As far as the DB name is concerned, I do no have any DB with name >> length more than 10 characters. However, I did notice that the script >> made several requests =A0to a non-existent DB with name 8000+ >> characters. >> >> GET /aaaa.... (8000+ a's) >> >> Almost immediately after that I see couch_server restarting and then >> couch_server terminating message. Is this normal behavior? >> >> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.84.0>] Unexpected message, >> restarting couch_server: {'EXIT', >> ... >> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.84.0>] ** Generic server >> couch_server terminating >> ... >> >> Thanks. >> >> >> On Wed, Dec 7, 2011 at 5:18 PM, CGS =A0wrote: >>> >>> Due to too many and fast crashes, the server is terminated permanently, >>> but >>> not the whole process. Restarting CouchDB should allow again the user >>> login. >>> =A0From the error, you have exceeded the maximum number of characters f= or >>> the >>> name of your database. I don't know which is the maximum allowed, but f= or >>> sure that long queue of a's will not compute. >>> >>> CGS >>> >>> >>> >>> >>> On 12/07/2011 12:32 PM, Ramkrishna Kulkarni wrote: >>>> >>>> I would like to add that around that time I find some generic server >>>> terminated message: >>>> >>>> -- Logs -- >>>> >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22630.1>] 'GET' >>>> >>>> >>>> /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaa >>>> {1, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22630.1>] OAuth Params: [] >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22630.1>] Minor error in >>>> HTTP request: {not_found,no_db_file} >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22630.1>] Stacktrace: >>>> [{couch_httpd_db,do_db_req,2}, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [info] [<0.22630.1>] xxx.xxx.xxx.xxx - >>>> - 'GET' >>>> >>>> /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaa >>>> 404 >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22630.1>] httpd 404 error >>>> response: >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22636.1>] 'GET' >>>> >>>> >>>> /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaa >>>> {1, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [debug] [<0.22636.1>] OAuth Params: [] >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.84.0>] Unexpected message, >>>> restarting couch_server: {'EXIT',<0.22638.1>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [emulator] Error in process >>>> <0.22638.1> =A0 =A0with exit value: >>>> >>>> >>>> {{case_clause,{error,enametoolong}},[{couch_db,open_db_file,2},{couch_= file,open,2},{couch_db,start_link,3},{couch_server,'-open_async/5-fun-0-',4= }]} >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.84.0>] ** Generic server >>>> couch_server terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.84.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.79.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.22636.1>] Uncaught error >>>> in HTTP request: {exit, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.155.0>] ** Generic server >>>> <0.155.0> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.174.0>] ** Generic server >>>> <0.174.0> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.155.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.174.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.236.0>] ** Generic server >>>> <0.236.0> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.220.0>] ** Generic server >>>> <0.220.0> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.236.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.220.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [info] [<0.224.0>] Shutting down view >>>> group server, monitored db is closing. >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.91.0>] ** Generic server >>>> <0.91.0> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.91.0>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.18846.1>] ** Generic >>>> server<0.18846.1> =A0 =A0terminating >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [info] [<0.19172.1>] Shutting down >>>> view group server, monitored db is closing. >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [error] [<0.18846.1>] >>>> {error_report,<0.31.0>, >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [info] [<0.18904.1>] Shutting down >>>> view group server, monitored db is closing. >>>> [Wed, 07 Dec 2011 05:49:47 GMT] [info] [<0.22636.1>] Stacktrace: >>>> [{gen_server,call,3}, >>>> >>>> -- End -- >>>> >>>> >>>> On Wed, Dec 7, 2011 at 4:37 PM, Ramkrishna Kulkarni >>>> =A0 =A0wrote: >>>>> >>>>> During some rigorous testing, one of our scripts is making around 250= K >>>>> GET requests (all different paths) with basic auth. Before this test, >>>>> all users are able to login but after the test, only a couple of them >>>>> are able to login. For all other valid users I see unauthorized >>>>> message in the logs (mentioned below). >>>>> >>>>> I have changed only the following auth settings >>>>> auth_cache_size =3D 50000 >>>>> timeout =3D 3600 ;seconds >>>>> >>>>> I'm currently on 1.0.2. >>>>> >>>>> Please help. >>>>> >>>>> --- Logs ---- >>>>> Wed, 07 Dec 2011 10:56:21 GMT] [debug] [<0.23516.2>] 'POST' /_session >>>>> {1,1} >>>>> Headers: [{'Accept',"application/json, text/javascript, */*; q=3D0.01= , >>>>> application/json"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Accept-Charset',"UTF-8,*;q=3D0.5"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Accept-Encoding',"gzip,deflate,sdch"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Accept-Language',"en-US,en;q=3D0.8,hi;q=3D0.6"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Connection',"keep-alive"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Content-Length',"59"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Content-Type',"application/x-www-form-urlencoded= "}, >>>>> =A0 =A0 =A0 =A0 =A0{'Cookie',"AuthSession=3D"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Host',"xxx.xxx.xx.xxx:5984"}, >>>>> =A0 =A0 =A0 =A0 =A0{"Origin","http://xxx.xxx.xx.xxx:5984"}, >>>>> =A0 =A0 =A0 =A0 =A0{'Referer',"http://xxx.xxx.xx.xxx:5984/"}, >>>>> =A0 =A0 =A0 =A0 =A0{'User-Agent',"Mozilla/5.0 (X11; Linux i686) >>>>> AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 >>>>> Safari/535.2"}, >>>>> =A0 =A0 =A0 =A0 =A0{"X-Requested-With","XMLHttpRequest"}] >>>>> >>>>> [Wed, 07 Dec 2011 10:56:21 GMT] [debug] [<0.23516.2>] OAuth Params: [= ] >>>>> >>>>> [Wed, 07 Dec 2011 10:56:21 GMT] [debug] [<0.23516.2>] Attempt Login: >>>>> FXXXXXXXe16b2658b5c8f8ed3dcd09d36d08f107 >>>>> >>>>> [Wed, 07 Dec 2011 10:56:21 GMT] [info] [<0.23516.2>] yyy.yyy.yyy.yyy = - >>>>> - 'POST' /_session 401 >>>>> >>>>> [Wed, 07 Dec 2011 10:56:21 GMT] [debug] [<0.23516.2>] httpd 401 error >>>>> response: >>>>> =A0{"error":"unauthorized","reason":"Name or password is incorrect."} >>>>> >>>>> --- end --- >>> >>> >