HTTPModifier runtime error troubleshooting

You're viewing Apigee X documentation.
View Apigee Edge documentation.

UnresolvedVariable

Error code

steps.httpmodifier.UnresolvedVariable

Error response body

{
    "fault": {
        "faultstring": "HTTPModifier[policy_name]: unable to resolve variable [variable_name]",
        "detail": {
            "errorcode": "steps.httpmodifier.UnresolvedVariable"
        }
    }
}

Cause

This error occurs if a variable specified in the HTTPModifier policy is either:

  • out of scope (not available in the specific flow where the policy is being executed) or
  • can't be resolved (is not defined)

Diagnosis

  1. Identify the HTTPModifier policy where the error occurred and the name of the variable that is not available. You can find both of these items in the faultstring element of the error response.

    For example, in the following faultstring, the policy name is googleBook and the variable is var:

    "faultstring": "HTTPModifier[googleBook]: unable to resolve variable var"
    
  2. In the failed HTTPModifier policy XML, verify that the name of the variable used matches the variable name identified in the fault string (step #1 above).

  3. Determine if the variable is defined and available in the flow in which the HTTPModifier policy is being executed.

  4. If the variable is either:

    1. out of scope (not available in the specific flow where the policy is being executed) or
    2. can't be resolved (is not defined)

    then that's the cause for the error.

    Check if the variable is defined in any of the policies that are executed before the HTTPModifier policy in the request flow. If the variable has not been defined, then you will receive the error code:

    steps.httpmodifier.UnresolvedVariable
    

Resolution

Ensure that the variable referenced in the policy exists and is available in the specific flow, where the HTTPModifier policy is being executed.