Parallel CI jobs sharing `TF_PLUGIN_CACHE_DIR` fail intermittently with `text file busy` or corrupt provider zips.
AdvancedTroubleshootingDependencies, Cycles and Providers
Answer
Likely causes → The plugin cache is not safe for concurrent writes; two terraform init runs write the same provider at once.
Diagnose → Failures only when jobs run in parallel on the same host.
Fix → Give each job its own cache dir, or pre-populate the cache in the image (read-only use is safe). Use CI cache keyed on .terraform.lock.hcl hash.
Prevent → Treat the plugin cache as per-job or pre-baked, never shared-writable across concurrent jobs.
More on Dependencies, Cycles and Providers
`Error: Cycle: aws_security_group.app, aws_security_group.db`.Beginner`Error: Cycle: local.name_prefix, local.tags`.BeginnerA cycle appears only after adding `depends_on = [module.app]` to a module. The error lists dozens of nodes.IntermediateAdding `create_before_destroy = true` to a launch template causes `Error: Cycle: ... (destroy deposed ...)`.Advanced`terraform init` fails: `Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints ~> 4.0, >= 5.30.0`.Intermediate`Error: Inconsistent dependency lock file` with `locked version selection 5.31.0 doesn't match the updated version constraints ">= 5.40.0"`.Beginner