Indicating a resource does not exist

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Indicating a resource does not exist

Nathan Rixham-2
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

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Joe Gregorio-2
What's wrong with 404 Not Found?

  -joe

On Thu, Jan 20, 2011 at 7:51 AM, Nathan <[hidden email]> wrote:

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



--
Joe Gregorio        http://bitworking.org

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
Joe Gregorio wrote:
> 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.

> On Thu, Jan 20, 2011 at 7:51 AM, Nathan <[hidden email]> wrote:
>> 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
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Joe Gregorio-2
On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:

> Joe Gregorio wrote:
>>
>> 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.

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

  -joe

>
>> On Thu, Jan 20, 2011 at 7:51 AM, Nathan <[hidden email]> wrote:
>>>
>>> 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
>>>
>>>
>>
>>
>>
>
>



--
Joe Gregorio        http://bitworking.org

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
Joe Gregorio wrote:

> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>> Joe Gregorio wrote:
>>> 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.
>
> 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

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
minor fix..

Nathan wrote:

> Joe Gregorio wrote:
>> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>>> Joe Gregorio wrote:
>>>> 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.
>>
>> 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)

- gone (DELETE 200/204, 410)

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


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Henry Story-4
In reply to this post by Nathan Rixham-2
On 20 Jan 2011, at 15:47, Nathan wrote:

> Joe Gregorio wrote:
>> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>>> Joe Gregorio wrote:
>>>> 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.
>> 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".

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





>
> Best,
>
> Nathan
>

Social Web Architect
http://bblfish.net/


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Tim Williams
In reply to this post by Nathan Rixham-2
On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:

> Joe Gregorio wrote:
>>
>> 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.

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

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Robert Sanderson

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/


On Thu, Jan 20, 2011 at 8:19 AM, Tim Williams <[hidden email]> wrote:
On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
> Joe Gregorio wrote:
>> What's wrong with 404 Not Found?

> The best you can conclude from that is "don't know" the state of the
> 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


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Ben Niven-Jenkins
In reply to this post by Nathan Rixham-2
Nathan,

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

> Joe Gregorio wrote:
>> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>>> Joe Gregorio wrote:
>>>> 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.
>> 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"

"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




Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
In reply to this post by Robert Sanderson
Hi,

Robert Sanderson wrote:
> 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...

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

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

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

Thanks all.

> 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/
>
>
> On Thu, Jan 20, 2011 at 8:19 AM, Tim Williams <[hidden email]> wrote:
>
>> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>>> Joe Gregorio wrote:
>>>> What's wrong with 404 Not Found?
>>> The best you can conclude from that is "don't know" the state of the
>>> 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
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
In reply to this post by Henry Story-4
Henry Story wrote:

> On 20 Jan 2011, at 15:47, Nathan wrote:
>> Joe Gregorio wrote:
>>> On Thu, Jan 20, 2011 at 9:31 AM, Nathan <[hidden email]> wrote:
>>>> Joe Gregorio wrote:
>>>>> 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.
>>> 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".
>
> could be, and nobody has complained very loudly about this until now.
> 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)

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

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

> Perahps you could create a /dev/null url and have those resources
> return
>
> <> a <http://web3.org/ont/DevNull> .

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

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

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

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

Best,

Nathan

Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Henry Story-4

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/


Reply | Threaded
Open this post in threaded view
|

Re: Indicating a resource does not exist

Nathan Rixham-2
Henry Story wrote:

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

Indeed, 404 it is :)

Cheers Henry,

Nathan