您目前查看的是 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 部署作業就會失敗。
支援的資料類型包括 string
、integer
、float
、long
、double
和 boolean
。
舉例來說,如果在「統計資料收集器」政策的 <Statistic>
元素中指定變數類型為 char
,則 API Proxy 部署作業就會失敗。
診斷
- 找出發生錯誤的特定 API Proxy 中的統計資料收集器政策。
確認統計資料收集器政策中使用的不支援的資料類型。你可以在錯誤訊息中找到這項資訊。舉例來說,在下列錯誤中,不支援的資料類型為
char
:StatisticsCollection char: Datatype Revision:1;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is unsupported . Context {2}.
驗證失敗的統計資料收集器政策中使用的類型屬性,與錯誤訊息中指明的資料類型 (上述步驟 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>
如果類型屬性不是支援的資料類型,就會是錯誤的原因。
在上方顯示的統計資料收集器政策範例中,請記得將
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 部署作業失敗。
部分已知的系統定義變數為 organization
和 environment
。
舉例來說,如果在統計資料收集器政策的 <Statistic>
元素中指定 organization
屬性,則 API Proxy 部署作業就會失敗。
診斷
找出發生錯誤的統計資料收集器政策,以及與系統定義變數衝突的
<Statistic>
元素名稱。您可以在錯誤訊息中找到這兩項資訊。舉例來說,在下列錯誤中,政策名稱為StatCollector
,與系統定義變數衝突的<Statistic>
元素名稱為organization
:StatisticsCollection: Name: organization conflicts with system defined variables. Context policy: StatCollector.
驗證失敗統計資料收集器政策 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>
檢查每個
<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 部署作業就會失敗。
診斷
- 找出發生錯誤的特定 API Proxy 中的統計資料收集器政策。
- 在失敗的統計資料收集器政策 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
屬性指定的變數類型屬性一律指定為支援的資料類型。
支援的資料類型包括 string
、integer
、float
、long
、double
和 boolean
。
例如:
<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>