top | item 3098756

"Unknown or expired link." - Why?

145 points| bradharper | 14 years ago |google.com | reply

Why would such a valuable site continue to allow itself to be plagued with this type of repulsive usability issue?

132 comments

order
[+] jgrahamc|14 years ago|reply
It's an artefact of the way in which news.arc (actually srv.arc) uses functions for links. Here's the key code:

  (= dead-msg* "\nUnknown or expired link.")

  (defop-raw x (str req)
    (w/stdout str
      (aif (fns* (sym (arg req "fnid")))
           (it req)
           (pr dead-msg*))))
If the fnid (function ID) isn't in the fns* list then you get the dead message.

  (def flink (f)
    (string fnurl* "?fnid=" (fnid (fn (req) (prn) (f req)))))
In many places in the code closures are used to handle requests (see the flink code there). If the fns* list is cleared (say news.arc is restarted or harvest-fnids kills them) then you'll get the message.

The use of closures in this manner means that the code needed to handle say a form submission is really compact and set up when the form itself is generated.

[+] piinbinary|14 years ago|reply
I would be interested to know how much state is in those closures. If it is less than 200 or so bytes, it would not be impractical to encode it (b64) in the url for the next page (rather than a reference to the state).
[+] kens|14 years ago|reply
My (unofficial) documentation of the Arc web server may help understand this: http://files.arcfn.com/doc/srv.html

In particular, harvest-fnids has as maximum number of allowed fnids. If there are too many, it purges any fnids that are older than their expiration time, and the oldest 10%.

Thus, the more fnids created (i.e. the more users), the sooner fnids will get harvested and you'll get the expired error.

[+] DiabloD3|14 years ago|reply
A website written in Lisp? That is awesome.
[+] extension|14 years ago|reply
You get that when your session expires, which takes just slightly less time than writing a well thought out comment.
[+] wvenable|14 years ago|reply
It doesn't just happen when writing comments; it can happen almost anywhere on the site if you linger too long. It's the most glaring fault with the software behind this site and would be completely impracticable if this site weren't populated by technology-minded people who aren't bothered by error messages.
[+] bradharper|14 years ago|reply
I've become accustomed to getting the error when I linger on the page for a bit, and even in that context it's pretty irritating, but tolerable. Just this morning however, I'm able to click on the logo link at top-left, immediately navigate to the bottom, select "more," and get the nasty - that's remarkably dysfunctional.
[+] brlewis|14 years ago|reply
PG is using a really cool programming technique that I'm afraid is ahead of its time relative to current hardware. An upgrade to the HN server should allay the problem.

To see the potential, look at this code snippet from an academic paper on the topic. The web server presents a form asking for a number, then presents a form asking for another number, then displays their product. This technique makes event-driven web applications feel (to the programmer) like sequential imperative programs.

  ;; main body
  ‘(html (head (title ”Product”))
         (body
           (p ”The product is: ”
              ,(number→string (∗ (get-number ”first”) (get-number ”second”))))))
The paper: http://cs.brown.edu/~sk/Publications/Papers/Published/khmgpf...
[+] pg|14 years ago|reply
It's not so much that it's ahead of its time relative to hardware as it is something you do in the early versions of a program.

Using closures to store state on the server is a rapid prototyping technique, like using lists as data structures. It's elegant but inefficient. In the initial version of HN I used closures for practically all links. As traffic has increased over the years, I've gradually replaced them with hard-coded urls.

Lately traffic has grown rapidly (it usually does in the fall) and I've been working on other things (mostly banning crawlers that don't respect robots.txt), so the rate of expired links has become more conspicuous. I'll add a few more hard-coded urls and that will get it down again.

[+] mooism2|14 years ago|reply
The HN server uses a table of closures to implement those links (the id code for the closure is the bit after fnid= in the url).

When the HN server starts running out of memory, it drops entries from this table. When your browser asks for an entry that is no longer in this table, you get the "Unknown or expired link" error.

This is a crazy design, but unless someone would like to patch the source code and get PG to accept it, we're stuck with it.

[+] gnaritas|14 years ago|reply
It's not crazy at all, it greatly simplifies development to use callbacks for actions rather than manually encoding the necessary state into the URL. Techniques such as this are what enable a single developer to be so productive by automating boring and time consuming stuff.
[+] icebraining|14 years ago|reply
If you clicked on the links, you'd know why.

The software stores the current state in a closure. The closure gets cached. When the cache is full, the older closures get flushed, hence the error message.

[+] tomcreighton|14 years ago|reply
I find it interesting that most discussions I've seen about this exact topic are about Arc and closures... instead of about the fact that this may well be an interesting programming thing to do but it's a moronic user experience thing to do.
[+] pg|14 years ago|reply
Your comment is in a sense its own refutation, because the ultimate test of user experience is whether users continue to use the software.

Getting user experience right depends on the users. I wouldn't use this technique in an online store. Random online shoppers would be confused by expired links, and you'd lose sales. But HN users aren't confused by them. What HN users care about is the quality of the stuff on the site.

Since I can't work full time on HN, I focus on the things that matter most. What I spend my time thinking about is e.g. detecting voting rings. Those affect what you see on the frontpage, which is what users of this site care most about.

[+] herdrick|14 years ago|reply
Please don't call people or their work 'moronic' (or the like) here.
[+] kristopher|14 years ago|reply
I, too, wanted to ask this question, but feared that someone would respond with something akin to "submit a patch" or "grep the source code"

Obviously, it makes sense for someone who is versed in the news.arc internals to fix the problem; nonetheless this issue certainly bugs me.

[+] JohnsonB|14 years ago|reply
Good question, but in my opinion it's somewhat rhetorical. Given bugs like these, the ongoing optimization battle, and fairly reasonable feature requests (see the huge HN topic on that), isn't it about time Paul Graham hired someone full or part time to work all these issues out? Given how important HN is to YC, I would think it's worth it. Are any of these tasks really things pg has to do or are the best use of his time?
[+] brlewis|14 years ago|reply
It's good to do things you enjoy. Best use of his time? I don't think anyone can definitively answer that.
[+] breckinloggins|14 years ago|reply
Steps to reproduce:

1. Open Hacker News

2. Go to lunch

3. Come back from lunch and click next

Every. Time.

[+] georgemcbay|14 years ago|reply
Back when it took a lunch break to cause this issue it didn't bother me at all. These days it happens so fast that it is constantly interrupting me while actively browsing through the site.
[+] przemoc|14 years ago|reply
Restrain from eating then.
[+] smackfu|14 years ago|reply
The first complaints are from 1575 days (over 4 years) ago, including about the more button breaking, so I am guessing pg has no interest in fixing it.
[+] Tichy|14 years ago|reply
Hacker News is open source, so it seems as if nobody is interested in fixing it. Or are there fixes and pg has rejected them?
[+] davidcollantes|14 years ago|reply
This happens to me a lot while reading HN. I hit "More" and by the time I am done reading a few comments on a handful of entries, the next "More" has expired, and so has the current.

This only happens on HN (at least to me).

[+] d1b|14 years ago|reply
Actually _right_now_ I cannot click "more"(on the first page) without hitting the "Unknown or expired link" page ... so I cannot go past the first page :/ -- Someone should submit a patch :)
[+] blauwbilgorgel|14 years ago|reply
I thought this was to combat cross-site request forgery attacks?

Else couldn't one set up malicious scripts to up-or downvote many stories, or post comments under someone else's name?

[+] dasil003|14 years ago|reply
Those are orthogonal issues.
[+] odobenus|14 years ago|reply
Everyone who has literally answered the question "Why?" has completely missed the point. What would PG say about a primary site feature that is so completely broken that it drives users to complain actively, and maybe stop using the site? That it is their problem because they don't understand the technical details? Well, obviously, no one is losing any money here, so maybe that's the answer after all.
[+] smountcastle|14 years ago|reply
I'm getting this error when using the login link right now!

EDIT: The only way I was able to login was to use the 'add comment' button on this post.

[+] emu|14 years ago|reply
I also just tried to log in about 6-7 times in a row (clicking the "login" link on the front page, reloading the front page in between attempts), and I repeatedly received the "expired link" page.

It also reliably happens clicking the "next page" link on the bottom of the front page; by the time I'm done reading the front page the next page link usually expires.

Please fix?

[+] abdulhaq|14 years ago|reply
The problem could made less painful by including a link back to http://news.ycombinator.com on the "Unknown or expired link" page. That would save me fishing around with the mouse and the back button to get a new start.
[+] VBprogrammer|14 years ago|reply
I would go one step further and just send me back to the homepage.
[+] Silhouette|14 years ago|reply
I've been wondering about this for a long time, but just as a data point if anyone cares, it has reached the point recently that HN is basically unusable for me a lot of the time, and I really am starting to give up on trying and spend more time elsewhere instead.

Perhaps one visitor is no great loss -- I'm hardly the personality around here that someone like patio11 is -- but I hope my contribution is constructive, and my comment scores have always suggested so.

However, subjectively, it seems like the quality of posting and voting has taken a sharp nosedive since the "Unknown or expired link" problems have become a several-times-per-session occurrence over the past few weeks. I can't help wondering whether long-standing regular contributors are being put off as a result. If positive contributors can't even log in to refute an objectively incorrect post with a verifiable link or downvote Redditesque diversions, a downward slide seems inevitable, and then the loss of high quality posting and voting becomes a self-sustaining decline.

[+] Tichy|14 years ago|reply
When writing comments, always make a copy of your text before hitting submit (CTRL+A, CTRL+C). A good strategy for any text form on the web.
[+] xnxn|14 years ago|reply
Funny, I suspect it's just the opposite. Long-standing regular contributors are unlikely to be put off by the error messages, especially if they're technically knowledgeable and understand why the error is occurring.

On the other hand, new users who might not be accustomed to The Way We Do Things Around Here would be more likely to get upset at the superficial inconveniences and leave.

It's probably even the case that improving the site or adding features to it would work against its best interests by making it more accessible. HN's implementation is such that the more traffic it sees, the more frequently those errors will occur -- and as an unexpected side-effect, the popularity and instability of the site will work against each other until equilibrium is reached.

A small barrier to entry like Reddit's spartan design or MeFi's $5 fee can go a long way toward delaying the onset of the entertainment-seeking masses.

[+] socialmediaking|14 years ago|reply
It seems kind of ironic to have such an egregious bug on a site dealing with coding and technology...
[+] adamrmcd|14 years ago|reply
Silly question, but, if HN is purportedly open-source where can I download the source code?
[+] mrb|14 years ago|reply

  1. http://arclanguage.org/install
  2. Extract arc3.tar
  3. See news.arc
However, AFAIK pg forked from the latest public news.arc, so the current Hacker News platform is not open source.
[+] gbaygon|14 years ago|reply
Yes please, fix it already. I this problem where in another site we would be posting complains from random blog posts over and over again.