> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Policy Execution Failures

> You can detect policy execution failures in Apinizer, resolve policy configuration issues, manage dependency issues, and optimize policy execution order.

## General Policy Execution Issues

<Warning>
  Policy execution failures can usually be caused by the following situations:
</Warning>

* Policy configuration errors
* Policy dependency issues
* Policy execution order errors
* Logic errors in policy conditions
* Resources used within policy not being accessible

## Troubleshooting Steps

<Steps>
  <Step title="Review Policy Logs">
    Errors occurring during policy execution are recorded in log files. You can detect the source of the error by reviewing relevant logs.
  </Step>

  <Step title="Check Policy Configuration">
    Ensure that policy settings are correctly configured. Especially check that mandatory fields are filled.
  </Step>

  <Step title="Check Dependencies">
    If the policy depends on other resources (certificate, connection, etc.), ensure that these resources are accessible.
  </Step>

  <Step title="Review Policy Order">
    Policy execution order is important. Ensure that policies are configured in the correct order.
  </Step>

  <Step title="Try in Test Environment">
    You can isolate the error by running the problematic policy in a test environment.
  </Step>
</Steps>

## Common Error Scenarios

### Script Policy Errors

Syntax errors or runtime errors may occur in script policies. Check script code and review error messages.

### Connection Policy Errors

There may be access issues to target service in connection policies. Check connection settings and network access.

### Authentication Policy Errors

There may be token or certificate issues in authentication policies. Check relevant credentials.
