2

我正在 docker 容器中实现 Azure AutoML 仪表板。当我在没有 Docker 的情况下访问容器时,它可以工作。但在 docker 中,它给出了 SSL 错误。

def upload_dataset_to_blob(ws):

    datastore = ws.get_default_datastore()
    datastore.upload_files(files=[
                           '/usr/src/mediafiles/train.csv'], target_path='beeeerrr-dataset/tabular/', overwrite=True, show_progress=True)
    datastore.upload_files(files=[
                           '/usr/src/mediafiles/valid.csv'], target_path='beeeerrr-dataset/tabular/', overwrite=True, show_progress=True)
    datastore.upload_files(files=[
                           '/usr/src/mediafiles/test.csv'], target_path='beeeerrr-dataset/tabular/', overwrite=True, show_progress=True)

    train_dataset = Dataset.Tabular.from_delimited_files(
        validate=False,
        path=[(datastore, 'beeree-dataset/tabular/train.csv')])
    valid_dataset = Dataset.Tabular.from_delimited_files(
        validate=False,
        path=[(datastore, 'beeree-dataset/tabular/valid.csv')])
    test_dataset = Dataset.Tabular.from_delimited_files(

        path=[(datastore, 'beeree-dataset/tabular/test.csv')])

    return train_dataset, valid_dataset, test_dataset

这是我得到的错误

Uploading an estimated of 1 files
app_1     | Uploading /usr/src/mediafiles/train.csv
app_1     | Uploaded /usr/src/mediafiles/train.csv, 1 files out of an estimated total of 1
app_1     | Uploaded 1 files
app_1     | Uploading an estimated of 1 files
app_1     | Uploading /usr/src/mediafiles/valid.csv
app_1     | Uploaded /usr/src/mediafiles/valid.csv, 1 files out of an estimated total of 1
app_1     | Uploaded 1 files
app_1     | Uploading an estimated of 1 files
app_1     | Uploading /usr/src/mediafiles/test.csv
app_1     | Uploaded /usr/src/mediafiles/test.csv, 1 files out of an estimated total of 1
app_1     | Uploaded 1 files
app_1     | <bound method DataReference._get_normalized_path of $AZUREML_DATAREFERENCE_blob_test_data>
app_1     | Internal Server Error: /azureml/train/
app_1     | Traceback (most recent call last):
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/data/dataset_error_handling.py", line 65, in _validate_has_data        
app_1     |     dataflow.verify_has_data()
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/_loggerfactory.py", line 206, in wrapper
app_1     |     return func(*args, **kwargs)
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/dataflow.py", line 875, in verify_has_data
app_1     |     if len(self.take(1)._to_pyrecords()) == 0:
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/dataflow.py", line 792, in _to_pyrecords
app_1     |     self._engine_api.execute_anonymous_activity(
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/_aml_helper.py", line 38, in wrapper
app_1     |     return send_message_func(op_code, message, cancellation_token)
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/engineapi/api.py", line 120, in execute_anonymous_activity
app_1     |     response = self._message_channel.send_message('Engine.ExecuteActivity', message_args, cancellation_token)
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/engineapi/engine.py", line 291, in send_message
app_1     |     raise_engine_error(response['error'])
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/dataprep/api/errorhandlers.py", line 10, in raise_engine_error
app_1     |     raise ExecutionError(error_response)
app_1     | azureml.dataprep.api.errorhandlers.ExecutionError:
app_1     | Error Code: ScriptExecution.DatastoreResolution.Unexpected
app_1     | Failed Step: XXXXXXXXXXXXXXXXXXXXXXXXX
app_1     | Error Message: ScriptExecutionException was caused by DatastoreResolutionException.
app_1     |   DatastoreResolutionException was caused by UnexpectedException.
app_1     |     Unexpected failure making request to fetching info for Datastore 'workspaceblobstore' in subscription: 'XXXXXXXXXXXXXXXXXXXXXXXXX', resource group: 'django-env', workspace: 'ml-demo-main'. Using base service url: https://centralus.experiments.azureml.net. HResult: 0x80131501.
app_1     |       The SSL connection could not be established, see inner exception.
app_1     | | session_id=XXXXXXXXXXXXXXXXXXXXXXXXX
app_1     |
app_1     | During handling of the above exception, another exception occurred:
app_1     |
app_1     | Traceback (most recent call last):
app_1     |   File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
app_1     |     response = get_response(request)
app_1     |   File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
app_1     |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
app_1     |   File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
app_1     |     return self.dispatch(request, *args, **kwargs)
app_1     |   File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
app_1     |     return handler(request, *args, **kwargs)
app_1     |   File "/usr/src/app/azure_ml/views.py", line 50, in get
app_1     |     azureml_train1()
app_1     |   File "/usr/src/app/azure_ml/rough.py", line 39, in azureml_train1
app_1     |     train_dataset, valid_dataset, test_dataset = upload_dataset_to_blob(ws)
app_1     |   File "/usr/src/app/utils/azure_ml/dataset.py", line 28, in upload_dataset_to_blob
app_1     |     train_dataset = Dataset.Tabular.from_delimited_files(
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/data/_loggerfactory.py", line 126, in wrapper
app_1     |     return func(*args, **kwargs)
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/data/dataset_factory.py", line 322, in from_delimited_files
app_1     |     dataflow = _transform_and_validate(
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/data/dataset_factory.py", line 966, in _transform_and_validate
app_1     |     _validate_has_data(dataflow, 'Cannot load any data from the specified path. '
app_1     |   File "/usr/local/lib/python3.8/site-packages/azureml/data/dataset_error_handling.py", line 68, in _validate_has_data
app_1     |     raise DatasetValidationError(error_message + '\n' + e.compliant_message, exception=e)
app_1     | azureml.data.dataset_error_handling.DatasetValidationError: DatasetValidationError:
app_1     |     Message: Cannot load any data from the specified path. Make sure the path is accessible and contains data.
app_1     | ScriptExecutionException was caused by DatastoreResolutionException.
app_1     |   DatastoreResolutionException was caused by UnexpectedException.
app_1     |     Unexpected failure making request to fetching info for Datastore 'workspaceblobstore' in subscription: 'XXXXXXXXXXXXXXXXXXXXXXXXX', resource group: 'django-env', workspace: 'ml-demo-main'. Using base service url: https://centralus.experiments.azureml.net. HResult: 0x80131501.
app_1     |       Failed due to inner exception of type: HttpRequestException
app_1     | | session_id=XXXXXXXXXXXXXXXXXXXXXXXXX
app_1     |     InnerException None
app_1     |     ErrorResponse
app_1     | {
app_1     |     "error": {
app_1     |         "code": "UserError",
app_1     |         "message": "Cannot load any data from the specified path. Make sure the path is accessible and contains data.\nScriptExecutionException was caused by DatastoreResolutionException.\n  DatastoreResolutionException was caused by UnexpectedException.\n    Unexpected failure making request to fetching info for Datastore 'workspaceblobstore' in subscription: 'XXXXXXXXXXXXXXXXXXXXXXXXX', resource group: 'django-env', workspace: 'ml-demo-main'. Using base service url: https://centralus.experiments.azureml.net. HResult: 0x80131501.\n      Failed due to inner exception of type: HttpRequestException\n| session_id=XXXXXXXXXXXXXXXXXXXXXXXXX"
app_1     |     }
app_1     | }

它成功上传文件,但在返回时出现以下错误

我正在使用服务主体进行身份验证。

def get_workspace():

    svr_pr = ServicePrincipalAuthentication(
        tenant_id=settings.TENANT_ID,
        service_principal_id=settings.SERVICE_PRINCIPAL_ID,
        service_principal_password=settings.SERVICE_PRINCIPAL_PASSWORD
    )

    ws = Workspace(
        subscription_id=settings.SUBSCRIPTION_ID,
        resource_group=settings.RESOURCE_GROUP,
        workspace_name=settings.WORKSPACE_NAME,
        auth=svr_pr
    )

    return ws
4

1 回答 1

0

我遇到了同样的问题,经过一些调试,我在日志文件中发现了以下内容:

Failed to retrieve datastore with exception: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. 
---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
---> System.TypeInitializationException: The type initializer for 'SslMethods' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Ssl' threw an exception.
---> System.TypeInitializationException: The type initializer for 'SslInitializer' threw an exception.
---> Interop+Crypto+OpenSslCryptographicException: error:0E076071:configuration file routines:MODULE_RUN:unknown module name
   at Interop.SslInitializer..cctor()
   --- End of inner exception stack trace ---
   at Interop.Ssl..cctor()
   --- End of inner exception stack trace ---
   at Interop.Ssl.SslV2_3Method()
   at Interop.Ssl.SslMethods..cctor()
   --- End of inner exception stack trace ---

这将我指向这个线程:https ://github.com/dotnet/runtime/issues/29855

似乎 .NET 2.1 尝试使用 OpenSSL 1.0,而发行版的配置/etc/ssl/openssl.conf与它不兼容。据报道,这存在于多个 Debian 版本中。

可能的解决方案:

  • 注释掉 ssl_conf 中的值/etc/ssl/openssl.cnf
  • 卸载 OpenSSL 1.0.x
  • 设置CLR_OPENSSL_VERSION_OVERRIDE=1.1为强制使用 OpenSSL 1.1。(2.1 更喜欢绑定到 OpenSSL 1.0.x,因为这是它附带的......如果明确告知,或者如果 1.0 不可用,它只使用 1.1)

我尝试了最后一个,就我而言,它解决了问题。我正在使用 Debian Buster。

于 2021-12-17T13:19:34.657 回答