Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

huangapple go评论69阅读模式
英文:

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 &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;`. 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 &quot;adbazureml&quot;: type object &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;
  _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 &quot;azureml&quot;: type object &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;
  _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 &quot;adbazureml&quot;: type object &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;
  _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 &quot;azureml&quot;: type object &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;
  _artifact_repository_registry.register_entrypoints()
Traceback (most recent call last):
  File &quot;azure_ml_pipeline.py&quot;, line 7, in &lt;module&gt;
    from interface import step_factory
  File &quot;/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/interface.py&quot;, line 3, in &lt;module&gt;
    from steps.evaluation import Evaluation
  File &quot;/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/steps/__init__.py&quot;, line 1, in &lt;module&gt;
    from utils.data_container import DataContainer
  File &quot;/mnt/azureml/cr/j/e54eb5aef8a648e7bfb46dc654434eca/exe/wd/utils/data_container.py&quot;, line 1, in &lt;module&gt;
    from azureml.core import Dataset
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/__init__.py&quot;, line 13, in &lt;module&gt;
    from .workspace import Workspace
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/core/workspace.py&quot;, line 22, in &lt;module&gt;
    from azureml._project import _commands
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_project/_commands.py&quot;, line 24, in &lt;module&gt;
    from azureml._workspace._utils import (
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azureml/_workspace/_utils.py&quot;, line 10, in &lt;module&gt;
    from azure.mgmt.storage import StorageManagementClient
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/storage/__init__.py&quot;, line 9, in &lt;module&gt;
    from ._storage_management_client import StorageManagementClient
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/storage/_storage_management_client.py&quot;, line 14, in &lt;module&gt;
    from azure.mgmt.core import ARMPipelineClient
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/__init__.py&quot;, line 29, in &lt;module&gt;
    from ._pipeline_client import ARMPipelineClient
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/_pipeline_client.py&quot;, line 28, in &lt;module&gt;
    from .policies import ARMAutoResourceProviderRegistrationPolicy, ARMHttpLoggingPolicy
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py&quot;, line 40, in &lt;module&gt;
    class ARMHttpLoggingPolicy(HttpLoggingPolicy):
  File &quot;/azureml-envs/pytorch-1.10/lib/python3.8/site-packages/azure/mgmt/core/policies/__init__.py&quot;, line 43, in ARMHttpLoggingPolicy
    DEFAULT_HEADERS_ALLOWLIST = HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST | set(
AttributeError: type object &#39;HttpLoggingPolicy&#39; has no attribute &#39;DEFAULT_HEADERS_ALLOWLIST&#39;

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)

输出:

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

在运行 pip list 后,我的azure-core版本是:-

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

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:-

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

My azure-core version after running pip list :-

Azure ML experiment run failing with 'HttpLoggingPolicy' has no attribute 'DEFAULT_HEADERS_ALLOWLIST'

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

huangapple
  • 本文由 发表于 2023年4月20日 05:26:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76058926.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定