"gzip: invalid header" with a `.gz` artifact

Hi! I have an artifact with the following setup:

artifact {
    # Notably, not a .tar.gz
    source      = "https://somedomain/some_gzipped_file.gz"
    destination = "local/kernel"
    mode = "file"
}

for which I get the following error:

failed to download artifact "http://somedomain/some_gzipped_file.gz": gzip: invalid header

Any idea what I’m doing wrong?


About the .gz

I’m reasonably sure this is a normal, reasonable gzip file.

The gzipped file is created with the following:

gzip --no-name --stdout \
    "${SOME_INPUT_FILE}" \
    > "${SOME_TARGET_GZ_FILE}"

I can successfully un-gzip it:

# for the record, SOME_TARGET_GZ_FILE="filecracker_kernel.gz"
gzip --keep --decompress "${SOME_TARGET_GZ_FILE}"
# a file called `firecracker_kernel` of the expected 
# size shows up in the same directory

Some other notes

  • the artifact stanza documentation doesn’t explicitly call out .gz as supported, but the go-getter docs do.
  • I previously had a “.tar.gz” in this “.gz”'s spot, that would download and decompress correctly; so I’m reasonably sure that the downloading part of this artifact is behaving itself.

Actually, a possibility:
my some_domain here is an instance of Localstack pretending to be S3.
It’s possible that the content-type (currently unset for both upload and consumption) is perhaps causing the file to be handled incorrectly