From user-return-21795-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Aug 16 15:23:56 2012 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 C22C0D33F for ; Thu, 16 Aug 2012 15:23:56 +0000 (UTC) Received: (qmail 80670 invoked by uid 500); 16 Aug 2012 15:23:55 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 80640 invoked by uid 500); 16 Aug 2012 15:23:55 -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 80629 invoked by uid 99); 16 Aug 2012 15:23:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2012 15:23:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tisdall@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-lpp01m010-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2012 15:23:47 +0000 Received: by lage4 with SMTP id e4so1430237lag.11 for ; Thu, 16 Aug 2012 08:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FBtTzEFhiPXwTGe+KzMhWGgTjYpGQgTLMWBgMoVlAXw=; b=WrDHXtxbRGwMiE3YaAajvcIR1SW594HfR8tCK197Ix5LRPDqb+DXTMXmmqZLu9r2aC 8bwb42uEvh3E+2Z+Nb2bAgMijqhKeWO/V3bP5W+ES3megUs/ub3kWRDrIQEbVpwLeEOE +SNoa7Vb8dkw1W3ZbxTAj2weGTPcJNnJdjtphJDQzG80VzOM4da1ypMrpXfGm0EIi3BE PGmsWCR+VS3oS/k5OZoh77n1vN+ue1iAmAkXTQ70dpOfJACOvQfgDc7lOdEQTVbRiO2C WmA7JeWYYZLk6rgHSDbMl0+07xPQ5dvL+YtKc+RQCbsYGmIAxHh80GYHkW6cqwj5KHeM NFjw== MIME-Version: 1.0 Received: by 10.152.144.168 with SMTP id sn8mr1717977lab.1.1345130594365; Thu, 16 Aug 2012 08:23:14 -0700 (PDT) Received: by 10.112.49.170 with HTTP; Thu, 16 Aug 2012 08:23:14 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Aug 2012 11:23:14 -0400 Message-ID: Subject: Re: couchdb returning empty response From: Tim Tisdall To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 I don't know if this would help at all, but here are the steps I did to install CouchDB: - downloaded and uncompressed source in /usr/src/ - apt-get install erlang-dev libmozjs-dev libicu-dev erlang-eunit erlang-inets erlang-os-mon - ./configure --localstatedir=/var --sysconfdir=/etc - make - make install - useradd -d /var/lib/couchdb couchdb - chown -R couchdb: /var/{lib,log,run}/couchdb /etc/couchdb - chmod 0770 /var/{lib,log,run}/couchdb /etc/couchdb - update-rc.d couchdb defaults # start couchdb on system start On Thu, Aug 16, 2012 at 11:16 AM, Tim Tisdall wrote: > I tried running my code again and got a bunch of these entries in my logs: > > [Thu, 16 Aug 2012 14:53:03 GMT] [error] [<0.20.0>] {error_report,<0.9.0>, > {<0.20.0>,std_error, > "File operation error: eacces. > Target: ./mochiweb_response.beam. Function: get_file. Process: > code_server."}} > > here's the file listing for the file (as you can see it's readable by all): > > -rw-r--r-- 1 root staff 1420 Aug 7 21:11 > /usr/local/lib/couchdb/erlang/lib/mochiweb-1.4.1/ebin/mochiweb_response.beam > > > > On Thu, Aug 16, 2012 at 10:27 AM, Tim Tisdall wrote: >> Okay, I'm completely unfamiliar with gdb but I tried and failed to get >> the stacktraces. Here's what happened... >> >> I'm able to do everything up to attaching to the process and then >> things go wrong... >> >> (gdb) attach 29967 >> Attaching to process 29967 >> Reading symbols from /usr/lib/erlang/erts-5.8/bin/beam.smp...(no >> debugging symbols found)...done. >> Reading symbols from /lib/libutil.so.1...(no debugging symbols found)...done. >> Loaded symbols for /lib/libutil.so.1 >> Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. >> Loaded symbols for /lib/libdl.so.2 >> Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done. >> Loaded symbols for /lib/libm.so.6 >> Reading symbols from /lib/libncurses.so.5...(no debugging symbols found)...done. >> Loaded symbols for /lib/libncurses.so.5 >> Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done. >> [ *SNIP* ] >> Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done. >> Loaded symbols for /usr/lib/libz.so.1 >> Reading symbols from >> /usr/local/lib/couchdb/erlang/lib/snappy-1.0.3/priv/snappy_nif.so...done. >> Loaded symbols for >> /usr/local/lib/couchdb/erlang/lib/snappy-1.0.3/priv/snappy_nif.so >> 0x00007f01e153c3e3 in select () from /lib/libc.so.6 >> >> >> If I try to see the process with ps in another terminal it now says: >> 29967 pts/3 Zl 0:00 [beam.smp] >> >> At this point couchdb is no longer responding so I'm not able to run >> my script to try to get that stack trace. I also tried typing >> "continue" into gdb and the process stays "defunct". >> >> Do I need to install the debugging versions of all those libraries in >> order for this to work? >> >> -Tim >> >> On Tue, Aug 14, 2012 at 11:41 PM, Paul Davis >> wrote: >>> On Tue, Aug 14, 2012 at 9:38 PM, Tim Tisdall wrote: >>>> I'm still having problems with couchdb, but I'm trying out different >>>> things to see if I can narrow down what the problem is... >>>> >>>> I stopped using fsockopen() in PHP and am using curl now to hopefully >>>> be able to see more debugging info. >>>> >>>> I get an empty response when sending a POST to _bulk_docs. From the >>>> couch logs it seems like the server restarts in the middle of >>>> processing the request. Here's what I have in my logs: (I have no >>>> idea what the _replicator portion is about there, I'm currently not >>>> using it) >>>> >>>> >>>> [Wed, 15 Aug 2012 02:27:30 GMT] [debug] [<0.1255.0>] 'POST' >>>> /app_stats_test/_bulk_docs {1,0} from "127.0.0.1" >>>> Headers: [{'Accept',"*/*"}, >>>> {'Content-Length',"2802300"}, >>>> {'Content-Type',"application/json"}, >>>> {'Host',"localhost:5984"}] >>>> [Wed, 15 Aug 2012 02:27:30 GMT] [debug] [<0.1255.0>] OAuth Params: [] >>>> [Wed, 15 Aug 2012 02:27:45 GMT] [debug] [<0.115.0>] Include Doc: >>>> <<"_design/_replicator">> {1, >>>> <<91,250,44,153, >>>> 238,254,43,46, >>>> 180,150,45,181, >>>> 10,163,207,212>>} >>>> [Wed, 15 Aug 2012 02:27:45 GMT] [info] [<0.32.0>] Apache CouchDB has >>>> started on http://127.0.0.1:5984/ >>>> >>>> >>>> In my code logs I have the following by running curl in verbose mode: >>>> >>>> * About to connect() to localhost port 5984 (#0) >>>> * Trying 127.0.0.1... * connected >>>> * Connected to localhost (127.0.0.1) port 5984 (#0) >>>>> POST /app_stats_test/_bulk_docs HTTP/1.0 >>>> Host: localhost:5984 >>>> Accept: */* >>>> Content-Type: application/json >>>> Content-Length: 2802300 >>>> >>>> * Empty reply from server >>>> * Connection #0 to host localhost left intact >>>> curl error: 52 : Empty reply from server >>>> >>>> >>>> >>>> I also tried using HTTP/1.1 and I get an empty response after >>>> receiving only a "100 Continue", but the end result appears the same. >>>> >>>> -Tim >>> >>> If you have a request that triggers this, a good way to catch it is like such: >>> >>> $ /usr/local/bin/couchdb # or however you start it >>> $ ps ax | grep beam.smp # Get the pid of couchdb >>> $ gdb >>> (gdb) attach $pid # Where $pid was just found with ps. Might >>> throw up an access prompt >>> (gdb) continue >>> # At this point, run the command that makes couchdb reboot in a >>> # different console. If it happens you should see Gdb notice the >>> # error. Then the following: >>> (gdb) t a a bt >>> >>> And that should spew out a bunch of stack traces. If you can get that >>> we should be able to fairly specifically narrow down the issue.