Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynatrace_aws_credentials fails on update (could not map json) #362

Closed
mattBaumBeneva opened this issue Nov 22, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@mattBaumBeneva
Copy link

Describe the bug
It appears a bug was introduced to the aws_credentials resource starting with version 1.46.
When applying the configuration, even without modifications, the provider seems to reorder/delete-and-recreate the supporting services.

This results in failure with the following message:

11:18:48  │ Error: Could not map JSON at 'supportingServicesToMonitor[0].monitoredMetrics[0].statistic' near line 1 column 316
11:18:48  │ 
11:18:48  │   with module.AWS-test.dynatrace_aws_credentials.creds[0],
11:18:48  │   on ../../src/modules/blueprints/AWS/main.tf line 25, in resource "dynatrace_aws_credentials" "creds":
11:18:48  │   25: resource "dynatrace_aws_credentials" "creds" {

To Reproduce
Steps to reproduce the behavior:

  1. Apply dynatrace_aws_credentials with supporting services
  2. Apply configuration again
  3. See error

Expected behavior
This ressource should only be modified when necessary and should never produce inappropriate JSON.

Additional context
We have been able to confirm that this issue no longer occurs when rolling back from versions 1.47.x or 1.46.x to 1.45.0.
The issue seems to have been introduced with 1.46.x.

@mattBaumBeneva mattBaumBeneva added the bug Something isn't working label Nov 22, 2023
@mattBaumBeneva
Copy link
Author

this seems to be the same issue as:
#357

@Dynatrace-Reinhard-Pilz
Copy link
Member

Hello @mattBaumBeneva, thanks for reporting the issue.
Root cause here is like in #360 the known bug in the plugin-sdk.

What I cannot find a satisfying answer for is the question why a rollback to a specific other version leads to the problem to emerge less likely. I've checked our GitHub history - dynatrace_aws_credentials hasn't been touched since 1.45.0.
@EthanZmuda even reported in #357, that rolling back to 1.46.0 from 1.46.1 solves the issue for him. That release contained solely a fix for Dashboards and nothing else.

Release 1.47.1 will contain routines that are able to recognize empty blocks for this resource and ignore them.

Dynatrace-Reinhard-Pilz added a commit that referenced this issue Nov 23, 2023
@Dynatrace-Reinhard-Pilz
Copy link
Member

Hello @mattBaumBeneva , let me know if v1.47.1 indeed fixes your issues. Reproducing the problem is unfortunately a hit and miss, therefore I'd be grateful for feedback from your side.

@mattBaumBeneva
Copy link
Author

@Dynatrace-Reinhard-Pilz , for our specific case I was able to reproduce the error 4 times in our development environment, with 100% effectiveness.
After upgrading to 1.47.1, our build passed without error. The issue seems to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants