Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

From: "Dijk, Esko" <[email-masked]>
Date: Wed, 1 Feb 2017 08:50:20 +0000

Thanks Carsten, Paddy, Lauri,

for the case I referred to indeed the response needs to be machine-readable so that the client can limit its query scope. For our constrained device context I would at first expect a few additional response codes defined, a perhaps more into the future a complete "problem detail" payload.

For the time being it can be one of 5.00, 5.01 or 4.03.

Esko

-----Original Message-----
From: Carsten Bormann [mailto:[email-masked]]
Sent: Wednesday, February 01, 2017 8:22
To: Lauri Piikivi <[email-masked]>
Cc: Dijk, Esko <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

indeed, the CoRE world is different from the HTTP world.

> I propose a bit of info gathering, I  imagine there are more similar kinds of situations where HTTP has not had the right code.

When we do this, I would like to approach new codes not just with “what should the server do” but more importantly with “how is the client going to react differently”.  If the error response is just about telling what went wrong so a human can debug the situation, diagnostic payloads are fine.  If we need more detail in an error response so the client can formulate a better request based on those details, we may want to standardize “problem detail” payloads, inspired by RFC 7807.

Grüße, Carsten

________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

---

From: "Smith, Kevin, (R&D) Vodafone Group" <[email-masked]>
Date: Wed, 1 Feb 2017 10:03:25 +0000

HI all,

I general it makes sense to let the client know whether it can/should repeat the request. In this case we can assume that 'response too large' is a temporary condition (if not then there is a bigger problem :))

The client should therefore be informed that (1) the condition is perceived to be temporary and (2) a recommended delay before the client repeats the request. This IMO puts the error in the 5xx range, as the client has not done anything wrong as such, and the same request being made n seconds later could return a success code and a manageable response.

So my preference would simply be 503 Service Unavailable [1], with a Retry-After header [2]:

"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. The server MAY send a Retry-After header field1 to suggest an appropriate amount of time for the client to wait before retrying the request."

Since 5xx also recommends "the server SHOULD send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition" [3], then the client can be informed via the representation that 'response too large' was the temporary cause.

All best,
Kevin
Vodafone 

[1] https://tools.ietf.org/html/rfc7231#section-6.6.4 
[2] https://tools.ietf.org/html/rfc7231#section-7.1.3
[3] https://tools.ietf.org/html/rfc7231#section-6.6 

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Carsten Bormann
Sent: 01 February 2017 07:22
To: Lauri Piikivi <[email-masked]>
Cc: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

Grüße, Carsten

_______________________________________________
core mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/core

---

From: "Dijk, Esko" <[email-masked]>
Date: Wed, 8 Feb 2017 14:09:30 +0000

Or for the shorter term: the HTTP code 507 Insufficient Storage (from https://tools.ietf.org/html/rfc4918#section-11.5) is very suitable for the use case of 'client requesting too much data via URI query parameters'.
Could we request registration of 5.07 in the CoAP Response Codes registry with direct reference to RFC 4918 / code 507 ?  (following the IESG approval route)

best regards
Esko

-----Original Message-----
From: Dijk, Esko
Sent: Wednesday, February 01, 2017 9:50
To: 'Carsten Bormann' <[email-masked]>; Lauri Piikivi <[email-masked]>
Cc: core ([email-masked]) <[email-masked]>
Subject: RE: [core] CoAP response code in case of "response payload too large" ? 4.13?

Esko

-----Original Message-----
From: Carsten Bormann [mailto:[email-masked]]
Sent: Wednesday, February 01, 2017 8:22
To: Lauri Piikivi <[email-masked]>
Cc: Dijk, Esko <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

Grüße, Carsten

---

From: "Smith, Kevin, (R&D) Vodafone Group" <[email-masked]>
Date: Wed, 8 Feb 2017 14:31:51 +0000

Hi Esko,

Not sure if you saw my earlier reply (copied below for convenience), but it proposed 503 because that explicitly hints the next step to the client - which is certainly in the HATEOAS spirit. It also seems that insufficient storage may not be the only reason for the server not wishing to return a large response, it may also be because of bandwidth constraints, network congestion etc. So for that reason I would propose 503, with Retry Header and optional explanatory body, over 507.

All best,
Kevin

-----

In general it makes sense to let the client know whether it can/should repeat the request. In this case we can assume that 'response too large' is a temporary condition (if not then there is a bigger problem :))

All best,
Kevin
Vodafone 

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Dijk, Esko
Sent: 08 February 2017 14:10
To: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

best regards
Esko

-----Original Message-----
From: Dijk, Esko
Sent: Wednesday, February 01, 2017 9:50
To: 'Carsten Bormann' <[email-masked]>; Lauri Piikivi <[email-masked]>
Cc: core ([email-masked]) <[email-masked]>
Subject: RE: [core] CoAP response code in case of "response payload too large" ? 4.13?

Esko

-----Original Message-----
From: Carsten Bormann [mailto:[email-masked]]
Sent: Wednesday, February 01, 2017 8:22
To: Lauri Piikivi <[email-masked]>
Cc: Dijk, Esko <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

Grüße, Carsten

---

From: "Dijk, Esko" <[email-masked]>
Date: Mon, 13 Feb 2017 15:04:56 +0000

Hello Kevin,

the response code 5.03 implies that a client could retry the exact same CoAP request after some time. That seems ok if the network is temporarily congested, or other resource-related issues occur. However if the client requests (using query parameters) a representation that is fundamentally too large, e.g. perhaps it does not fit in a single UDP datagram, then retrying is unwanted. So for that case actually 4.03 looks fitting; I just saw the sentence in RFC 7231 there stating "However, a request might be forbidden for reasons unrelated to the credentials". So the reason could also be that "it is forbidden to ask so much using query parameters."

regards
Esko

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Smith, Kevin, (R&D) Vodafone Group
Sent: Wednesday, February 08, 2017 15:32
To: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Esko,

All best,
Kevin

-----

All best,
Kevin
Vodafone 

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Dijk, Esko
Sent: 08 February 2017 14:10
To: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

best regards
Esko

-----Original Message-----
From: Dijk, Esko
Sent: Wednesday, February 01, 2017 9:50
To: 'Carsten Bormann' <[email-masked]>; Lauri Piikivi <[email-masked]>
Cc: core ([email-masked]) <[email-masked]>
Subject: RE: [core] CoAP response code in case of "response payload too large" ? 4.13?

Esko

-----Original Message-----
From: Carsten Bormann [mailto:[email-masked]]
Sent: Wednesday, February 01, 2017 8:22
To: Lauri Piikivi <[email-masked]>
Cc: Dijk, Esko <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

Grüße, Carsten

---

From: "Smith, Kevin, (R&D) Vodafone Group" <[email-masked]>
Date: Mon, 13 Feb 2017 17:04:22 +0000

Hello Esko,

Yes, agreed. 4xx is saying to the client, "if you repeat this same request, no matter how many times you try, then it will fail." and ideally "the mistake you made is this - correct that and you should be fine".

5xx indicates that either the server is broken, and needs to be fixed before anyone can retry, or that the server is temporarily unable to server the response. 

As you say, it may be the case that both situations can occur - client error and server temporary issue - in which case it's valid to have both in the error catalogue. The key part is that the client knows what to do next.

All best,
Kevin

-----Original Message-----
From: Dijk, Esko [mailto:[email-masked]] 
Sent: 13 February 2017 15:05
To: Smith, Kevin, (R&D) Vodafone Group <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: RE: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hello Kevin,

regards
Esko

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Smith, Kevin, (R&D) Vodafone Group
Sent: Wednesday, February 08, 2017 15:32
To: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Esko,

All best,
Kevin

-----

All best,
Kevin
Vodafone 

-----Original Message-----
From: core [mailto:[email-masked]] On Behalf Of Dijk, Esko
Sent: 08 February 2017 14:10
To: core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

best regards
Esko

-----Original Message-----
From: Dijk, Esko
Sent: Wednesday, February 01, 2017 9:50
To: 'Carsten Bormann' <[email-masked]>; Lauri Piikivi <[email-masked]>
Cc: core ([email-masked]) <[email-masked]>
Subject: RE: [core] CoAP response code in case of "response payload too large" ? 4.13?

Esko

-----Original Message-----
From: Carsten Bormann [mailto:[email-masked]]
Sent: Wednesday, February 01, 2017 8:22
To: Lauri Piikivi <[email-masked]>
Cc: Dijk, Esko <[email-masked]>; core ([email-masked]) <[email-masked]>
Subject: Re: [core] CoAP response code in case of "response payload too large" ? 4.13?

Hi Lauri,

Grüße, Carsten