Azure / Azure/azure-rest-api-specs

Log Analytics Table List by Workspace results in Unsupported api version - 2022-10-01

Open
#22,129 4 comments 1 reaction 0 assignees View on GitHub
customer-reported Monitor Monitor - LogAnalytics needs-team-attention question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

In https://github.com/Azure/azure-sdk-for-python/issues/28161 I opened an issue against the Python SDK. Using the `12.0.0` version of the Python SDK, trying to list the available Log Analytics tables resulted in a NoRegisteredProviderFound exception being thrown.

> Message: No registered resource provider found for location 'centralus' and API version '2021-06-01' for type 'workspaces/tables'. The supported api-versions are '2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2021-12-01-preview, 2022-10-01'. The supported locations are 'eastus, westeurope, southeastasia, australiasoutheast, westcentralus, japaneast, uksouth, centralindia, canadacentral, westus2, australiaeast, australiacentral, francecentral, koreacentral, northeurope, centralus, eastasia, eastus2, southcentralus, northcentralus, westus, ukwest, southafricanorth, brazilsouth, switzerlandnorth, switzerlandwest, germanywestcentral, australiacentral2, uaecentral, uaenorth, japanwest, brazilsoutheast, norwayeast, norwaywest, francesouth, southindia, koreasouth, jioindiacentral, jioindiawest, qatarcentral, canadaeast, westus3, swedencentral'.

The Python SDK team released an updated version, `13.0.0b6`, however this version results in a different error, apparently at the API layer:
> Content: Unsupported api version - 2022-10-01

A redacted version of the [debug output](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/debug_guide.md) is behind the cut

```
>>> print(log_analytics_client.tables.list_by_workspace(resource_group_name, workspace_name).next())

2023-01-10 09:02:11,512 - azure.core.pipeline.policies.http_logging_policy - INFO - Request URL: 'https://management.azure.com/subscriptions/****/resourceGroups/****/providers/Microsoft.OperationalInsights/workspaces/****/tables?api-version=REDACTED'
Request method: 'GET'
Request headers:
'Accept': 'application/json'
'x-ms-client-request-id': '****'
'User-Agent': 'azsdk-python-mgmt-loganalytics/13.0.0b6 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29)'
'Authorization': 'REDACTED'
No body was attached to the request
2023-01-10 09:02:19,303 - urllib3.connectionpool - DEBUG - https://management.azure.com:443 "GET /subscriptions/****/resourceGroups/****/providers/Microsoft.OperationalInsights/workspaces/****/tables?api-version=2022-10-01 HTTP/1.1" 400 36
2023-01-10 09:02:19,304 - azure.core.pipeline.policies.http_logging_policy - INFO - Response status: 400
Response headers:
'Cache-Control': 'no-cache'
'Pragma': 'no-cache'
'Content-Length': '36'
'Content-Type': 'text/plain; charset=utf-8'
'Expires': '-1'
'Strict-Transport-Security': 'REDACTED'
'X-Content-Type-Options': 'REDACTED'
'Server': 'Microsoft-IIS/10.0, Microsoft-IIS/10.0'
'X-Powered-By': 'REDACTED'
'x-ms-ratelimit-remaining-subscription-reads': '11997'
'x-ms-request-id': '****'
'x-ms-correlation-request-id': 'REDACTED'
'x-ms-routing-request-id': 'REDACTED'
'Date': 'Tue, 10 Jan 2023 14:02:18 GMT'
2023-01-10 09:02:19,304 - azure.mgmt.loganalytics._serialization - DEBUG - Ran into a deserialization error. Ignoring since this is failsafe deserialization
Traceback (most recent call last):
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1430, in _deserialize
found_value = key_extractor(attr, attr_desc, data)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1177, in rest_key_extractor
return working_data.get(key)
AttributeError: 'str' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1503, in failsafe_deserialize
return self(target_obj, data, content_type=content_type)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1375, in __call__
return self._deserialize(target_obj, data)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1445, in _deserialize
raise_with_traceback(DeserializationError, msg, err)
File "****/venv/lib/python3.8/site-packages/azure/core/exceptions.py", line 78, in raise_with_traceback
raise error.with_traceback(exc_traceback)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1430, in _deserialize
found_value = key_extractor(attr, attr_desc, data)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/_serialization.py", line 1177, in rest_key_extractor
return working_data.get(key)
azure.core.exceptions.DeserializationError: (", AttributeError: 'str' object has no attribute 'get'", 'Unable to deserialize to object: type', AttributeError("'str' object has no attribute 'get'"))
Traceback (most recent call last):
File "", line 1, in
File "****/venv/lib/python3.8/site-packages/azure/core/paging.py", line 128, in __next__
return next(self._page_iterator)
File "****/venv/lib/python3.8/site-packages/azure/core/paging.py", line 76, in __next__
self._response = self._get_next(self.continuation_token)
File "****/venv/lib/python3.8/site-packages/azure/mgmt/loganalytics/operations/_tables_operations.py", line 426, in get_next
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Invalid argument'
Content: Unsupported api version - 2022-10-01
```

Contributor guide

Open the contributing guide

Research direction

Start with the Log Analytics tables list_by_workspace request shown in the debug output and compare the requested 2022-10-01 API version with the service response. Review the linked Python SDK issue and the debug guide context; done means the request no longer returns “Unsupported api version” and the resulting error is handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.