When calling blobStore.blobMetadata(container, objectName).getSize() with a blobStoreContext using ApacheHCHttpCommandExecutorServiceModule, the returned BlobMetadata object has a size attribute which is null.
Issue spotted while using jclouds 2.1.2 over an S3 object store (Scality, but seems like it is reproducible with any other S3 provider, and potentially others OS providers like GCS, to be confirmed).
In essence, the minimal reproducer pseudo-code is:
For convenience, I've attached a ready to run reproducer to this ticket, here's how to run it:
The reproducer code has jclouds-wire logs enabled (inside log folder) and I've also added the log files inside the attached tarball for convenience. We see that in the HTTP HEAD response (the 2nd one, which correspond to my .blobMetadata() call using ApacheHCHttpCommandExecutorServiceModule), the Content-* headers are missing :
I suspect the issue is coming from ApacheHCHttpCommandExecutorService.java#invoke method, it seems to be expecting the content-* headers are exclusively coming from the reponse.getEntity() (which I believe is null in case of a response to a HEAD request), because it strips it out of the headers list (which are well containing the content-* headers before the call to "filterOutContentHeaders"). A possible fix to cope with all requests kinds could be to strip it out only if it is already part of the payload (which I guess was the initial intent).
- jclouds version: 2.1.2 (but it is probably reproducible on older versions, to be confirmed)
- Operating system: Linux (kernel 4.15.0-55)
- Storage provider: S3 (reproduced on both Scality and MinIO), probably reproducible with other storage providers involving HTTP HEAD requests to get the metadata (GCS, ..)
- Java version: