Skip to content

[Core] Add rpds-py runtime pin to prevent connectedk8s import failure#33466

Draft
Copilot wants to merge 3 commits into
devfrom
copilot/fix-module-not-found-error-again
Draft

[Core] Add rpds-py runtime pin to prevent connectedk8s import failure#33466
Copilot wants to merge 3 commits into
devfrom
copilot/fix-module-not-found-error-again

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

Related command
az connectedk8s connect --name <name> --resource-group <rg>

Description
Recent connectedk8s flows can fail at import time with ModuleNotFoundError: No module named 'rpds.rpds' when extension dependency chains resolve through jsonschema/referencing. This change ensures rpds-py is always present in Azure CLI runtime dependency sets.

  • Dependency manifest updates

    • Added rpds-py~=0.29.0 to /tmp/workspace/Azure/azure-cli/src/azure-cli/setup.py
    • Added rpds-py==0.29.0 to:
      • /tmp/workspace/Azure/azure-cli/src/azure-cli/requirements.py3.windows.txt
      • /tmp/workspace/Azure/azure-cli/src/azure-cli/requirements.py3.Linux.txt
      • /tmp/workspace/Azure/azure-cli/src/azure-cli/requirements.py3.Darwin.txt
  • Runtime effect

    • Prevents missing rpds.rpds in CLI environments where extensions load jsonschema dependency stacks.
# Newly ensured import path in runtime environments
import rpds.rpds

Testing Guide
Repro/verification command path:

  • Run az connectedk8s connect --name <name> --resource-group <rg> in an environment using updated dependency pins.
  • Confirm extension import path no longer fails with ModuleNotFoundError: rpds.rpds.

History Notes
[Core] az connectedk8s connect: ensure rpds-py is included in CLI runtime dependency pins to prevent rpds.rpds import failures.


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 28, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 28, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan

yonzhan commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Fix

Copilot AI changed the title [WIP] Fix ModuleNotFoundError for rpds.rpds [Core] Add rpds-py runtime pin to prevent connectedk8s import failure May 28, 2026
Copilot AI requested a review from a0x1ab May 28, 2026 10:15
Copilot finished work on behalf of a0x1ab May 28, 2026 10:15
@a0x1ab

a0x1ab commented Jun 10, 2026

Copy link
Copy Markdown
Member

Live test results — azdev test connectedk8s --live --series

FAIL (exit 1)

Target: connectedk8s (extension)
PR head ref: copilot/fix-module-not-found-error-again
PR head sha: 82af13af4a7a1f891e43c41edaa5deb73e0f87ee
PR base ref: dev
New test files in PR: false

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/27275369923

Last 80 lines of azdev output
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <azure.mgmt.resource.resources.v2024_11_01.operations._operations.ResourceGroupsOperations object at 0x7f72a38789b0>
resource_group_name = 'conk8stestd5cdlc'
parameters = <azure.mgmt.resource.resources.v2024_11_01.models._models_py3.ResourceGroup object at 0x7f72a3878950>
kwargs = {}
error_map = {304: <class 'azure.core.exceptions.ResourceNotModifiedError'>, 401: <class 'azure.core.exceptions.ClientAuthenticatio..., 404: <class 'azure.core.exceptions.ResourceNotFoundError'>, 409: <class 'azure.core.exceptions.ResourceExistsError'>}
_headers = {}, _params = {}, api_version = '2024-11-01'
content_type = 'application/json', cls = None
_json = {'location': 'eastus2euap', 'tags': {'cause': 'automation', 'date': '2026-06-10T12:16:59Z', 'module': 'connectedk8s', 'product': 'azurecli', ...}}

    @distributed_trace
    def create_or_update(
        self, resource_group_name: str, parameters: Union[_models.ResourceGroup, IO[bytes]], **kwargs: Any
    ) -> _models.ResourceGroup:
        """Creates or updates a resource group.
    
        :param resource_group_name: The name of the resource group to create or update. Can include
         alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
         that match the allowed characters. Required.
        :type resource_group_name: str
        :param parameters: Parameters supplied to the create or update a resource group. Is either a
         ResourceGroup type or a IO[bytes] type. Required.
        :type parameters: ~azure.mgmt.resource.resources.v2024_11_01.models.ResourceGroup or IO[bytes]
        :return: ResourceGroup or the result of cls(response)
        :rtype: ~azure.mgmt.resource.resources.v2024_11_01.models.ResourceGroup
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map: MutableMapping = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})
    
        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
    
        api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-11-01"))
        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
    
        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = self._serialize.body(parameters, "ResourceGroup")
    
        _request = build_resource_groups_create_or_update_request(
            resource_group_name=resource_group_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        _request.url = self._client.format_url(_request.url)
    
        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            _request, stream=_stream, **kwargs
        )
    
        response = pipeline_response.http_response
    
        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
>           raise HttpResponseError(response=response, error_format=ARMErrorFormat)
E           azure.core.exceptions.HttpResponseError: (LocationNotAvailableForResourceGroup) The provided location 'eastus2euap' is not available for resource group. List of available regions is 'eastasia,southeastasia,austriaeast,australiaeast,australiacentral,australiacentral2,australiasoutheast,belgiumcentral,brazilsouth,canadacentral,canadaeast,switzerlandnorth,chilecentral,denmarkeast,germanywestcentral,eastus2,eastus,centralus,northcentralus,francecentral,uksouth,ukwest,indonesiacentral,israelcentral,centralindia,southindia,jioindiawest,italynorth,japaneast,japanwest,koreacentral,koreasouth,malaysiawest,mexicocentral,northeurope,norwayeast,newzealandnorth,polandcentral,qatarcentral,spaincentral,swedencentral,uaenorth,westcentralus,westeurope,westus2,westus,southcentralus,westus3,southafricanorth,westindia,jioindiacentral'.
E           Code: LocationNotAvailableForResourceGroup
E           Message: The provided location 'eastus2euap' is not available for resource group. List of available regions is 'eastasia,southeastasia,austriaeast,australiaeast,australiacentral,australiacentral2,australiasoutheast,belgiumcentral,brazilsouth,canadacentral,canadaeast,switzerlandnorth,chilecentral,denmarkeast,germanywestcentral,eastus2,eastus,centralus,northcentralus,francecentral,uksouth,ukwest,indonesiacentral,israelcentral,centralindia,southindia,jioindiawest,italynorth,japaneast,japanwest,koreacentral,koreasouth,malaysiawest,mexicocentral,northeurope,norwayeast,newzealandnorth,polandcentral,qatarcentral,spaincentral,swedencentral,uaenorth,westcentralus,westeurope,westus2,westus,southcentralus,westus3,southafricanorth,westindia,jioindiacentral'.

.venv/lib/python3.12/site-packages/azure/mgmt/resource/resources/v2024_11_01/operations/_operations.py:5922: HttpResponseError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
============================== 1 failed in 2.45s ===============================

Posted by agent-assist live-test workflow.

@a0x1ab a0x1ab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: PR #33466 — [Core] Add rpds-py runtime pin to prevent connectedk8s import failure

✅ CI checks (94/94 passed)

All automated CI checks on the PR head (82af13af) passed, including unit tests, lint, style, packaging, and full integration tests.

❌ Live test — connectedk8s (extension) — FAILED

The live test run (#27275369923) failed with 1 test failure:

azure.core.exceptions.HttpResponseError: (LocationNotAvailableForResourceGroup)
The provided location 'eastus2euap' is not available for resource group.

The test attempted to create a resource group in eastus2euap (an Azure canary region), but that region is not available in the test subscription. This appears to be a test environment / region configuration issue rather than a bug introduced by this PR — the PR only adds a rpds-py~=0.29.0 dependency pin and does not touch any connectedk8s test fixtures or region settings.

Action needed

@copilot — Please investigate whether the connectedk8s live tests hard-code eastus2euap as the test location. If so, update the test to use a generally available region (e.g. eastus, westus2), or make the region configurable via an environment variable. The fix to the dependency pin itself looks correct.

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/27275369923


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Review: PR #33466 — [Core] Add rpds-py runtime pin to prevent connectedk8s import failure

✅ CI checks (94/94 passed)...

Investigated. The failure is coming from the extension test source, not this core repo:

  • Failing test: azure-cli-extensions/src/connectedk8s/azext_connectedk8s/tests/latest/test_connectedk8s_scenario.py::Connectedk8sScenarioTest::test_connect
  • That file hard-codes CONFIG["location"] = "eastus2euap" (line ~41), and all @ResourceGroupPreparer(... location=CONFIG["location"]) usages inherit it.

There is no connectedk8s test source in this repository to patch. The fix needs to be made in Azure/azure-cli-extensions (switch to a GA region or read location from env/config), then consumed by live-test runs.

Copilot AI requested a review from a0x1ab June 10, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'rpds.rpds'

5 participants