Repository navigation
fix(AZURE_DNS): bug: intermittent "resource type does not match the type in the request body" errors - #5040
Merged
Conversation
…ype in the request body" errors
RecordSet.Type is READ-ONLY in the Azure API, but the SDK still
serializes it. We set it to the bare rtype (e.g. "NS"), which Azure now
(sometimes) rejects because it doesn't match the URL's resource type
("Microsoft.Network/dnsZones/NS"). Stop setting it; track the type in a
local variable instead. Same fix applied to AZURE_PRIVATE_DNS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
We've had random failures like this for years. Retrying always works. I finally thought to ask Claude if they had a suggestion. Turns out, the fix was easy: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Integration tests on AZURE_DNS intermittently fail on record create/update:
Cause
recordToNativeDiff2setRecordSet.Typeto the bare rtype (e.g."NS"). That field isREAD-ONLYin the API, but the SDK'sMarshalJSONstill serializes it, so every PUT sent"type": "NS". Azure appears to have started validating this field against the URL's resource type, apparently on only some backends, which is why the failures are intermittent. The error was seen on NS records, but any type is affected.Fix
Don't set
RecordSet.Typeon outgoing record sets. Track the type in a local variable (including theAZURE_ALIAS_*case) and use it only to pick theRecordTypefor the URL path.AZURE_PRIVATE_DNS had the identical pattern (its SDK also serializes
type), so the same fix is applied there.Testing
providers/azurednsandproviders/azureprivatednspass.🤖 Generated with Claude Code