Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Reddit infrastructure revealed (imageshack.us)
25 points by tzury on Feb 23, 2008 | hide | past | favorite | 16 comments


Ok, I'll be the first person to admit I'm an idiot, but this stack trace doesn't make any sense. First, how am I to know this is actually from reddit.com? It's an image, so I can't grep through the trace. Additionally, it looks to me like the initial error refers to accout.py at line 68... maybe I'm blind, but I don't see that anywhere in the trace. I'm no python expert but I've looked at a lot of java stack traces and this makes no sense. Seriously. Why deliver this as an image? What sequence of events did you go through to get this result? Is it repeatable? If so, how?

I know reddit bashing is super-fashionable right now, but really. Am I being dumb? It's well within the realm of possibilities. But this doesn't pass the sniff test.


As for its authenticity, it was on reddit/programming a few days ago - http://reddit.com/r/programming/info/69ftg/comments/ - and apparently one of the reddit guys caused it.


Ok, I stand corrected. If spez did it, it's legit. Kudos.


account.py was included at the very bottom of the stack trace. The trace didn't include the offending line, though, which is kinda confusing.


Of course, that's mostly pylons code. The only information I glean from here is:

1. FreeBSD 6.2

2. Pylons

3. /home/ri/hgreddit


Missed one: hgreddit => Mercurial.


"... missed one: hgreddit => Mecurial ..."

And Paste. The most interesting thing I saw was the bug that caused it found right at the bottom:

  "... unindent does not match any outer indentation level (account.py, line 68) ..."
This is such a pain with Python (having to line the indentation up) and is so trivial. Wonder how it got through testing? They do testing on reddit don't they?


If you find indentation to be a pain in Python, you haven't configured your editor properly.


"... If you find indentation to be a pain in Python, you haven't configured your editor properly. ..."

While it's easy to config your own editor [0]. There are other factors

* uncommonly used editors [1]

* other users/developers

Of the two, other developers is the biggest pain. You have to make sure each developers editor conforms to your coding standards. [1] But making "quick changes" on the server, can short-cut such safeguards.

[0] http://wiki.python.org/moin/HowToEditPythonCode

[1] http://wiki.python.org/moin/PythonEditors


Spez said he uncommented something on the live server.


Wow, I can't believe python doesn't have something similar to ruby's

    ruby -c foo.rb


Third party tools like the excellent pylint exist. And of course, your unit tests should verify that your code is free of syntax errors too, right?

Only problem is, the guy edited the code directly on the live server without testing.


Turns out there is a compileall.py script in the standard distribution that does the trick; there is also the py_compile module and the 'compile' function (though it takes a string).


I thought this was going to be a joke about imageshack, how [pics] power reddit.


What are they using for such pretty error messages in py?


That's actually a pretty ugly error by Pylons' standards. Normally a _very_ useful debugging console gets presented to the devs, and the public gets a standard (but customizable/replaceable) error screen. What happened here is that the exception happened again while trying to process the error (syntax errors in your base-level code will do that), and the Pylons exception handling gave up and rendered this error.

I don't know offhand exactly what produced that error message, as I've never seen it in my Pylons apps, but I'd suggest it's probably from paste.exceptions somewhere.

http://pythonpaste.org/module-paste.exceptions.html

EDIT: I realized that the reason I never see this is because Reddit uses flup's SCGI server, while I use a mod_proxy-based approach. So that exception-formatting code is probably in flup somewhere.

http://trac.saddi.com/flup




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: