Open vfedoriv opened 3 weeks ago
nvm, seems like upgrading Terraform to Terraform v1.9.5 version solved the issue
UPD. Still the issue with the new terraform version (flaky) from logs:
Arch file size: 161841152
Arch file size: 177012736
Arch file size: 192774144
Arch file size: 208732160
Arch file size: 222494720
Arch file size: 231899136
Arch file size: 235031211
Arch file size: 235031211
Arch file size: 235031211
What I have: terraform code that deploys VM on GCP It contains a startup script
and this template has code
that should unpack the file from
/tmp
dir, then put some files in another place.those
my_archive_name
file should be uploaded by the file provisioner.What I see:
Terraform apply executed successfully, and an instance was created. The file provisioner successfully uploaded the file in /tmp dir, but SOMETIME there are a few missing files (expected as the result of the unpack operation) If I manually unpack the archive from /tmp dir, files are present After I recalled that tar can unpack an archive even if it's incomplete, and missing files seem to be at the end of the archive, I added a delay before the unpack command to check if the arch file size is not changing Log results: Arch file size: 210403328 Arch file size: 235031211 Arch file size: 235031211
So it seems that or file provisioner "finished" before upload was fully completed (async?) or startup-script started prematurely
Expected behavior
startup-script should be executed after file provisioner completely uploaded the file
Observed behavior
startup-script starts before file provisioner completely uploaded the file
Terraform Configuration
Terraform Version
Additional information
No response