統計資料收集器政策部署錯誤疑難排解

您正在查看 Apigee Edge 說明文件。
查看 Apigee X 說明文件
資訊

UnsupportedDatatype

錯誤訊息

無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:

Error Deploying Revision [revision_number]
StatisticsCollection [datatype]: Datatype Revision:[revision_number];APIProxy:[api_proxy];Organization:[org_name];Environment:[env_name] is unsupported . Context [context].

錯誤訊息示例

Error Saving Revision 1
StatisticsCollection char: Datatype Revision:1;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is unsupported . Context {2}.

螢幕截圖範例

原因

如果系統不支援統計資料收集器政策的 <Statistic> 元素中 ref 屬性指定的變數類型,則 API Proxy 部署作業會失敗。

支援的資料類型包括 stringintegerfloatlongdoubleboolean

舉例來說,如果統計資料收集器政策的 <Statistic> 元素中將變數類型指定為 char,則 API Proxy 的部署作業就會失敗。

診斷

  1. 找出發生錯誤的特定 API Proxy 中的統計資料收集器政策。
  2. 找出「統計資料收集器」政策中不支援的資料類型。您可以在錯誤訊息中找到這項資訊。舉例來說,在下列錯誤中,不支援的資料類型是 char

    StatisticsCollection char: Datatype Revision:1;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is unsupported . Context {2}.
    
  3. 確認失敗的統計資料收集器政策中使用的 type 屬性,符合錯誤訊息中指出的資料類型 (上述步驟 #2)。舉例來說,下列政策會將資料類型指定為 char,以便與錯誤訊息中的內容相符:

    <StatisticsCollector async="false" continueOnError="false" enabled="true" name="Statistics-Collector-1">
      <DisplayName>Statistics Collector 1</DisplayName>
      <Statistics>
          <Statistic name="statName" ref="varName" type="char">defaultStatValue</Statistic>
      </Statistics>
    </StatisticsCollector>
    
  4. 如果不支援的資料類型屬性,就會導致錯誤。

    在上述統計資料收集器政策範例中,提醒您,type 屬性已設為不支援的 char。因此,API Proxy 的部署失敗並顯示以下錯誤:

    StatisticsCollection char: Datatype Revision:1;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is unsupported . Context {2}.
    

解析度

確認統計資料收集器政策的 <Statistic> 元素中 ref 屬性指定的變數資料類型已支援且有效。例如:

<StatisticsCollector async="false" continueOnError="false" enabled="true" name="Statistics-Collector-1">
    <DisplayName>Statistics Collector 1</DisplayName>
    <Statistics>
        <Statistic name="statName" ref="varName" type="string">defaultStatValue</Statistic>
    </Statistics>
</StatisticsCollector>

InvalidName

錯誤訊息

無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:

Error Deploying Revision [revision_number]
StatisticsCollection: Name: [name] conflicts with system defined variables. Context policy: [policy_name]

錯誤訊息示例

Error Saving Revision 1
StatisticsCollection: Name: organization conflicts with system defined variables. Context policy: StatCollector.

螢幕截圖範例

原因

如果名稱用來參照收集到統計資料收集器政策 <Statistic> 元素中定義的指定變數資料,而這些資料與系統定義的變數發生衝突,則 API Proxy 部署作業會失敗。

部分已知的系統定義的變數為 organizationenvironment

舉例來說,如果統計資料收集器政策的 <Statistic> 元素中的名稱屬性設為 organization,API Proxy 的部署就會失敗。

診斷

  1. 找出發生錯誤的「統計資料收集器」政策,以及與系統定義變數衝突的 <Statistic> 元素名稱。您可以在錯誤訊息中找到這兩個項目。舉例來說,在下列錯誤中,政策名稱為 StatCollector,而與系統定義變數衝突的 <Statistic> 元素名稱是 organization

    StatisticsCollection: Name: organization conflicts with system defined variables. Context policy: StatCollector.
    
  2. 確認失敗的統計資料收集器政策 XML 中使用的 <Statistic> 元素名稱,與錯誤訊息中指出的名稱相符 (上述步驟 #1)。舉例來說,下列政策會將 <Statistic> 元素中的名稱指定為 organization,與錯誤訊息中的內容相符:

    <StatisticsCollector name="StatCollector">
      <Statistics>
          <Statistic name="organization" ref="organization" type="string">myorg</Statistic>
          <Statistic name="traffic" ref="traffic" type="string">999999</Statistic>
      </Statistics>
    </StatisticsCollector>
    
  3. 檢查每個 <Statistic> 元素的定義。如有任何 <Statistic> 元素的 name 屬性與系統變數發生衝突,就會導致錯誤。

在上述統計資料收集器政策範例中,請回想一下使用的 <Statistic> 名稱屬性是 organization,這是系統變數名稱。因此,API Proxy 部署失敗並顯示以下錯誤:

StatisticsCollection: Name: organization conflicts with system defined variables. Context policy: StatCollector.

解析度

確認 <Statistic> 元素的名稱 (用來參照在統計資料收集器政策的 <Statistic> 元素中定義的指定變數所收集的資料),與系統定義的變數不同。例如:

<StatisticsCollector name="StatCollector">
    <Statistics>
        <Statistic name="org" ref="org" type="string">myorg</Statistic>
        <Statistic name="traffic" ref="traffic" type="string">999999</Statistic>
    </Statistics>
</StatisticsCollector>

DatatypeMissing

錯誤訊息

無法透過 Edge UI 或 Edge Management API 部署 API Proxy,並顯示以下錯誤訊息:

Error Deploying Revision [revision_number]
StatisticsCollection [ref]: Datatype of Revision:[revision_number];APIProxy:[api_proxy];Organization:[org_name];Environment:[env_name] is missing . Context [context].

錯誤訊息示例

Error Deploying Revision 2 to test
StatisticsCollection product.id: Datatype of Revision:2;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is missing. Context {2}.

螢幕截圖範例

原因

如果缺少統計資料收集器政策的 <Statistic> 元素中 ref 屬性指定的變數類型,則 API Proxy 部署作業會失敗。

診斷

  1. 找出發生錯誤的特定 API Proxy 中的統計資料收集器政策。
  2. 在失敗的統計資料收集器政策 XML 中,檢查每個 <Statistic> 元素的定義。如果缺少類型屬性的 <Statistic> 元素,就會導致錯誤。

以下是統計資料收集器政策範例:

  <StatisticsCollector name="publishPurchaseDetails"
      <Statistics>
          <Statistic name="productID" ref="product.id">999999</Statistic>
          <Statistic name="price" ref="product.price" type="string">1000</Statistic>
      </Statistics>
  </StatisticsCollector>
  

在上述的「統計資料收集器」政策範例中,請注意這兩個 <Statistic> 元素都缺少類型屬性。因此 API Proxy 部署失敗。

解析度

確保在統計資料收集器政策的 <Statistic> 元素中,ref 屬性指定的變數類型屬性是一律指定,且屬於支援的資料類型。

支援的資料類型包括 stringintegerfloatlongdoubleboolean

例如:

<StatisticsCollector name="publishPurchaseDetails">
    <Statistics>
        <Statistic name="productID" ref="product.id" type="string">999999</Statistic>
        <Statistic name="price" ref="product.price"  type="string">1000</Statistic>
    </Statistics>
</StatisticsCollector>