Closed karelorigin closed 2 years ago
Hi @karelorigin This looks a bit weird to me. Note that the installed Packer version is not relevant for the provider as the provider uses the embedded Packer, not the installed one.
I'll have to take a look at this. Maybe an update to Packer 1.8.1 will be enough as we're currently still on 1.8.0.
@simaotwx, I see. Does the provider call itself? Not sure if an update to Packer will work, but it's worth trying.
@karelorigin Yes, it does call itself. Packer is included, mainly to allow use on Terraform Cloud and to prevent users from using an unsupported version.
Have you been able to reproduce it @simaotwx? The latest versions of terraform and the provider on TF Cloud (or on your local machine if you haven't executed packer init
yet) should be able to reproduce this issue
@karelorigin I will try to reproduce it soon. Packer init is run here by the provider.
I have released a new version with Packer 1.8.1 included, maybe that helps?
I use this Provider version 0.12.0 to build on Azure via TFC and I can't reproduce the issue.
@simaotwx, what Terraform version are you using on TF Cloud? It doesn't automatically upgrade and it definitely worked on 1.1.7 for me, my TF Cloud workspace now runs on 1.2.1.
Thanks for updating the embedded packer. I'll test it later today, but I'm starting to suspect that it's somehow a terraform issue.
@karelorigin I'm using 1.1.9. Maybe 1.2.x introduced a regression or the plugin framework needs to be upgraded. I will check on this.
I changed the version to 1.2.2 and started a Plan & Apply run which has already successfully produced images. I need a 100% reproducible example that is easy to set up and run.
Thanks for checking. I had the exact same scenario but instead identical terraform code suddenly stopped being able to build images. It does work locally as I mentioned earlier. I'll try again tonight, perhaps it was just a fluke in TF Cloud.
Might have just been a fluke since nothing was changed before it stopped working. Looking forward to your report.
Please let me know if it was just a fluke
There's been no activity for this issue for over a month so I will close this issue. Feel free to reopen if the issue persists and you have more information for us.
Sorry for the late response. When I originally opened this issue, I had already tried various times on different days. Even though this error no longer appears, the TF Cloud run just stops with no additional information.
These are the last few lines in the TF Cloud output:
2022-07-21T09:44:54.958Z [INFO] provider.terraform-provider-scaleway_v2.2.2: 2022/07/21 09:44:54 [DEBUG] [DEBUG] GET https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/23419bf9-6c5c-4786-afa8-6e3750c8ebac: timestamp=2022-07-21T09:44:54.847Z
module.hashistack.module.bastion[0].packer_image.bastion: Still creating... [3m22s elapsed]
module.hashistack.module.nomad-client[0].packer_image.nomad: Still creating... [3m22s elapsed]
module.hashistack.module.consul[0].packer_image.consul: Still creating... [3m23s elapsed]
module.hashistack.module.nomad[0].packer_image.nomad: Still creating... [3m23s elapsed]
module.hashistack.module.vault[0].packer_image.vault: Still creating... [3m23s elapsed]
Keep in mind that Terraform runs in debug mode here, so anything interesting should've been logged. Doesn't appear that it saved any previously created resources to state either, so it could be a Terraform Cloud issue. Not sure why this is happening though. I even tried to recreate the workspace but same problem.
@karelorigin Thanks for your feedback. Have you tried contacting TF Cloud support? They usually are pretty quick and competent. Maybe they can give a little insight into what is happening here. I could imagine that creating 5 images at the same time could have an effect on this. The provider should be able to handle that, though.
The log should contain some error message with all the stack trace output etc. explaining what happened in case of a crash. This does not seem to be present here so I assume it's got to be something else.
@simaotwx, looks like it might indeed be a TF Cloud issue. Thing is that I didn't make any changes and it used to work fine. The entire setup just stopped working overnight.
That's good to know, I'll contact TF Cloud support and see what they have to say. :)
Not sure what suddenly caused this issue to appear, perhaps I updated Packer or the provider (or both). Seems like Packer no longer ships certain builder plugins by default. Currently using Terraform
1.2.1
, Packer1.8.1
, and Provider0.11.0
.It could be fixed by manually initializing all packer plugins, but the code is no longer portable, which causes issues with my GitHub Action workflows.