BUNNY_DNS: Error After Zone Creation (The Bunny is Too Fast)
Describe the bug
There appears to be a race condition in the Bunny DNS provider when a given zone needs to be created. From my testing, it looks like the following is happening:
- Zone detected as absent.
- Zone created, Bunny returns OK.
- NS's need to be queried for this newly created zone.
- An exception is thrown, as this zone does not exist (likely eventually consistent?).
To Reproduce
Steps to reproduce the behavior:
- Configure the Bunny DNS (
bunny_dns) provider. - Create a zone that does not exist in the Bunny account.
- Observe that sometimes zone creation succeeds, but sometimes fails when querying for this zone again (in the same push operation). When a failure occurs, immediately attempting to push, succeeds.
#1: Create zone '<domain>' in the 'bunny_dns' profile
WARNING: BUNNY_DNS: Added zone <domain> with ID 206015SUCCESS!
INFO#1: Domain "<domain>" provider bunny_dns Error: "<domain>" is not a zone in this BUNNY_DNS account
INFO#1: DtermineNS: zone "<domain>"; Error: error while getting Nameservers for zone="<domain>" with provider="bunny_dns": "<domain>" is not a zone in this BUNNY_DNS account
Done. 1 corrections.
Expected behavior
Ideally, the provider should verify existence here and retry in the case the zone doesn't exist, likely with some pause.
https://github.com/StackExchange/dnscontrol/blob/df1354bef62d6d22b072d84735eb3b4ac2963c37/providers/bunnydns/listzones.go#L19-L32
DNS Provider
- Bunny DNS
Additional context
🐰
CC @ppmathis
@Silvenga Sorry for the wait, I've received this issue while on vacation, and it then slipped through the cracks on my side. While working on the Bunny DNS provider for other reasons (fixing the Null MX test cases), I remembered and just spent some time analysing your reported issue. Is this still something you are facing / able to reproduce?
I'm asking as I've written several scenarios and created over 500 zones in various ways via DNSControl and was never able to reproduce the issue. Putting in a loop to wait is indeed trivial and I already have a branch for that, but I wanted to make sure that this is actually still needed - in an ideal world, the Bunny DNS API would guarantee that the zone is available after its creation, and I think they might have fixed that?
Thanks in advance for your feedback - if you should still encounter these issues, I'll get my branch cleaned up asap and send in a PR.
@ppmathis Yeah, I haven't see the issue after that day - although, it was reproducible, I'll say, 80% of the time. Around this time, I was in contact with Bunny support around 500 errors, all of which seem to be resolved. Reading between the lines, I suspect there was some issues with maybe just my account... hard to tell.
Either way, I think it's sensible to withhold the looping, as the race is no longer reproducible (and hopefully was an issue on Bunny's side). I recently migrated 20+ domains into BunnyDNS, all succeeded.
@Silvenga Thanks a lot for the quick feedback and great to hear that you were no longer facing any issues. I fully agree with you that given the race is no longer occurring and was probably just a temporary thing, skipping the implementation of a waiting loop is probably the cleaner choice.
@tlimoncelli Could you please close this issue if you agree with this as well? Thanks a lot!
Oh, and I forgot to mention my gratitude towards you @ppmathis - thanks for building this provider! Your attention speak volumes for the pride in your work. 😸
Thanks for looking into this, folks!