Error: Failed to get Script: APIResponse does not contain the appropriate data

Hi Team,

We have Data source definition of script, which was working fine since 2023 and no recent changes are performed in that script, but suddenly it has started failing. Here are the details:

Definition:
data "genesyscloud_script" "testscript" { name = "testscript" }

main.tf
testscript-id = data.genesyscloud_script.testscript.id --> Failing on Get ID(Working earlier)

Error in Plan:
Error: Failed to get Script GET https://xxxpure.cloud/api/v2/scripts/published?pageSize=50&pageNumber=1&name=testscript giving up after 21 attempt(s)
│ {"resourceType":"genesyscloud_script","errorMessage":"Unable to build a message from the response because the APIResponse does not contain the appropriate data."}


│ with data.genesyscloud_script.testscript,
│ on data_source.tf line 17, in data "genesyscloud_script" "testscript":
│ 17: data "genesyscloud_script" "testscript" { name = "testscript" }

Can you please check if any changes are done in Get functionality?
As a workaround we have hardcoded script in main.tf and commented out data definition.

Regards,
Rohit S

Hi @Rohit.Sharma3 ! At first glance it looks like this could be a rate limit issue. How many script data sources are defined in your tf configuration?

Hi @charlie.conneely,

There are 17 resources which are deployed since long time and it was working fine till last week and suddenly started failing for only this one resource.

It is strange that it wouldn't work for one particular resource.

Our provider uses our platform Go SDK to make API calls. The "giving up after 21 attempt(s)" in the error message tells me that the built-in retry logic in our SDK is being exhausted.

In your tf config, if you set the provider field sdk_debug to true and re-run the command, you will be able to see what the API is returning when the data source is invoking GET https://{domain}/api/v2/scripts/published?pageSize=50&pageNumber=1&name=testscript. The debug logs will be written to sdk_debug.log in the same directory as your tf config. This information will help us to understand if the problem is coming from the scripts API, our Go SDK, or our Terraform provider.