ljfranklin / terraform-resource

A concourse resource to create infrastructure via Terraform
MIT License
185 stars 85 forks source link

"No satisfiable builds from passed jobs found for set of inputs" when using plan_only. #181

Open dumptruckman opened 2 years ago

dumptruckman commented 2 years ago

We have a UI deployment pipeline where there is a terraform-plan job (using plan_only: true) and terraform job (using plan_run: true, depending on passed terraform-plan). Additionally, we have a deploy job (depending on passed terraform). The shared resource between these three jobs is terraformer. Every now and then, when there is new UI source code (no terraform changes) to be deployed, the deploy job will kick off as usual but then hang "waiting for a suitable set of input versions" on the terraformer resource. We haven't been able to determine exactly what leads to this happening but it seems very random. Example, this morning I did a deployment (with no terraform changes) just fine but then needed to do another later (again, no terraform changes) and it would not kick off due to this issue. Here's what it looks like:

image

Interestingly, I got around this by updating the pipeline, removing the terraform-plan job and removing plan_run: true from the terraform job. After this change, the deploy immediately kicked off.

Any thoughts on what could be causing this issue?

dumptruckman commented 2 years ago

Some other notable finds:

We've seen this on another pipeline with a very similar setup and the fix was generally just to kick off a terraform plan job and that would allow the deployment to continue (no need to apply the plan to get the deploy kicked off).

When I "fixed" this today by removing the plan job from the pipeline, I first tried running the plan job to see if that would let the deploy continue. It did not. That's when I removed the plan job and afterwards the deploy kicked off.

I didn't mention the staging/production differences in my original description of the problem but it's worth noting now that I first did this to get a staging deploy out. Then the same thing happened on the prod deploy. Instead of trying to kick off a plan job for prod first, I simply removed the plan job. After removing it, the deployment still did not kick off. As such, I readded the plan job, ran it, then removed the plan job and the deployment finally kicked off.

dumptruckman commented 2 years ago

I just had this same thing happen without a plan job in the pipeline. Just having a build job that does a get: terraformer-stage with passed: [terraform-stage] seems lead to this issue as well. An hour ago I had a build job kick off automatically with no issues (no change to the terraform resource) and now just 15 minutes ago the build refuses to run because it cannot find a satisfiable build for the terraformer resource.

dumptruckman commented 2 years ago

I'm now noticing that the version list for the terraform resource just gets emptied every once in a while. I think that what I'm seeing is actually the same issue as describe here: https://github.com/ljfranklin/terraform-resource/issues/96