英文:
Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'
问题
这与在Microsoft Azure Machine Learning Studio中进行的Azure实验运行相关。实验运行失败,出现以下堆栈跟踪:
警告:由于“type object 'HttpLoggingPolicy'没有属性 'DEFAULT_HEADERS_ALLOWLIST'”,无法设置Azure Machine Learning系统代码。您的作业将继续进行,但如果您注意到任何问题,请使用此异常消息联系Azure支持。
/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/mlflow/tracking/_tracking_service/utils.py:213: 用户警告:尝试为方案“adbazureml”注册存储失败:type object 'HttpLoggingPolicy'没有属性 '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: 用户警告:尝试为方案“azureml”注册存储失败:type object 'HttpLoggingPolicy'没有属性 '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: 用户警告:尝试为方案“adbazureml”注册存储库失败:type object 'HttpLoggingPolicy'没有属性 '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: 用户警告:尝试为方案“azureml”注册存储库失败:type object 'HttpLoggingPolicy'没有属性 'DEFAULT_HEADERS_ALLOWLIST'
_artifact_repository_registry.register_entrypoints()
跟踪回溯(最近的调用最后):
File "azure_ml_pipeline.py",第7行,在<module>中
from interface import step_factory
File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/interface.py",第3行,在<module>中
from steps.evaluation import Evaluation
File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/steps/__init__.py",第1行,在<module>中
from utils.data_container import DataContainer
File "/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/utils/data_container.py",第1行,在<module>中
from azureml.core import Dataset
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/__init__.py",第13行,在<module>中
from .workspace import Workspace
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/workspace.py",第22行,在<module>中
from azureml._project import _commands
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_project/_commands.py",第24行,在<module>中
from azureml._workspace._utils import (
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_workspace/_utils.py",第10行,在<module>中
from azure.mgmt.storage import StorageManagementClient
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/storage/__init__.py",第9行,在<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",第14行,在<module>中
from azure.mgmt.core import ARMPipelineClient
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/__init__.py",第29行,在<module>中
from ._pipeline_client import ARMPipelineClient
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/_pipeline_client.py",第28行,在<module>中
from .policies import ARMAutoResourceProviderRegistrationPolicy, ARMHttpLoggingPolicy
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py",第40行,在<module>中
class ARMHttpLoggingPolicy(HttpLoggingPolicy):
File "/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py",第43行,在ARMHttpLoggingPolicy中
DEFAULT_HEADERS_ALLOWLIST = HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST | set(
AttributeError: type object 'HttpLoggingPolicy'没有属性 'DEFAULT_HEADERS_ALLOWLIST'
最近是否有人遇到这个问题并知道如何修复?
英文:
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?
答案1
得分: 2
我尝试了下面的代码,使用了azure.core.pipeline.policies和HttpLoggingPolicy,azure core版本设置为- azure-core 1.26.4 这是最新版本,我没有收到HttpLoggingPolicy的属性错误。
代码:
from azure.core.pipeline import PipelineRequest
from azure.core.pipeline.policies import HttpLoggingPolicy
policy = HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST
print(policy)
输出:
在运行 pip list
后,我的azure-core版本是:-
HttpLoggingPolicy是在 # azure-core版本1.16.0中添加的。如果您使用的版本早于1.16.0,您将收到属性未找到的错误。请确保将您的azure-core版本升级到像下面这样的最新版本:-
pip install azure-core==1.26.4
根据此链接文档- azure-core ·
PyPI 和上述链接文档中的以下内容:-
1.7.0 (2020-07-06) -
- 在
Configuration
对象上添加了http_logging_policy
属性,允许用户单独设置配置的http日志记录策略 #12218
英文:
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:-
My azure-core version after running pip list
:-
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论