Can anyone clarify why genesyscloud_analytics_report returns a 500 Internal Server Error during terraform apply? The report definition is valid in the UI, but the CLI fails on the initial creation step.
Error: POST https://api-us.genesyscloud.com/api/v2/analytics/reports 500 Internal Server Error
Custom reports must reference existing data actions or queues. Ensure all dependencies exist before creation.
Dependencies are present. Using provider v1.36.0. Any known issues with the analytics endpoint?
The simplest way to resolve this is to ensure the data_actions array in the Terraform config explicitly references existing actions, as the API rejects undefined dependencies during the initial POST.
{
"data_actions": [
{
"id": "existing-data-action-id-here",
"name": "Call Detail Record"
}
]
}
TL;DR: Verify data action IDs exist before report creation to avoid 500 errors.
The problem here is often a race condition between resource provisioning and dependency validation. While the suggestion above correctly identifies the need for explicit data_actions references, the 500 error typically indicates the API cannot resolve those IDs at the moment of the POST request. If the data actions are created in the same Terraform module, the state file might not yet reflect their existence when the report resource is processed.
Try adding an explicit depends_on block in the Terraform configuration to force sequential execution. This ensures the data actions are fully committed to the platform before the analytics report definition is submitted. Additionally, check the Genesys Cloud audit logs for the specific timestamp of the failure. Often, the backend service returns a generic 500 when it encounters a transient lookup failure for metadata, rather than a precise 404. Confirming the dependency order usually resolves this immediate block.