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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 several >>> 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
