<@ULVA73B9P> - we are on the teams account and are...
# ask-marvin
d
@Marvin - we are on the teams account and are using terraform for our deployments. Up until today, nothing changed, all deployments of resources have been working successfully. Today, I am seeing deployment errors for certain APIs. Not entirely sure how to proceed - I have run into issues with TF in the past. Others using the same module on my team are having no issues, but for some reason I am - curious if it's a TF quirk?
1
m
thought for 45.2 seconds
Given your situation, here are several steps to troubleshoot and resolve the deployment errors: 1. Local Terraform State - Run
terraform init
to ensure your local state is properly initialized - Clear your local Terraform cache:
rm -rf .terraform
- Re-initialize to ensure you have the latest provider versions 2. Authentication and Configuration - Verify your Prefect API key is still valid and properly set - Confirm your Prefect Cloud workspace settings haven't changed - Check that your Terraform provider configuration matches your team's current settings 3. Version Consistency - Compare your
terraform --version
output with your teammates - Check the Prefect provider version in your
.tf
files against your teammates' - Ensure you're using the same Terraform provider version as your colleagues 4. Specific Troubleshooting Steps - Run
terraform plan -refresh-only
to verify the current state without making changes - Use
terraform plan
with
-target
to test specific resources that are failing - Enable Terraform debug logging:
export TF_LOG=DEBUG
before running commands 5. Common Fixes - If only certain APIs are failing, try: - Running
terraform state rm
for the failing resources and re-applying - Checking for any recent changes in those specific API configurations - Verifying the resource definitions match exactly with working examples from your teammates Since your teammates' deployments are working, this suggests a local issue rather than a platform-wide problem. The most likely culprits are: - Local state divergence - Authentication token issues - Version mismatches - Cached provider information Could you share: 1. The specific error messages you're seeing? 2. Whether this affects all deployments or just specific ones? 3. The version of Terraform and the Prefect provider you're using? This would help narrow down the exact cause and provide more targeted solutions.
d
error
Copy code
│ Error: Error during read Deployment Schedule
│ 
│   with module.stg.prefect_deployment_schedule.schedule["stg--ml-forecasting-pipeline:train-0"],
│   on ../../../../../devops/infra/terraform/modules/aws_prefect_backend/prefect_deployments.tf line 55, in resource "prefect_deployment_schedule" "schedule":
│   55: resource "prefect_deployment_schedule" "schedule" {
│ 
│ Could not read Deployment Schedule, unexpected error: failed to decode response: http error: Get
│ "<https://api.prefect.cloud/api/accounts/{REMOVED}/workspaces/{REMOVED}/deployments/{REMOVED}/schedules>":
│ GET
│ <https://api.prefect.cloud/api/accounts/{REMOVED}/workspaces/{REMOVED}/deployments/{REMOVED}/schedules>
│ giving up after 5 attempt(s)
╵
╷
│ Error: Error during read Deployment Schedule
│ 
│   with module.stg.prefect_deployment_schedule.schedule["stg--ml-forecasting-pipeline:predict-0"],
│   on ../../../../../devops/infra/terraform/modules/aws_prefect_backend/prefect_deployments.tf line 55, in resource "prefect_deployment_schedule" "schedule":
│   55: resource "prefect_deployment_schedule" "schedule" {
│ 
│ Could not read Deployment Schedule, unexpected error: failed to decode response: http error: Get
│ "<https://api.prefect.cloud/api/accounts/{REMOVED}/workspaces/{REMOVED}/deployments/{REMOVED}/schedules>":
│ GET
│ <https://api.prefect.cloud/api/accounts/{REMOVED}/workspaces/{REMOVED}/deployments/{{REMOVED}/schedules>
│ giving up after 5 attempt(s)
m
what’s the provider version?
d
2.17.1
@Mitch Nielsen
for context, this was already deployed. made some updates to existing deployments. running plan and now hitting this error. everything is correct in terms of expected inputs
if it's helpful @Mitch Nielsen i can also send you the account ids if you retain those logs for tracing
in a direct message
here's a slice of the plan - the update is related to a TF tainted replace
Copy code
# module.stg.prefect_deployment_schedule.schedule["stg--ml-forecasting-pipeline:feature-engineering-0"] is tainted, so must be replaced
-/+ resource "prefect_deployment_schedule" "schedule" {
      + anchor_date        = (known after apply)
      ~ catchup            = false -> (known after apply)
      ~ created            = "2025-06-30T21:23:16Z" -> (known after apply)
      ~ day_or             = true -> (known after apply)
      ~ deployment_id      = "4b91714e-01e8-4f48-a89c-95be90791f3c" -> (known after apply)
      ~ id                 = "0c5e8319-88ef-4966-acbc-6cbb15e51053" -> (known after apply)
      ~ interval           = 0 -> (known after apply)
      ~ max_active_runs    = 1 -> (known after apply)
      ~ max_scheduled_runs = 0 -> (known after apply)
      + rrule              = (known after apply)
      ~ updated            = "2025-06-30T21:23:16Z" -> (known after apply)
        # (3 unchanged attributes hidden)
    }
m
is it possible at all to jump to a more recent version? There have been quite a few bug fixes and logging improvements
d
yeah - any suggested stable version or latest?
m
d
works ty!
m
oh nice meaning you don’t see the error anymore?
d
yeah plan was successful
thanks for looking
m
love it, no prob