Subject: Indicating a resource does not exist

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 12:51:57 +0000

Hi Again,

I've analysed all the HTTP status codes in combination with different 
methods and response headers, and I can't find a way for a server to 
indicate that a resource /does not/ exist.

Can anybody suggest a way of indicating this? or is there scope for a 
4xx No Such Resource status (or similar)?

Cheers,

Nathan

---

From: Joe Gregorio <[email-masked]>
Date: Thu, 20 Jan 2011 09:08:05 -0500

What's wrong with 404 Not Found?

  -joe

On Thu, Jan 20, 2011 at 7:51 AM, Nathan <[email-masked]> wrote:
> Can anybody suggest a way of indicating this? or is there scope for a 4xx No
> Such Resource status (or similar)?
>
> Cheers,
>
> Nathan
>
>

-- 
Joe Gregorio        http://bitworking.org

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 14:31:28 +0000

> What's wrong with 404 Not Found?

    404 Not Found
    ...
    The server has not found anything matching the effective request URI.
    No indication is given of whether the condition is temporary or
    permanent ...

The best you can conclude from that is "don't know" the state of the 
resource, or if there is one.

---

From: Joe Gregorio <[email-masked]>
Date: Thu, 20 Jan 2011 09:39:39 -0500

> resource, or if there is one.

OK, so 410 Gone if you want to indicate it is permanent.

  -joe

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 14:47:27 +0000

> OK, so 410 Gone if you want to indicate it is permanent.

410 entails more though, "was a resource, is no longer a resource", 404 
is "I don't know", I'm looking for an unambiguous "origin server says 
this is not a resource"

Essentially at the minute, the only resource states that can be conveyed 
(as far as I can see) are:

  - created (POST/PUT 201, PUT 204)
  - current state (many combinations)
  - state changed (POST/PUT 200)
  - unknown state (DELETE 202, a few 3xx, most 4xx and all 5xx)
  - gone (204)

so basically, there's no way to say "no resource".

Best,

Nathan

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 14:50:11 +0000

minor fix..

>  - unknown state (DELETE 202, a few 3xx, most 4xx and all 5xx)

- gone (DELETE 200/204, 410)

---

From: Henry Story <[email-masked]>
Date: Thu, 20 Jan 2011 16:01:17 +0100

On 20 Jan 2011, at 15:47, Nathan wrote:

> 410 entails more though, "was a resource, is no longer a resource", 404 is "I don't know", I'm looking for an unambiguous "origin server says this is not a resource"
> 
> Essentially at the minute, the only resource states that can be conveyed (as far as I can see) are:
> 

could be, and nobody has complained very loudly about this until now.
Do you have a use serious use case?

The problem with saying that a URI is not a resource, is that if it
does not dereference then that means that the server does not know
what it means. If the server does not know what it means, then how
can the server know that it is not a resource? You are touching
one one of those tricky philosophical problems, that could keep
you occupied for a lifetime if you are not careful. 

Perahps you could create a /dev/null url and have those resources
return

<> a <http://web3.org/ont/DevNull> .

Or you could have it be the empty set, which according to
David Lewis' latest book on mereology refers to the mereological
fusion of everything: every thing, every possible thing, every
possible world. ( see: Parts and Classes )

But then it would refer quite clearly to something, and you 
could use that something to build up all of mathematics on it.

Henry

> Nathan

Social Web Architect
http://bblfish.net/

---

From: Tim Williams <[email-masked]>
Date: Thu, 20 Jan 2011 10:19:36 -0500

> resource, or if there is one.

It's not clear why you think that's all you can conclude.  I would
have concluded that the origin server couldn't find a resource by that
identifier at the time of the request. Maybe I'm not understanding the
nuance of "doesn't exist" vs. "not found".  404 is saying it doesn't
exist *at the time of this request*, right?

--tim

---

From: Robert Sanderson <[email-masked]>
Date: Thu, 20 Jan 2011 08:33:39 -0700

Which is surely all that the server can say?  The resource might exist in
the future. It may have existed in the past, but when in the past? Certainly
not before 1994...

A server that supported Memento [1] might be able to say that it *didn't*
exist at a particular time, but that's not the same as "doesn't,didn't and
never will exist".

Given the lack of the time dimension in HTTP without Memento, 404 seems the
correct status code.

Rob Sanderson
Los Alamos National Laboratory

1: https://datatracker.ietf.org/doc/draft-vandesompel-memento/

---

From: Ben Niven-Jenkins <[email-masked]>
Date: Thu, 20 Jan 2011 15:53:55 +0000

Nathan,

> 410 entails more though, "was a resource, is no longer a resource", 404 is "I don't know", I'm looking for an unambiguous "origin server says this is not a resource"

"origin server says this is not a resource" is itself ambiguous, for example does it mean:
 - "this is not a resource now, and will never be a resource in the future"
 - "this is not a resource now, but may be a resource in the future" 
 - something else.

A description of the use case you have in mind would probably help quite a lot as I'm struggling to think of a scenario where 404 isn't sufficient.

Ben

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 16:44:29 +0000

Hi,

> the future. It may have existed in the past, but when in the past? Certainly

Okay, I can live with "doesn't exist at the time of this request", 
that'll work.

> exist at a particular time, but that's not the same as "doesn't,didn't and

Was looking for "doesn't and didn't exist (to this servers knowledge)", 
not the never will exist.

Thanks all.

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 16:50:48 +0000

> Do you have a use serious use case?

no, just modelling and getting a grip on HTTP, although if it was 
defined I'd use it, HEAD to see if something exists, then PUT if it 
doesn't. (as opposed to 404 because this server doesn't tell you the 
resource is here unless you're auth'd, for example)

> you occupied for a lifetime if you are not careful. 

god no, looking for a quick resolution on this one ;)

> <> a <http://web3.org/ont/DevNull> .

That's essentially what I was looking to infer based on an HTTP Response 
message.

> possible world. ( see: Parts and Classes )

404 and 406 do map to the empty set, don't they? thanks for the book tip 
though.

> could use that something to build up all of mathematics on it.

Indeed, that's why I was looking to infer nothing, not even the empty 
set, and couldn't find a way to do it (without the 410 did exists at one 
point angle).

Best,

Nathan

---

From: Henry Story <[email-masked]>
Date: Thu, 20 Jan 2011 18:03:47 +0100

On 20 Jan 2011, at 17:50, Nathan wrote:

>> 
>> But then it would refer quite clearly to something, and you could use that something to build up all of mathematics on it.
> 
> Indeed, that's why I was looking to infer nothing, not even the empty set, and couldn't find a way to do it (without the 410 did exists at one point angle).

The thing is you can't say of a name that does not refer that it refers to nothing, for it would then refer and have a meaning. Furthermore if the web server returns something then it clearly did have
enough meaning to be looked up in the global web space of meaning: the web. So it is not completely meaningless either. I would say therefore that the answer that servers currently give saying they cannot find the resource gives you enough of what is needed for things to work.   

The fact that you think there should be a return value for this case because it seems to make sense is not enough to prove that there should be one. Similarly the fact that we can write the square root of -2 does not mean there should be an answer to that function or that it should be meaningful. That it turned out to be meaningful with imaginary numbers was something that required some serious argumentation. It helped solve some interesting problems. Until those problems pop up ant it is proven that those return value would best solve the issue, that they do so better than any other technical solution, until then there
is no good reason to search for return values for specifying names that don't have referents.

Henry

Social Web Architect
http://bblfish.net/

---

From: Nathan <[email-masked]>
Date: Thu, 20 Jan 2011 17:10:11 +0000

> is no good reason to search for return values for specifying names that don't have referents.

Indeed, 404 it is :)

Cheers Henry,

Nathan