0

This is related to the azure experiment run in the Microsoft Azure Machine Learning Studio. The experiment run fails with this stack trace:

Warning: Failed to setup Azure Machine Learning system code due to `type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'`. Your job will proceed but if you notice any issues, please contact Azure Support with this exception message.
/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/mlflow/tracking/_tracking_service/utils.py:213: UserWarning: Failure attempting to register store for scheme "adbazureml": type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'
  _tracking_store_registry.register_entrypoints()
/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/mlflow/tracking/_tracking_service/utils.py:213: UserWarning: Failure attempting to register store for scheme "azureml": type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'
  _tracking_store_registry.register_entrypoints()
/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py:93: UserWarning: Failure attempting to register artifact repository for scheme "adbazureml": type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'
  _artifact_repository_registry.register_entrypoints()
/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py:93: UserWarning: Failure attempting to register artifact repository for scheme "azureml": type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'
  _artifact_repository_registry.register_entrypoints()
Traceback (most recent call last):
  File "azure_ml_pipeline.py", line 7, in <module>
    from interface import step_factory
  File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/interface.py", line 3, in <module>
    from steps.evaluation import Evaluation
  File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/steps/__init__.py", line 1, in <module>
    from utils.data_container import DataContainer
  File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/utils/data_container.py", line 1, in <module>
    from azureml.core import Dataset
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/__init__.py", line 13, in <module>
    from .workspace import Workspace
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/workspace.py", line 22, in <module>
    from azureml._project import _commands
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_project/_commands.py", line 24, in <module>
    from azureml._workspace._utils import (
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_workspace/_utils.py", line 10, in <module>
    from azure.mgmt.storage import StorageManagementClient
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/storage/__init__.py", line 9, in <module>
    from ._storage_management_client import StorageManagementClient
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/storage/_storage_management_client.py", line 14, in <module>
    from azure.mgmt.core import ARMPipelineClient
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/__init__.py", line 29, in <module>
    from ._pipeline_client import ARMPipelineClient
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/_pipeline_client.py", line 28, in <module>
    from .policies import ARMAutoResourceProviderRegistrationPolicy, ARMHttpLoggingPolicy
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py", line 40, in <module>
    class ARMHttpLoggingPolicy(HttpLoggingPolicy):
  File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py", line 43, in ARMHttpLoggingPolicy
    DEFAULT_HEADERS_ALLOWLIST = HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST | set(
AttributeError: type object 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

Does anyone facing the issue recently know the fix for it?

yardstick17
  • 4,322
  • 1
  • 26
  • 33

1 Answers1

2

I tried the below code with the azure.core.pipeline.policies and HttpLoggingPolicy with azure core version set to - azure-core 1.26.4 which is the latest version and I did not receive attribute error on HttpLoggingPolicy .

Code:-

from azure.core.pipeline import PipelineRequest
from azure.core.pipeline.policies import HttpLoggingPolicy

policy = HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST
print(policy)

Output:-

enter image description here

enter image description here

My azure-core version after running pip list :-

enter image description here

HttpLoggingPolicy was added in # azure-core version 1.16.0. If you are using older version than 1.16.0 you will receive attribute not found error. Make sure you upgrade your azure-core version to the latest release like below:-

pip install azure-core==1.26.4

According to this link document- azure-core · PyPI and the point below from the above link document: - 1.7.0 (2020-07-06) -

  • Added http_logging_policy property on the Configuration object, allowing users to individually set the http logging policy of the config #12218
SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11
  • It did work after upgrading all azure dependencies. I had `azure-core==1.24.1` when I got those exceptions. These worked for me: `azure-core==1.26.4` `azureml-core==1.50.0` `azureml-defaults==1.50.0` – yardstick17 Apr 20 '23 at 12:19