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

Deep structure in config causes "didn't match during apply" diff failures. #2971

Closed
bobtfish opened this issue Aug 10, 2015 · 3 comments
Closed

Comments

@bobtfish
Copy link
Contributor

I've thrown a basic https://nsone.net/ provider together, however the configuration for nsone answers is fairly complex, so I've used deeper structures than most other terraform providers use, and I think this is triggering a core bug.

My example code is here:

https://github.com/bobtfish/terraform-provider-nsone/blob/master/example/example.tf

Note that I'm interpolating into a 2 level deep structure, which I'm not sure any other providers actually do ;)

This reproducibly fails with 'diffs didn't match" during the first apply, but works correctly with a 2nd apply (and is fine from then on).

Run 1: https://github.com/bobtfish/terraform-provider-nsone/blob/master/example/tf.log
Run 2: https://github.com/bobtfish/terraform-provider-nsone/blob/master/example/tf_run2.log

The issue seems to be that we're diffing things in the first run before the variables are correctly interpolated.

Taking the log above, and extracting the interesting segments, we get:

  • example-elb-uswest1.aws.amazon.com:
    • answers.1032174583.answer: 2015/08/10 15:47:03 terraform-provider-nsone: 2015/08/10 15:47:03 Generated answersToHash 1032174583 from &{0x442470 map[2638768495:map[field:high_watermark feed:55c929e59f782d668e6945c9] 1274110464:map[feed:55c929e59f782d668e6945c9 field:low_watermark] 1749543754:map[field:connections feed:55c929e59f782d668e6945c9]] {{0 0} 1}}
    • answers.627144908.answer: 2015/08/10 15:46:59 terraform-provider-nsone: 2015/08/10 15:46:59 Generated answersToHash from 627144908 &{0x442470 map[-3018683288:map[field:low_watermark feed:${nsone_datafeed.uswest1.id}] -3109589890:map[field:connections feed:${nsone_datafeed.uswest1.id}] -2253003068:map[field:high_watermark feed:${nsone_datafeed.uswest1.id}]] {{0 0} 1
  • example-elb-useast1.aws.amazon.com:
    • answers.1718649719.answer: 2015/08/10 15:47:03 terraform-provider-nsone: 2015/08/10 15:47:03 Generated answersToHash 1718649719 from &{0x442470 map[4012555827:map[field:high_watermark feed:55c929e59f782d668e6945ca] 965981532:map[field:low_watermark feed:55c929e59f782d668e6945ca] 438647830:map[field:connections feed:55c929e59f782d668e6945ca]] {{0 0} 1}}
    • answers.3098951636.answer: 2015/08/10 15:46:59 terraform-provider-nsone: 2015/08/10 15:46:59 Generated answersToHash 3098951636 from &{0x442470 map[-4177336805:map[field:high_watermark feed:${nsone_datafeed.useast1.id}] -3445257025:map[field:low_watermark feed:${nsone_datafeed.useast1.id}] -3354366811:map[feed:${nsone_datafeed.useast1.id} field:connections]] {{0 0} 1}}

So in one diff, the '${nsone_datafeed.xxxx.id}' is intact, in the other it's been replaced with the generated id hash (e.g. 55c929e59f782d668e6945ca).

If you'd like to run this yourself, you can sign up to a free tier nsone account, which gives you more than enough records / queries to play around with this.

@bobtfish
Copy link
Contributor Author

I've renamed the example log files in the repository, they're now at https://github.com/bobtfish/terraform-provider-nsone/tree/master/example/record_feeds_monitoring

@mitchellh
Copy link
Contributor

Hey @bobtfish! Its been awhile and I don't think we handle this any cleaner but since we haven't ha any other provider require this I'm going to go ahead and close this. If someone submitted a PR to support this I'd be open to it, but otherwise its not on our plan atm.

@ghost
Copy link

ghost commented Apr 21, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants