Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.
Terraform Version
Terraform v1.5.5
on darwin_arm64
Affected Resource(s)
google_storage_bucket_object
Terraform Configuration Files
# gsutil rsync failed
resource "google_storage_bucket_object" "train-template_base_terraform_object" {
name = "train-template_base_terraform/" # folder name should end with '/'
content = " " # content is ignored but should be non-empty
bucket = "dddwsd-test"
}
# gsutil rsync succeed
resource "google_storage_bucket_object" "train-template_base_terraform2_object" {
name = "train-template_base_terraform2/empty"
content = "empty"
bucket = "dddwsd-test
}
Debug Output
Panic Output
~/test ī° gsutil rsync -r gs://dddwsd-test/train-template_base_terraform terraform/
WARNING: gsutil rsync uses hashes when modification time is not available at
both the source and destination. Your crcmod installation isn't using the
module's C extension, so checksumming will run very slowly. If this is your
first rsync since updating gsutil, this rsync can take significantly longer than
usual. For help installing the extension, please see "gsutil help crcmod".
Building synchronization state...
Starting synchronization...
Copying gs://dddwsd-test/train-template_base_terraform/...
Skipping attempt to download to filename ending with slash
(terraform/). This typically happens when using gsutil to download
from a subdirectory created by the Cloud Console
(https://cloud.google.com/console)
InvalidUrlError: Invalid destination path: terraform/.
Expected Behavior
in both gcs object, "gsutil rsync" operation should have completed successfully.
Actual Behavior
only "train-template_base_terrafom2" object has successfully finished "gsutil rsync"
To sum up, I think it would be better to set the content-length to 0 or insert an empty file when creating an empty folder through google_storage_bucket_object.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
in both gcs object, "gsutil rsync" operation should have completed successfully.
Actual Behavior
only "train-template_base_terrafom2" object has successfully finished "gsutil rsync"
Steps to Reproduce
terraform apply
mkdir terraform
gsutil rsync -r gs://${bucket_name}/train-template_base_terraform terraform/
Important Factoids
To sum up, I think it would be better to set the content-length to 0 or insert an empty file when creating an empty folder through google_storage_bucket_object.
References
0000