# Error handling and troubleshooting

If you encounter any errors during the installation, configuration and use of the Magento 2 plugin, errors are logged in the var/log system directory for all environments. If errors are not found in this location, you can always view the Apache or Nginx logs.

For more information, refer to the official Adobe Commerce Documentation: [View and manage logs](https://experienceleague.adobe.com/en/docs/commerce-on-cloud/user-guide/develop/test/log-locations).

## Common errors <a href="#common-errors" id="common-errors"></a>

* Not having the currency of Magento 2 set to the one that the payment contract supports
* Not having created a public key for [Secure Card Capture](/online-payments/api-integration-methods-auth-and-endpoints/secure-card-capture-key.md)
* Entity ID, Payment Contract ID, or 3DS Contract ID do not match the correct entity for which they were created
* The cURL verify host and peer option is enabled/disabled but the host server does not have proper TLS certificates
* Not having the latest Magento 2 module version installed
* Make sure that the credentials are correct: Payment Contract ID, User ID, Password, Realm, Entity ID, Client ID, etc.
* If the website is down or the assets cannot be found on the server, go to the terminal on the server and run several Magento 2 deploy commands. Read more about [Magento commands](https://www.emiprotechnologies.com/technical_notes/magento-technical-notes-60/post/magento-2-useful-commands-list-391).

In most cases, the error may be caused by various PHP errors and/or warnings.

If the error is caused by a request to the Verifone server, then the error message received when the request fails is very informative. Here is an example:

```apache
{
    "code": 116,
    "details": {},
    "timestamp": 1608705038970,
    "message": "Access is restricted to authenticated users only. The query can't be made without a valid JWT (check the Authorization header of your request)."
}
```

The above request was denied because the user was not authorized. This is due to an invalid token being present in the Authorization bearer.

This kind of error format will be present on almost all requests that fail and will deliver a concrete error message along with it which in turn will pinpoint the problem precisely.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.verifone.com/online-payments/plugins/magento-2-plugin-integration/error-handling-and-troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
