Re: RadosGW S3 range on a 0 byte object gives 416 Range Not Satisfiable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



RFC 7233

4.4 <https://datatracker.ietf.org/doc/html/rfc7233#section-4.4>.  416 Range Not Satisfiable

   The 416 (Range Not Satisfiable) status code indicates that none of
   the ranges in the request's Range header field (Section 3.1 <https://datatracker.ietf.org/doc/html/rfc7233#section-3.1>) overlap
   the current extent of the selected resource or that the set of ranges
   requested has been rejected due to invalid ranges or an excessive
   request of small or overlapping ranges.

   For byte ranges, failing to overlap the current extent means that the
   first-byte-pos of all of the byte-range-spec values were greater than
   the current length of the selected representation.  When this status
   code is generated in response to a byte-range request, the sender
   SHOULD generate a Content-Range header field specifying the current
   length of the selected representation (Section 4.2 <https://datatracker.ietf.org/doc/html/rfc7233#section-4.2>).

   For example:

     HTTP/1.1 416 Range Not Satisfiable
     Date: Fri, 20 Jan 2012 15:41:54 GMT
     Content-Range: bytes */47022

      Note: Because servers are free to ignore Range, many
      implementations will simply respond with the entire selected
      representation in a 200 (OK) response.  That is partly because
      most clients are prepared to receive a 200 (OK) to complete the
      task (albeit less efficiently) and partly because clients might
      not stop making an invalid partial request until they have
      received a complete representation.  Thus, clients cannot depend
      on receiving a 416 (Range Not Satisfiable) response even when it
      is most appropriate.


> On 21. 03 2022, at 15:11, Ulrich Klein <ulrich.klein@xxxxxxxxxxxxxx> wrote:
> 
> With a bit of HTTP background I’d say:
> bytes=0-1000000 means: First byte to to 1000000nd byte. First byte is byte #0
> On an empty object there is no first byte, i.e. not satisfiable ==> 416
> 
> Should be the same as on a single byte object and
> bytes=1-1000000
> 
> 200 OK should only be correct, if the server or a proxy in between doesn’t support range requests.
> 
> Ciao, Uli
> 
>> On 21. 03 2022, at 14:47, Kai Stian Olstad <ceph+list@xxxxxxxxxx> wrote:
>> 
>> Hi
>> 
>> Ceph v16.2.6.
>> 
>> Using GET with Range: bytes=0-1000000 it fails with 416 if the object is 0 byte.
>> I tried reading the http specification[1] on the subject but did not get any wiser unfortunately.
>> 
>> I did a test with curl and range against a 0 byte file on Nginx and it returned 200 OK.
>> 
>> Does anyone know it's correct to return 416 on 0 byte object with range or should this be considered a bug in Ceph.
>> 
>> 
>> [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1
>> 
>> -- 
>> Kai Stian Olstad
>> _______________________________________________
>> ceph-users mailing list -- ceph-users@xxxxxxx
>> To unsubscribe send an email to ceph-users-leave@xxxxxxx
> 
> _______________________________________________
> ceph-users mailing list -- ceph-users@xxxxxxx
> To unsubscribe send an email to ceph-users-leave@xxxxxxx

_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux