Statistics Collector policy deployment error troubleshooting

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

UnsupportedDatatype

Error message

Deployment of the API proxy through either the Edge UI or Edge management API fails with this error message:

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

Example error message

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

Example screenshot

Cause

If the type of the variable specified by the ref attribute in the <Statistic> element of the Statistics Collector policy is unsupported, then the deployment of the API proxy fails.

The supported data types are string, integer, float, long, double, and boolean.

For example, if the type of the variable is specified as char in the <Statistic> element of the Statistics Collector policy, then the deployment of the API proxy fails.

Diagnosis

  1. Identify the Statistics Collector policy in the specific API Proxy where the failure has occurred.
  2. Identify the unsupported data type used in the Statistics Collector policy. You can find this information from the error message. For example, in the following error, the unsupported data type is char:

    StatisticsCollection char: Datatype Revision:1;APIProxy:StatCollector;Organization:aprabhashankar-eval;Environment:test is unsupported . Context {2}.
    
  3. Verify that the type attribute used in the failed Statistics Collector policy matches the data type identified in the error message (step #2 above). For example, the following policy specifies the datatype as char, which matches what's in the error message:

    <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. If the type attribute is not of a supported data type, then that's the cause of the error.

    In the example Statistics Collector policy shown above, recall that the type attribute is set as char, which is unsupported. Therefore, the deployment of the API Proxy fails with the error:

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

Resolution

Ensure that the data type of the variables specified by the ref attributes in the <Statistic> elements of the Statistics Collector policy is supported and valid. For example:

<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

Error message

Deployment of the API proxy through either the Edge UI or Edge management API fails with this error message:

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

Example error message

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

Example screenshot

Cause

If the name used to reference the data collected for the specified variable defined within the <Statistic> element of the Statistics Collector policy conflicts with a system-defined variable, then the deployment of the API proxy fails.

Some of the known system-defined variables are organization and environment.

For example, if the name attribute is specified as organization in the <Statistic> element of the Statistics Collector policy, then the deployment of the API proxy fails.

Diagnosis

  1. Identify the Statistics Collector policy where the error occurred and the name of <Statistic> element that conflicts with a system-defined variable. You can find both these items in the error message. For example, in the following error, the policy name is StatCollector, the name of the <Statistic> element that conflicts with the system defined variable is organization:

    StatisticsCollection: Name: organization conflicts with system defined variables. Context policy: StatCollector.
    
  2. Verify that the name of the <Statistic> element used in the failed Statistics Collector policy XML matches the name identified in the error message (step #1 above). For example, the following policy specifies the name as organization in the <Statistic> element, which matches what's in the error message:

    <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. Examine the definition of each of the <Statistic> elements. If there's any <Statistic> element where the name attribute conflicts with a system variable, then that is the cause of the error.

In the example Statistics Collector policy shown above, recall that the name attribute of <Statistic> used is organization, which happens to be a system variable name. Hence, the deployment of the API Proxy fails with the error:

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

Resolution

Ensure that the name of the <Statistic> element used to reference the data collected for the specified variable defined within the <Statistic> element in the Statistics Collector policy is not the same as the system-defined variables. For example:

<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

Error message

Deployment of the API proxy through either the Edge UI or Edge management API fails with this error message:

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].

Example error message

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

Example screenshot

Cause

If the type of the variable specified by the ref attribute in the <Statistic> element of the Statistics Collector policy is missing, then the deployment of the API proxy fails.

Diagnosis

  1. Identify the Statistics Collector policy in the specific API Proxy where the failure has occurred.
  2. Examine the definition of each of the <Statistic> elements in the failed Statistics Collector policy XML. If there are any <Statistic> elements where the type attribute is missing, then that is the cause of the error.

Here's an example Statistics Collector policy:

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

In the example Statistics Collector policy shown above, notice that the type attribute is missing for both the <Statistic> elements. Therefore, the deployment of the API Proxy fails.

Resolution

Ensure that the type attribute of the variable specified by the ref attribute in the <Statistic> element of the Statistics Collector policy is always specified and is of supported data type.

The supported data types are string, integer, float, long, double, and boolean.

For example:

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