Hacker Newsnew | comments | ask | jobs | submitlogin
Reddit infrastructure revealed (imageshack.us)
25 points by tzury 921 days ago | comments


4 points by ghiotion 921 days ago | link

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.

-----

8 points by breily 921 days ago | link

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.

-----

2 points by ghiotion 921 days ago | link

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

-----

1 point by aston 921 days ago | link

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.

-----

6 points by ketralnis 921 days ago | link

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

-----

3 points by aston 921 days ago | link

Missed one: hgreddit => Mercurial.

-----

2 points by bootload 921 days ago | link

"... 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?

-----

4 points by a-priori 920 days ago | link

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

-----

1 point by bootload 920 days ago | link

"... 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

-----

2 points by aston 920 days ago | link

Spez said he uncommented something on the live server.

-----

1 point by anewaccountname 920 days ago | link

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

    ruby -c foo.rb

-----

2 points by inklesspen 920 days ago | link

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.

-----

2 points by anewaccountname 917 days ago | link

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).

-----

2 points by ivankirigin 920 days ago | link

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

-----

1 point by agotterer 920 days ago | link

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

-----

1 point by inklesspen 920 days ago | link

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

-----




Lists | RSS | Search | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Analytics by Mixpanel