You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, it's working well but the content type of all uploaded files is set to application/json. This can be verified by execing into the Docker container and running attr (might have to apk --update add it first) on the file.
# attr
A filename to operate on is required
Usage: attr [-LRSq] -s attrname [-V attrvalue] pathname # set value
attr [-LRSq] -g attrname pathname # get value
attr [-LRSq] -r attrname pathname # remove attr
attr [-LRq] -l pathname # list attrs
-s reads a value from stdin and -g writes a value to stdout
# attr -g metadata /storage/bucket/6d97b1f7-f3cb-49db-89a3-6039d01f24ba/b17d0638-275e-4864-b868-a13131131f69/original_file_0.jpg
Attribute "metadata" had a 463 byte value for /storage/bucket/6d97b1f7-f3cb-49db-89a3-6039d01f24ba/b17d0638-275e-4864-b868-a13131131f69/original_file_0.jpg:
{"ContentType":"application/json","ContentEncoding":"","Crc32c":"p7Um+Q==","Md5Hash":"r2DdsnVOdPUZweG4crCjog==","Etag":"\"r2DdsnVOdPUZweG4crCjog==\"","ACL":[{"Entity":"projectOwner-test-project","EntityID":"","Role":"OWNER","Domain":"","Email":"","ProjectTeam":null}],"Metadata":null,"Created":"2023-03-16T12:26:21.005992Z","Deleted":"0001-01-01T00:00:00Z","Updated":"2023-03-16T12:26:21.005996Z","CustomTime":"0001-01-01T00:00:00Z","Generation":1678969581005998}
Now this happens regardless of whether content_type is added to the original upload. Here is the output of the SDK with no content_type parameter. As you can see, no content_type is present in the initial upload, but the actual uploaded file ends up with a content type of application/json.
If we restart the GCS server and it reloads the files from disk, the content type is set correctly (again, can be verified by running attr on the file as well). I assume this is because of #531.
It would however be great if the content type would also be correct for newly uploaded files, when using resumable uploads!
It looks like this was addressed in #532 and supposedly fixed in #924 but it does not seem to be working.
I also tried passing in the ContentType via metadata, according to the fix mentioned here: #924.
As you can see, the metadata is even saved correctly, but the actualContentType is still set to application/json.
# attr -g metadata /storage/danni-dev/4dd472d2-9668-44a8-acb0-bb7126a2b0cf/1db2bb8b-73aa-410a-9d74-007bf111325d/original_file_0.jpg
Attribute "metadata" had a 486 byte value for /storage/danni-dev/4dd472d2-9668-44a8-acb0-bb7126a2b0cf/1db2bb8b-73aa-410a-9d74-007bf111325d/original_file_0.jpg:
{"ContentType":"application/json","ContentEncoding":"","Crc32c":"jnk9vw==","Md5Hash":"GwotjEH5otIJKB7HArHxLw==","Etag":"\"GwotjEH5otIJKB7HArHxLw==\"","ACL":[{"Entity":"projectOwner-test-project","EntityID":"","Role":"OWNER","Domain":"","Email":"","ProjectTeam":null}],"Metadata":{"ContentType":"image/jpeg"},"Created":"2023-03-16T14:47:55.90744Z","Deleted":"0001-01-01T00:00:00Z","Updated":"2023-03-16T14:47:55.907445Z","CustomTime":"0001-01-01T00:00:00Z","Generation":1678978075907447}
The text was updated successfully, but these errors were encountered:
Hey @fsouza! I saw you marked it as closed but then reopened it. Did #1141 not fix the issue?
I'm not sure if the issue is fixed by that PR, looking at it I don't think I see how. It ended-up getting closed automatically due to a comment in the PR body. I still plan to have a deeper look at this issue some time in the next couple of weeks.
Hi!
First of all, thank you for developing this. It's an invaluable tool for local development :)
We are using the latest version (
1.44.0
) with Ruby/Rails where the Google SDK always does resumable uploads.Generally, it's working well but the content type of all uploaded files is set to
application/json
. This can be verified byexec
ing into the Docker container and runningattr
(might have toapk --update add
it first) on the file.Now this happens regardless of whether
content_type
is added to the original upload. Here is the output of the SDK with nocontent_type
parameter. As you can see, nocontent_type
is present in the initial upload, but the actual uploaded file ends up with a content type ofapplication/json
.Now, as I mentioned, this even happens when you pass the correct
content_type
to the upload command.If we restart the GCS server and it reloads the files from disk, the content type is set correctly (again, can be verified by running
attr
on the file as well). I assume this is because of #531.It would however be great if the content type would also be correct for newly uploaded files, when using resumable uploads!
It looks like this was addressed in #532 and supposedly fixed in #924 but it does not seem to be working.
I also tried passing in the
ContentType
viametadata
, according to the fix mentioned here: #924.As you can see, the metadata is even saved correctly, but the actual
ContentType
is still set toapplication/json
.The text was updated successfully, but these errors were encountered: