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 1078A97EE for ; Tue, 7 Aug 2012 18:12:22 +0000 (UTC) Received: (qmail 12228 invoked by uid 500); 7 Aug 2012 18:12:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12199 invoked by uid 500); 7 Aug 2012 18:12:20 -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 12190 invoked by uid 99); 7 Aug 2012 18:12:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 18:12:20 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.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; Tue, 07 Aug 2012 18:12:15 +0000 Received: by lage4 with SMTP id e4so354313lag.11 for ; Tue, 07 Aug 2012 11:11:53 -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:content-transfer-encoding; bh=X1RDUtjKtU9aL6CTi8JtwKLz3YnUpJz8PKoGIbsAdFI=; b=qnMnSYppNJZVmnk6Hl9TTl27yz0Ff8q6OTK7G5lQBa9aekFgJqUKgTuDX30IyTs7rf JaYn14XPtMTwrBleV+rgDsvVv5qcvaB6iDS4oeESb6ukJJcrl7g8QjtMCSwDa+pm2Yia 4KaAO73KCrB2Ebb4YMSWyw5Rc4RoqR673jryNF5yd8BOL0FDDqHgTznLCd5WbpgexZK6 Ogp4XLZHhZpYHAS1lT+lL25wPAqSbCZ0Tts5CNmXXj1sjoNmef1wUuiP5eXNOdu63dVn E/vjuJW6RKWipuOSVfnA65p7mZ27xOQrAzxlmwwpIIIrzquly5K7w+fZCNrlQgWyNRDc VLbg== MIME-Version: 1.0 Received: by 10.152.136.18 with SMTP id pw18mr15292634lab.17.1344363113699; Tue, 07 Aug 2012 11:11:53 -0700 (PDT) Received: by 10.112.131.231 with HTTP; Tue, 7 Aug 2012 11:11:53 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Aug 2012 14:11:53 -0400 Message-ID: Subject: Re: more refused connections From: Tim Tisdall 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 I have /var/lib/couchdb as the home directory for the couchdb user and it's set to be rwx by that user. I'm using the init script I think I found on the wiki (it's been months now). I'll try adding a 'cd ~couchdb' in there, but I don't think that will help (but can't hurt either). I'm currently have an "admin party", so I don't know if couch_httpd_auth.beam is even needed in that circumstance. I had two crashes today that said "OS process timed out."... what could cause that? On Tue, Aug 7, 2012 at 10:11 AM, Robert Newson wrote: > > This might come down to how the code loader searches for beam files. The = current working directory seems to be searched first, which might not be re= adable by the couchdb user (depending on how you launched couchdb). If you = get eacces to couch_httpd_auth.beam but can still login, then we must have = found a readable copy somewhere. I've seen this happen in bigcouch clusters= recently, and tracked it (somewhat laboriously) to the bigcouch startup sc= ript. Adding a simple 'cd ~bigcouch' was the fix there. > > B. > > On 7 Aug 2012, at 14:59, Tim Tisdall wrote: > >> Yeah, the problem definitely seems to be the server restarting. Any >> idea why couchdb would be having trouble accessing those files? I >> found an older post about people having a similar problem on EC2, >> though I'm using a different VPS solution then that. Everything runs >> fine until the log starts showing those "eacces" errors and then the >> server seems to restart and continue running with no problem. Ideas? >> >> -Tim >> >> On Mon, Aug 6, 2012 at 5:41 PM, Tim Tisdall wrote: >>> I can confirm that the server is running before and directly after the >>> error occurs. I think I've seen where compaction or view creations >>> have suddenly stopped as if the server restarted. Does CouchDB >>> automatically restart under certain circumstances? Maybe it's in the >>> middle of restarting when I get the refused connection. >>> >>> I'm not using a library, but pretty much the same code as what's in >>> the wiki... http://wiki.apache.org/couchdb/Getting_started_with_PHP >>> The CouchSimple class. The fsockopen() method is what throws the >>> error. >>> >>> I'm using 1.2.0 >>> >>> And unfortunately I can't reliably replicate the problem. I was >>> having it occur quite a bit a few months ago, but then it went away. >>> According to my logs, it seems that immediately before the refused >>> connection I get an empty response (I got an error when I try to parse >>> the response as JSON and I saw that it was empty). .... I just >>> checked my couch.log and see this: >>> >>> [Mon, 06 Aug 2012 19:53:02 GMT] [error] [<0.20.0>] {error_report,<0.9.0= >, >>> {<0.20.0>,std_error, >>> "File operation error: eacces. >>> Target: ./couch_httpd_oauth.beam. Function: get_file. Process: >>> code_server."}} >>> [Mon, 06 Aug 2012 19:53:02 GMT] [error] [<0.20.0>] {error_report,<0.9.0= >, >>> {<0.20.0>,std_error, >>> "File operation error: eacces. >>> Target: ./oauth_uri.beam. Function: get_file. Process: code_server."}} >>> [Mon, 06 Aug 2012 19:53:02 GMT] [error] [<0.20.0>] {error_report,<0.9.0= >, >>> {<0.20.0>,std_error, >>> "File operation error: eacces. >>> Target: ./couch_httpd_auth.beam. Function: get_file. Process: >>> code_server."}} >>> [Mon, 06 Aug 2012 19:53:02 GMT] [error] [<0.20.0>] {error_report,<0.9.0= >, >>> {<0.20.0>,std_error, >>> "File operation error: eacces. >>> Target: ./couch_httpd_db.beam. Function: get_file. Process: >>> code_server."}} >>> >>> >>> I think I have all the permissions correct as far as I can see... For >>> example the last file, couch_httpd_db.beam, has read permissions to >>> all. >>> >>> >>> On Mon, Aug 6, 2012 at 12:31 PM, Sam Bisbee wrote: >>>> Hi Tim, >>>> >>>> A few questions to help with the debugging... >>>> >>>> - Can you confirm that CouchDB is actually running when you see this = problem? >>>> >>>> - How are you connecting to CouchDB from PHP? Are you using a library= ? >>>> >>>> - What version of CouchDB are you using? >>>> >>>> - Can you provide a reliable set of steps to reproduce this problem? >>>> >>>> Cheers, >>>> >>>> -- >>>> Sam Bisbee >>>> >>>> On Sun, Aug 5, 2012 at 2:26 PM, Tim Tisdall wrote: >>>>> Well, I've had this problem before, but I still have no idea what >>>>> caused it then, why it went away, or why it's back again. :S >>>>> >>>>> "PHP Warning: fsockopen(): unable to connect to localhost:5984 >>>>> (Connection refused)" >>>>> >>>>> After making several bulk updates of about 100 documents each, I then >>>>> get this warning. That means that the same code executed fine severa= l >>>>> times and then suddenly gave me a "connection refused". Why would >>>>> CouchDB be refusing connections? >>>>> >>>>> I also occasionally get back invalid JSON responses from CouchDB >>>>> either because the content returned is truncated or completely >>>>> missing. I'm not sure if the 2 issues are related. >>>>> >>>>> Anyone else have problems like this with PHP? >>>>> >>>>> -Tim >