針對受管理的功能存放區進行疑難排解

在本文中,了解如何針對 Azure Machine Learning 中受管理的功能存放區可能會遇到的常見問題進行疑難排解。

建立和更新功能存放區時發現的問題

當您建立或更新功能存放區時,可能會遇到以下問題:

ARM 節流錯誤

徵兆

功能存放區建立或更新失敗。 錯誤外觀如下:

{
  "error": {
    "code": "TooManyRequests",
    "message": "The request is being throttled as the limit has been reached for operation type - 'Write'. ..",
    "details": [
      {
        "code": "TooManyRequests",
        "target": "Microsoft.MachineLearningServices/workspaces",
        "message": "..."
      }
    ]
  }
}

解決方案

請稍後執行功能存放區建立/更新作業。 由於部署有多個步驟,因此第二次嘗試可能會因為某些資源已經存在而失敗。 請刪除這些資源並繼續作業。

RBAC 權限錯誤

若要建立功能存放區,使用者需要 ContributorUser Access Administrator 角色 (或涵蓋動作相同集合或超集的自訂角色)。

徵兆

如果使用者沒有必要的角色,部署就會失敗。 錯誤回應如下所示

{
  "error": {
    "code": "AuthorizationFailed",
    "message": "The client '{client_id}' with object id '{object_id}' does not have authorization to perform action '{action_name}' over scope '{scope}' or the scope is invalid. If access was recently granted, please refresh your credentials."
  }
}

解決方案

請在要建立功能存放區的資源群組中,將 ContributorUser Access Administrator 角色授與使用者。 然後,指示使用者再次執行部署。

如需詳細資訊,請參閱 feature store materialization managed identity 角色的必要權限

重複具體化身分識別 ARM 識別碼問題

在初次更新功能存放區以啟用具體化後,對功能存放區執行的後續更新可能會導致此錯誤。

徵兆

使用 SDK/CLI 更新功能存放區時,更新會失敗,並出現此錯誤訊息:

錯誤:

{
  "error":{
    "code": "InvalidRequestContent",
    "message": "The request content contains duplicate JSON property names creating ambiguity in paths 'identity.userAssignedIdentities['/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{your-uai}']'. Please update the request content to eliminate duplicates and try again."
  }
}

解決方案

此問題牽涉到 materialization_identity ARM 識別碼格式的 ARM 識別碼。

從 Azure UI 或 SDK,使用者指派的受控識別的 ARM 識別碼會使用小寫 resourcegroups。 請參閱此範例:

  • (A):/subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{your-uai}

當功能存放區使用使用者指派的受控識別作為 materialization_identity 時,其 ARM 識別碼會正規化並與 resourceGroups 一起儲存。 請參閱此範例:

  • (B):/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{your-uai}

在更新要求中,您可以使用符合具體化身分識別的使用者指派身分識別來更新功能存放區。 如果您針對該用途使用該受控識別,使用格式 (A) 的 ARM 識別碼時,更新會失敗,並傳回先前的錯誤訊息。

若要修正此問題,請在使用者指派的受控識別 ARM 識別碼中,將 resourcegroups 字串取代為 resourceGroups。 然後,再次執行功能存放區更新。

舊版 azure-mgmt-authorization 套件不適用於 AzureMLOnBehalfOfCredential

徵兆

當您使用 azureml-examples 存放庫中 featurestore_sample 資料夾提供的 setup_storage_uai 指令碼時,指令碼會失敗,並出現此錯誤訊息:

AttributeError: 'AzureMLOnBehalfOfCredential' object has no attribute 'signed_session'

解決方案:

檢查已安裝 azure-mgmt-authorization 套件的版本,並確認您使用的是最新版本,至少為 3.0.0 或更新版本。 例如 0.61.0 的舊版不適用於 AzureMLOnBehalfOfCredential

功能集規格建立錯誤

功能集合規格中的結構描述無效

在將功能集合登錄到功能存放區之前,請先在本機定義功能集合規格,然後執行 <feature_set_spec>.to_spark_dataframe() 加以驗證。

徵兆

當使用者執行 <feature_set_spec>.to_spark_dataframe() 時,如果功能集資料框架結構描述與功能集規格定義不一致,可能會發生各種結構描述驗證失敗。

例如:

  • 錯誤訊息:azure.ai.ml.exceptions.ValidationException: Schema check errors, timestamp column: timestamp is not in output dataframe
  • 錯誤訊息:Exception: Schema check errors, no index column: accountID in output dataframe
  • 錯誤訊息:ValidationException: Schema check errors, feature column: transaction_7d_count has data type: ColumnType.long, expected: ColumnType.string

解決方案

檢查結構描述驗證失敗錯誤,並據此更新資料行名稱和類型的功能集規格定義。 例如:

  • 更新 source.timestamp_column.name 屬性以正確定義時間戳記資料行名稱。
  • 更新 index_columns 屬性以正確定義索引資料行。
  • 更新 features 屬性以正確定義功能資料行名稱和類型。
  • 如果功能來源資料的類型為 csv,請確認 CSV 檔案是以資料行標頭產生。

接下來,再次執行 <feature_set_spec>.to_spark_dataframe() 以檢查是否已通過驗證。

如果 SDK 定義功能集規格,建議使用 infer_schema 選項作為自動填入 features 的慣用方式,而不是手動輸入值。 無法自動填入 timestamp_columnindex columns

如需詳細資訊,請參閱功能集規格結構描述文件。

找不到轉換類別

徵兆

當使用者執行 <feature_set_spec>.to_spark_dataframe() 時,會傳回此錯誤:AttributeError: module '<...>' has no attribute '<...>'

例如:

  • AttributeError: module '7780d27aa8364270b6b61fed2a43b749.transaction_transform' has no attribute 'TransactionFeatureTransformer1'

解決方案

功能轉換類別的定義應該會放在程式碼資料夾根目錄底下的 Python 檔案中。 程式碼資料夾可以有其他檔案或子資料夾。

feature_transformation_code.transformation_class 屬性值設定為 <py file name of the transformation class>.<transformation class name>

例如,如果程式碼資料夾看起來像這樣

code/
└── my_transformation_class.py

且 my_transformation_class.py 檔案會定義 MyFeatureTransformer 類別,請將 feature_transformation_code.transformation_class 設定為 my_transformation_class.MyFeatureTransformer

程式碼資料夾上的 FileNotFoundError

徵兆

如果手動建立功能集規格 YAML,且 SDK 不會產生功能集,則會發生錯誤。 命令 runs <feature_set_spec>.to_spark_dataframe() 會傳回錯誤 FileNotFoundError: [Errno 2] No such file or directory: ....

解決方案

請檢查程式碼資料夾。 其應該是功能集規格資料夾底下的子資料夾。 在功能集規格中,將 feature_transformation_code.path 設定為功能集規格資料夾的相對路徑。 例如:

feature set spec folder/
├── code/
│ ├── my_transformer.py
│ └── my_orther_folder
└── FeatureSetSpec.yaml

在此範例中,YAML 中的 feature_transformation_code.path 屬性應該是 ./code

注意

當您在 azureml-featurestore 中使用 create_feature_set_spec 函式以建立 FeatureSetSpec Python 物件時,會採用任何本機資料夾作為 feature_transformation_code.path 值。 當 FeatureSetSpec 物件已傾印,在目標資料夾中形成功能集合規格 YAML 時,程式碼路徑會複製到目標資料夾中,而 feature_transformation_code.path 屬性將會在規格 YAML 中更新。

功能集 CRUD 錯誤

功能集 GET 因為 FeatureStoreEntity 無效而失敗

徵兆

當您使用功能存放區 CRUD 用戶端來取得功能集時,例如,fs_client.feature_sets.get(name, version),您可能會看到此錯誤:


Traceback (most recent call last):

  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/operations/_feature_store_entity_operations.py", line 116, in get

    return FeatureStoreEntity._from_rest_object(feature_store_entity_version_resource)

  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py", line 93, in _from_rest_object

    featurestoreEntity = FeatureStoreEntity(

  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/_utils/_experimental.py", line 42, in wrapped

    return func(*args, **kwargs)

  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py", line 67, in __init__

    raise ValidationException(

azure.ai.ml.exceptions.ValidationException: Stage must be Development, Production, or Archived, found None

這項錯誤也可能發生在 FeatureStore 具體化作業中,其中作業會失敗,並傳回相同的錯誤追蹤。

解決方案

使用新版本的 SDKS 啟動筆記本工作階段

  • 如果使用 azure-ai-ml,請更新為 azure-ai-ml==1.8.0
  • 如果其使用功能存放區資料平面 SDK,請將其更新為 azureml-featurestore== 0.1.0b2

在筆記本工作階段中,更新功能存放區實體以設定其 stage 屬性,如下列範例所示:

from azure.ai.ml.entities import DataColumn, DataColumnType
 
account_entity_config = FeatureStoreEntity(

    name="account",

    version="1",

    index_columns=[DataColumn(name="accountID", type=DataColumnType.STRING)],

    stage="Development",

    description="This entity represents user account index key accountID.",

    tags={"data_typ": "nonPII"},

)

poller = fs_client.feature_store_entities.begin_create_or_update(account_entity_config)

print(poller.result())

當您定義 FeatureStoreEntity 時,請設定屬性以符合建立時所使用的屬性。 唯一的差異是新增 stage 屬性。

成功傳回 begin_create_or_update() 呼叫之後,下一個 feature_sets.get() 呼叫和下一個具體化作業應該會成功。

功能擷取作業和查詢錯誤

當功能擷取作業失敗時,檢查錯誤詳細資料。 移至 [執行詳細資料] 頁面,選取 [輸出 + 記錄] 索引標籤,並檢查 logs/azureml/driver/stdout 檔案。

如果使用者在筆記本中執行 get_offline_feature() 查詢,資料格輸出會直接顯示錯誤。

功能擷取規格解析錯誤

徵兆

功能擷取查詢/作業顯示下列錯誤:

  • 功能無效
code: "UserError"
mesasge: "Feature '<some name>' not found in this featureset."
  • 功能存放區 URI 無效:
message: "the Resource 'Microsoft.MachineLearningServices/workspaces/<name>' under resource group '<>>resource group name>'->' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix",
code: "ResourceNotFound"
  • 功能集無效:
code: "UserError"
message: "Featureset with name: <name >and version: <version> not found."

解決方案

在作業所使用的 feature_retrieval_spec.yaml 中檢查內容。 請確定所有功能存放區 URI、功能集名稱/版本和功能名稱都有效,且存在於功能存放區中。

若要從功能存放區選取功能,並且產生功能擷取規格 YAML 檔案,建議使用公用程式功能。

此程式碼片段使用 generate_feature_retrieval_spec 公用程式功能。

from azureml.featurestore import FeatureStoreClient
from azure.ai.ml.identity import AzureMLOnBehalfOfCredential

featurestore = FeatureStoreClient(
credential = AzureMLOnBehalfOfCredential(),
subscription_id = featurestore_subscription_id,
resource_group_name = featurestore_resource_group_name,
name = featurestore_name
)

transactions_featureset = featurestore.feature_sets.get(name="transactions", version = "1")

features = [
    transactions_featureset.get_feature('transaction_amount_7d_sum'),
    transactions_featureset.get_feature('transaction_amount_3d_sum')
]

feature_retrieval_spec_folder = "./project/fraud_model/feature_retrieval_spec"
featurestore.generate_feature_retrieval_spec(feature_retrieval_spec_folder, features)

使用模型作為功能擷取作業的輸入時,找不到 feature_retrieval_spec.yaml 檔案

徵兆

當您使用已註冊的模型作為功能擷取作業輸入時,作業會失敗,並出現此錯誤:

ValueError: Failed with visit error: Failed with execution error: error in streaming from input data sources
    VisitError(ExecutionError(StreamError(NotFound)))
=> Failed with execution error: error in streaming from input data sources
    ExecutionError(StreamError(NotFound)); Not able to find path: azureml://subscriptions/{sub_id}/resourcegroups/{rg}/workspaces/{ws}/datastores/workspaceblobstore/paths/LocalUpload/{guid}/feature_retrieval_spec.yaml

解決方案:

當您提供模型作為功能擷取步驟的輸入時,模型會預期在模型成品資料夾底下找到擷取規格 YAML 檔案。 如果遺漏該檔案,作業就會失敗。

若要修正此問題,請在註冊模型之前,於模型成品資料夾的根資料夾中封裝 feature_retrieval_spec.yaml

觀察資料未與任何功能值聯結

徵兆

使用者執行功能擷取查詢/作業之後,輸出資料未收到任何功能值。 例如,使用者執行功能擷取作業以擷取 transaction_amount_3d_avgtransaction_amount_7d_avg 功能,產生以下結果:

transactionID accountID timestamp is_fraud transaction_amount_3d_avg transaction_amount_7d_avg
83870774-7A98-43B... A1055520444618950 2023-02-28 04:34:27 0 null null
25144265-F68B-4FD... A1055520444618950 2023-02-28 10:44:30 0 null null
8899ED8C-B295-43F... A1055520444812380 2023-03-06 00:36:30 0 null null

解決方法

功能擷取會執行時間點聯結查詢。 如果聯結結果顯示空白,請嘗試下列可能的解決方案:

  • 在功能集規格定義中擴充 temporal_join_lookback 範圍,或暫時將其移除。 這可讓時間點聯結進一步 (或無限) 回頭查看觀察事件時間戳記的過去,以尋找功能值。
  • 如果功能集規格定義中也設定了 source.source_delay,請確定 temporal_join_lookback > source.source_delay

如果這些解決方案都無效,請從功能存放區取得功能集,然後執行 <feature_set>.to_spark_dataframe() 以手動檢查功能索引資料行和時間戳記。 發生失敗可能是因為:

  • 觀察資料中的索引值未存在於功能集資料框架中
  • 在觀察時間戳記之前沒有具有時間戳記值的功能值存在。

在這些情況下,如果功能已啟用離線具體化,您可能需要回填更多功能資料。

使用者身分識別或受控識別不具備功能存放區的適當 RBAC 權限

徵兆:

功能擷取作業/查詢失敗,並在 logs/azureml/driver/stdout 檔案中出現下列錯誤訊息:

Traceback (most recent call last):
  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py", line 633, in get
    raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (AuthorizationFailed) The client 'XXXX' with object id 'XXXX' does not have authorization to perform action 'Microsoft.MachineLearningServices/workspaces/read' over scope '/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.MachineLearningServices/workspaces/XXXX' or the scope is invalid. If access was recently granted, please refresh your credentials.
Code: AuthorizationFailed

解決方案:

  1. 如果功能擷取作業使用受控識別,請將功能存放區的 AzureML Data Scientist 角色指派給該身分識別。
  2. 如果問題發生於以下時機
  • 使用者在 Azure Machine Learning Spark 筆記本中執行程式碼
  • 該筆記本會使用使用者自己的身分識別來存取 Azure Machine Learning 服務

將功能存放區的 AzureML Data Scientist 角色指派給使用者的 Microsoft Entra 身分識別。

Azure Machine Learning Data Scientist 是建議的角色。 使用者可以使用下列動作,建立自己的自訂角色

  • Microsoft.MachineLearningServices/workspaces/datastores/listsecrets/action
  • Microsoft.MachineLearningServices/workspaces/featuresets/read
  • Microsoft.MachineLearningServices/workspaces/read

如需 RBAC 設定的詳細資訊,請參閱管理對受管理的功能存放區的存取

使用者身分識別或受控識別沒有適當的 RBAC 權限,因此無法從來源儲存體或離線存放區進行讀取

徵兆

功能擷取作業/查詢失敗,並在 logs/azureml/driver/stdout 檔案中出現下列錯誤訊息:

An error occurred while calling o1025.parquet.
: java.nio.file.AccessDeniedException: Operation failed: "This request is not authorized to perform this operation using this permission.", 403, GET, https://{storage}.dfs.core.windows.net/test?upn=false&resource=filesystem&maxResults=5000&directory=datasources&timeout=90&recursive=false, AuthorizationPermissionMismatch, "This request is not authorized to perform this operation using this permission. RequestId:63013315-e01f-005e-577b-7c63b8000000 Time:2023-05-01T22:20:51.1064935Z"
    at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.checkException(AzureBlobFileSystem.java:1203)
    at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.listStatus(AzureBlobFileSystem.java:408)
    at org.apache.hadoop.fs.Globber.listStatus(Globber.java:128)
    at org.apache.hadoop.fs.Globber.doGlob(Globber.java:291)
    at org.apache.hadoop.fs.Globber.glob(Globber.java:202)
    at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:2124)

解決方案:

  • 如果功能擷取作業使用受控識別,請將來源儲存體和離線存放區儲存體上的 Storage Blob Data Reader 角色指派給該身分識別。
  • 當筆記本使用使用者的身分識別來存取 Azure Machine Learning 服務以執行查詢時,就會發生此錯誤。 若要解決此錯誤,請將 Storage Blob Data Reader 角色指派給來源儲存體和離線存放區儲存體帳戶上的使用者身分識別。

Storage Blob Data Reader 是建議的最低存取需求。 使用者也可以指派角色,例如 Storage Blob Data ContributorStorage Blob Data Owner,具有更多權限。

定型作業無法讀取內建功能擷取元件所產生的資料

徵兆

定型作業失敗並出現錯誤訊息,指出定型資料不存在、格式不正確,或發生剖析器錯誤:

FileNotFoundError: [Errno 2] No such file or directory
  • 格式不正確。
ParserError:

解決方案

內建的功能擷取元件有一個輸出:output_data。 輸出資料是 uri_folder 資料資產。 其一律會有此資料夾結構:

<training data folder>/
├── data/
│ ├── xxxxx.parquet
│ └── xxxxx.parquet
└── feature_retrieval_spec.yaml

輸出資料一律會採用 parquet 格式。 更新定型指令碼,使其從「data」子資料夾進行讀取,並以 parquet 的格式讀取資料。

generate_feature_retrieval_spec() 因為使用本機功能集規格而失敗

徵兆:

此 Python 程式碼會在指定的功能清單上產生功能擷取規格:

featurestore.generate_feature_retrieval_spec(feature_retrieval_spec_folder, features)

如果功能清單包含本機功能集規格所定義的功能,則 generate_feature_retrieval_spec() 會失敗,並出現此錯誤訊息:

AttributeError: 'FeatureSetSpec' object has no attribute 'id'

解決方案:

功能擷取規格只能使用功能存放區中註冊的功能集來產生。 若要修正這個問題:

  • 將本機功能集規格註冊為功能存放區中的功能集
  • 取得已註冊的功能集
  • 僅使用已註冊功能集的功能,再次建立功能清單
  • 使用新功能清單產生功能擷取規格

get_offline_features() 查詢需要很長的時間

徵兆:

執行 get_offline_features 以使用功能存放區中的一些功能產生定型資料,需要很長的時間才能完成。

解決方案:

檢查這些設定:

  • 確認查詢中使用的每個功能集,已在功能集規格中設定 temporal_join_lookback。 將其值設定為較小的值。
  • 如果觀察資料框架上的大小和時間戳記視窗很大,請設定筆記本工作階段 (或作業) 以增加驅動程式和執行程式的大小 (記憶體和核心)。 此外,增加執行程式的數目。

功能具體化作業錯誤

當功能具體化作業失敗時,請遵循下列步驟來檢查作業失敗詳細資料:

  1. 瀏覽至功能存放區頁面: https://ml.azure.com/featureStore/{your-feature-store-name}
  2. 移至 feature set 索引標籤,選取相關功能集,然後瀏覽至功能集詳細資料頁面
  3. 從功能集詳細資料頁面,選取 Materialization jobs 索引標籤,然後選取失敗的作業以在作業詳細資料檢視中開啟。
  4. 在作業詳細資料檢視的 Properties 卡片底下,檢閱作業狀態和錯誤訊息。
  5. 您也可以移至 Outputs + logs 索引標籤,然後從 logs\azureml\driver\stdout 檔案尋找 stdout 檔案。

套用修正程式之後,您可以手動觸發回填具體化作業,以確認修正程式是否有效。

離線存放區設定無效

徵兆

具體化作業失敗,並在 logs/azureml/driver/stdout 檔案中出現此錯誤訊息:

Caused by: Status code: -1 error code: null error message: InvalidAbfsRestOperationExceptionjava.net.UnknownHostException: adlgen23.dfs.core.windows.net
java.util.concurrent.ExecutionException: Operation failed: "The specified resource name contains invalid characters.", 400, HEAD, https://{storage}.dfs.core.windows.net/{container-name}/{fs-id}/transactions/1/_delta_log?upn=false&action=getStatus&timeout=90

解決方案

使用 SDK 檢查功能存放區中定義的離線存放區目標:


from azure.ai.ml import MLClient
from azure.ai.ml.identity import AzureMLOnBehalfOfCredential

fs_client = MLClient(AzureMLOnBehalfOfCredential(), featurestore_subscription_id, featurestore_resource_group_name, featurestore_name)

featurestore = fs_client.feature_stores.get(name=featurestore_name)
featurestore.offline_store.target

您也可以檢查功能存放區 UI 概觀頁面上的離線存放區目標。 確認儲存體和容器同時存在,且目標具有下列格式:

/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{storage}/blobServices/default/containers/{container-name}

具體化身分識別不具備功能存放區的適當 RBAC 權限

徵兆:

具體化作業失敗,在 logs/azureml/driver/stdout 檔案中出現下列錯誤訊息:

Traceback (most recent call last):
  File "/home/trusted-service-user/cluster-env/env/lib/python3.8/site-packages/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py", line 633, in get
    raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (AuthorizationFailed) The client 'XXXX' with object id 'XXXX' does not have authorization to perform action 'Microsoft.MachineLearningServices/workspaces/read' over scope '/subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.MachineLearningServices/workspaces/XXXX' or the scope is invalid. If access was recently granted, please refresh your credentials.
Code: AuthorizationFailed

解決方案:

將功能存放區上的 Azure Machine Learning Data Scientist 角色指派給功能存放區的具體化身分識別 (使用者指派的受控識別)。

Azure Machine Learning Data Scientist 是建議的角色。 您可以使用下列動作,建立自己的自訂角色:

  • Microsoft.MachineLearningServices/workspaces/datastores/listsecrets/action
  • Microsoft.MachineLearningServices/workspaces/featuresets/read
  • Microsoft.MachineLearningServices/workspaces/read

如需詳細資訊,請參閱 feature store materialization managed identity 角色的必要權限

具體化身分識別不具備從存放區讀取的適當 RBAC 權限

徵兆

具體化作業失敗,在 logs/azureml/driver/stdout 檔案中出現下列錯誤訊息:

An error occurred while calling o1025.parquet.
: java.nio.file.AccessDeniedException: Operation failed: "This request is not authorized to perform this operation using this permission.", 403, GET, https://{storage}.dfs.core.windows.net/test?upn=false&resource=filesystem&maxResults=5000&directory=datasources&timeout=90&recursive=false, AuthorizationPermissionMismatch, "This request is not authorized to perform this operation using this permission. RequestId:63013315-e01f-005e-577b-7c63b8000000 Time:2023-05-01T22:20:51.1064935Z"
    at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.checkException(AzureBlobFileSystem.java:1203)
    at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.listStatus(AzureBlobFileSystem.java:408)
    at org.apache.hadoop.fs.Globber.listStatus(Globber.java:128)
    at org.apache.hadoop.fs.Globber.doGlob(Globber.java:291)
    at org.apache.hadoop.fs.Globber.glob(Globber.java:202)
    at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:2124)

解決方案:

將來源存放區上的 Storage Blob Data Reader 角色指派給功能存放區的具體化身分識別 (使用者指派的受控識別)。

Storage Blob Data Reader 是建議的最低存取需求。 您也可以指派具有更多權限的角色,例如 Storage Blob Data ContributorStorage Blob Data Owner

如需 RBAC 設定的詳細資訊,請參閱 feature store materialization managed identity 角色的必要權限

具體化身分識別不具備將資料寫入離線存放區的適當 RBAC 權限

徵兆

具體化作業失敗,在 logs/azureml/driver/stdout 檔案中出現下列錯誤訊息:

An error occurred while calling o1162.load.
: java.util.concurrent.ExecutionException: java.nio.file.AccessDeniedException: Operation failed: "This request is not authorized to perform this operation using this permission.", 403, HEAD, https://featuresotrestorage1.dfs.core.windows.net/offlinestore/fs_xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_fsname/transactions/1/_delta_log?upn=false&action=getStatus&timeout=90
    at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:306)
    at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:293)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
    at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:135)
    at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2410)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2380)
    at com.google.common.cache.LocalCache$S

解決方案

將來源存放區上的 Storage Blob Data Reader 角色指派給功能存放區的具體化身分識別 (使用者指派的受控識別)。

Storage Blob Data Contributor 是建議的最低存取需求。 您也可以指派具有更多權限的角色,例如 Storage Blob Data Owner

如需 RBAC 設定的詳細資訊,請參閱 feature store materialization managed identity 角色的必要權限

串流作業輸出至筆記本會導致失敗

徵兆:

使用功能存放區 CRUD 用戶端以使用 fs_client.jobs.stream("<job_id>") 將具體化作業結果串流至筆記本時,SDK 呼叫會失敗並產生錯誤

HttpResponseError: (UserError) A job was found, but it is not supported in this API version and cannot be accessed.

Code: UserError

Message: A job was found, but it is not supported in this API version and cannot be accessed.

解決方案:

建立具體化作業時 (例如,透過回填呼叫),作業可能需要幾秒鐘的時間才能正確初始化。 幾秒鐘後再執行 jobs.stream() 命令。 問題應該會消失。

無效的 Spark 設定

徵兆:

具體化作業失敗,並出現此錯誤訊息:

Synapse job submission failed due to invalid spark configuration request

{

"Message":"[..] Either the cores or memory of the driver, executors exceeded the SparkPool Node Size.\nRequested Driver Cores:[4]\nRequested Driver Memory:[36g]\nRequested Executor Cores:[4]\nRequested Executor Memory:[36g]\nSpark Pool Node Size:[small]\nSpark Pool Node Memory:[28]\nSpark Pool Node Cores:[4]"

}

解決方案:

更新功能集的 materialization_settings.spark_configuration{}。 請確定這些參數會使用記憶體大小數量以及核心值的總數,這兩者都小於執行個體類型,如同 materialization_settings.resource 所定義,提供:

spark.driver.cores spark.driver.memory spark.executor.cores spark.executor.memory

例如,對於執行個體類型 standard_e8s_v3,此 Spark 設定是其中一個有效的選項。


transactions_fset_config.materialization_settings = MaterializationSettings(

    offline_enabled=True,

    resource = MaterializationComputeResource(instance_type="standard_e8s_v3"),

    spark_configuration = {

        "spark.driver.cores": 4,

        "spark.driver.memory": "36g",

        "spark.executor.cores": 4,

        "spark.executor.memory": "36g",

        "spark.executor.instances": 2

    },

    schedule = None,

)

fs_poller = fs_client.feature_sets.begin_create_or_update(transactions_fset_config)

下一步