Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.58k stars 2.79k forks source link

NXDOMAIN error when trying to get configuration from Azure #37835

Open erbek opened 3 days ago

erbek commented 3 days ago

Describe the bug Filed to connect to azure appconfiguration resulting in error: FAILED projects/shared-libs-python/tests/configuration/azure_config_manager/test_azure_config_manager_client.py::test_init[1] -

dns.resolver.NXDOMAIN: The DNS query name does not exist: _origin._tcp.pai-configuration-manager.azconfig.io.

To Reproduce

  1. Just connect to appservice configuration manager using the connection_string self.app_config = load(connection_string=self.connection_string, selects=selects)

Expected behavior Expected behavior is to receive configuration entries - it works fine in version 1.0.0 for me - however I need refresh feature

Screenshots

Additional context The issue is in azure\appconfiguration\provider_discovery.py lines 84-89: Image

the NXDOMAIN error is not properly handled and it causes a failure. I've fixed that by adding: except Exception as e: return []

in lines 90-91 but it should be fixed in the code. I am preparing the code fix in my branch and will ask for a pull request soon

github-actions[bot] commented 3 days ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

mrm9084 commented 3 days ago

This seems to be a duplicate of this, https://github.com/Azure/azure-sdk-for-python/issues/37773, where you said it was fixed by updating a dependency.

And can you clarity what you mean by NXDOMAIN not being handled? Also do you have the same issue in the non-beta version 1.3.0 which is the latest GA release.

erbek commented 2 days ago

This is not the same issue. By not being handled is that exception (NXDOMAIN) I mean that this line is condition is not met, even though the error is NXDOMAIN: [image: image.png] That's why I've added "all other" exception handler. Version 1.3.0: [image: image.png]

W dniu czw., 10 paź 2024 o 22:48 Matthew Metcalf @.***> napisał(a):

This seems to be a duplicate of this, #37773 https://github.com/Azure/azure-sdk-for-python/issues/37773, where you said it was fixed by updating a dependency.

And can you clarity what you mean by NXDOMAIN not being handled? Also do you have the same issue in the non-beta version 1.3.0 which is the latest GA release.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-python/issues/37835#issuecomment-2406011064, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACERCPLPNEBBMY7BHZ5RBMLZ23RY7AVCNFSM6AAAAABPWI47ROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBWGAYTCMBWGQ . You are receiving this because you authored the thread.Message ID: @.***>

mrm9084 commented 2 days ago

@erbek, I'm unable to replicate the error. The code that is part of is for auto discovery of replica store for auto failover. The case of NXDOMAIN, is the case where the store has no replicas. I've tested that case and see NXDOMAIN thrown and caught.

Have you tried the non beta version and could you tell me what version of dnspython you have installed?