WebFaction
Community site: login faq

I'm getting 502 errors from the Webfaction nginx reverse proxy(I assume that's what it is) when I try to run views through futon against my CouchDB installation.

It's the same issue Al Macmillan describes here: http://forum.webfaction.com/viewtopic.php?id=2355 and here http://stackoverflow.com/questions/3587056/couchdb-install-on-linux-crashing-when-running-test-suite but he didn't give a solution :(

Has anyone run across this? Let me know any other information you need to debug... basically what's happening as far as I can tell is that my web browser is making a POST to http://mysite.com/mydb/_temp_view?limit=11 and webfaction's nginx returns a 502.

I get this error back:

Error: [object XMLHttpRequest]

Invalid JSON: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

EDIT It only happens in Chrome... works in Firefox. Weird.

EDITx2 Well, this view pasted below works in FF and Chrome:

def fun(doc):
    yield None, doc

However, this one works in neither FF nor Chrome(taken from the couchdb-python tutorial http://packages.python.org/CouchDB/views.html) and gives a 502 nginx gateway error:

def fun(doc):
    if doc['date']:
        yield doc['date'], doc

asked 01 Apr '11, 12:22

chris
2613
accept rate: 100%

edited 01 Apr '11, 12:45


Well, that's dumb, the CouchDB tutorial example has a Python syntax error in it that I just noticed...

http://packages.python.org/CouchDB/views.html

def fun(doc):
    if doc['date']:
        yield doc['date'], doc

Obviously won't work because doc['date'] is a syntax error if that key is not set. The appropriate syntax should be:

def fun(doc):
    if doc.has_key('date'):
        yield doc['date'], doc
permanent link

answered 01 Apr '11, 12:49

chris
2613
accept rate: 100%

So, does that resolve the problem you're having?

(01 Apr '11, 14:05) seanf

Yup. I sent a comment to the couchdb-python devs about the documentation defect.

(01 Apr '11, 14:08) chris
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×185
×13

question asked: 01 Apr '11, 12:22

question was seen: 5,548 times

last updated: 01 Apr '11, 14:08

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM