1. Documentation /
  2. Troubleshooting

Troubleshooting

In the settings section there are several options available to log API requests and responses by turning those options on in the API Manager settings page. Postman is recommended for API testing.

Read the Self-Service Guide

↑ Back to top

Review the WooCommerce Self-Service Guide.

Data Update Not Completing

↑ Back to top

The first step is to make sure all plugins, themes, and theme template overrides are up-to-date. If you have your own server, make sure all software is up-to-date. Anything that is out-of-date, and needs to be updated, can throw an error that can prevent things from working in the background even though you are not seeing the error, and out-of-date software is security risk. Also, make sure you know what the latest WordPress, WooCommerce, and WooCommerce API Manager requirements are for versions of PHP and MySQL, as outdated versions can and will cause issues. Keeping software up-to-date is the surest way to avoid a ton of time trying to figure out what is going wrong.

The next step is to disable all plugins except WooCommerce, WooCommerce API Manager, and WooCommerce Subscriptions, if you have that plugin, then see if the data update completes. It could be that the server does not have sufficient RAM to process the update.

Go to WooCommerce > Status and look for recommendations for updates.

Below are some server settings to check, if you have your own server, which are listed below as Apache errors, but are not Apache specific.

  1. max_execution_time = 30 – is changed in the php.ini file on Linux servers.
  2. max_allowed_packet = 128M – is a MySQL setting and is changed on Linux servers in /etc/my.cnf.

If a data update does not seem to be completing, it could be because the server does not have enough RAM or CPUs to handle the normal workload, and an update as well. The updater in the API Manager monitors the memory usage to make sure it never exceeds 90%, and it will pause if it does then starts again where it left off. Slow servers will take a while to update, and that is compounded by a large database.

If you see 500 Internal Server Error, or Error Connection Timed Out, then the machine either exhausted its memory at that moment, or a plugin or theme is throwing a fatal error. Updating software will prevent fatal errors, and increasing RAM, or modifying WordPress settings to increase memory, will fix memory issues, but only  if there is enough RAM to start with.

Go to WooCommerce > Status > Logs > and check for any fatal-errors … logs.

Go to WooCommerce > Status > Logs > wc_am_db_updates … will display the current status of the API Manager data update process.

If all else fails check the PHP, and web server (Apache, Nginx, etc.), error logs for clues as to what errors are preventing the update process from completing.

Pre 2.0 API Keys don’t work

↑ Back to top

API Keys that existed before version 2.0 still exist, but they have moved to the Associated API Key database table. The pre 2.0 API Keys will still work for activation, deactivation, and status queries, but may not work for updates in all cases if the pre 2.0 version of the PHP Library is being used for WordPress plugins and themes. If updates are not working for pre 2.0 API Keys for WordPress plugins and themes, update to the post 2.0 version of the PHP Library.

Pre 2.0 API Keys will not be displayed on the order screen, or on the My Account dashboard. The Master API Key will be displayed. If set under settings, the Product Order API Key will also be displayed, however the default is to only show the Master API Key.

If you are NOT using the PHP Library for WordPress plugins and themes, then refer to the API documentation to make sure your queries contain all the required keys and values.

“No API resources exist” Error Message

↑ Back to top

If you see the message “No API resources exist” when attempting to activate an API Key, this means no API Resource record could be found for this purchase. To know if an API Resource exists, go to the Order screen where there should be a record in the API Resources meta box. API Resources only exist for an order if the order has a “completed” or “processing” status. The record is searched for using the API Key and Product ID, so check to make sure both of those values are correct on the Order screen API Resources meta box, or the API Keys tab  in the customer’s My Account dashboard.

Make sure to check the product itself, because the API checkbox should be checked on the Product edit screen, or an API Resource will not be created when the product is purchased. Checking the API check box on the Product edit screen after purchases have been made will trigger a background process to create API Resources from completed or processing orders previously made for that product.

If the product is an API product and a WooCommerce Subscription, the API Resource will not be displayed in the Order screen API Resources meta box, be available to the customer via the API, or be displayed in the My Account dashboard, if the subscription has expired.

If the product is an API product, and the API Access Expires time limit has expired, the API Resource will not be displayed in the Order screen API Resources meta box, be available to the customer via the API, or be displayed in the My Account dashboard.

Prior to API Manager 2.0 an alphanumeric Software Title was used to find the correct product so the download file URL could be used for software updates and My Account > API Downloads. The documents at that time expected variable product variations to be setup with the exact same product using the exact same download file URL, having the exact same Software Title, and only differing by the number activations, however some stores used the same Software Titles for all the products on the store, and the same file, while others had created a multitude of other variations of this concept, which caused many issues. API Manager 2.0 now uses a numeric Product ID that matches the product’s ID exactly rather than the Software Title, and although the API Manager tries to accept the old Software Title when sent by client software, the issues can sometimes become even more pronounced since the API Manager 2.0 has become more strict in how it uses the Software Title to find the Product ID to then find the correct download file URL. When this translation of the old Software Title breaks, the software updates also break. To fix this issue it is required that all client software send the numeric Product ID and not the alphanumeric Software Title. If hard coding the Product ID into client software is too cumbersome, add a form field to allow the customer to add the Product ID themselves. The Product ID can be found by customers under the My Account > API Keys > Product ID column, and it is sent with all completed order emails.

No file defined or Software Download/Update Failed

↑ Back to top

When a Downloadable file is added to a product, that first file URL is used for software updates and My Account API Downloads. Prior to API Manager 2.0 the woocommerce_downloadable_product_permissions table was used to verify download permission, and other criteria, but it has created unexpected issues over time, as a result the API Manager no longer relies on the woocommerce_downloadable_product_permissions table for local server download data as of version 2.0.7, but rather only looks for the first Downloadable files URL on the product. One of the issues in using the woocommerce_downloadable_product_permissions table began in WooCommerce version 3.0. Please read https://woo.com/document/digital-downloadable-product-handling/ for more information on how adding/changing Downloadable files URLs on products after WooCommerce 3.0 would cause download/update URLs to stop working.

If the error message “No file defined” appears for a local server download, check that the product has a Downloadable files URL, and it is the first file listed. If the error persists, try removing the Downloadable files, update the product, and add them back, then click update again. Misconfigured web servers, firewalls, or file blocking rules in a plugin or the web server can also cause file download failures. To completely avoid the local server download issues serve downloads from Amazon S3.

Prior to API Manager 2.0 an alphanumeric Software Title was used to find the correct product so the download file URL could be used for software updates and My Account > API Downloads. The documents at that time expected variable product variations to be setup with the exact same product using the exact same download file URL, having the exact same Software Title, and only differing by the number activations, however some stores used the same Software Titles for all the products on the store, and the same file, while others had created a multitude of other variations of this concept, which caused many issues. API Manager 2.0 now uses a numeric Product ID that matches the product’s ID exactly rather than the Software Title, and although the API Manager tries to accept the old Software Title when sent by client software, the issues can sometimes become even more pronounced since the API Manager 2.0 has become more strict in how it uses the Software Title to find the Product ID to then find the correct download file URL. When this translation of the old Software Title breaks, the software updates also break. To fix this issue it is required that all client software send the numeric Product ID and not the alphanumeric Software Title. If hard coding the Product ID into client software is too cumbersome, add a form field to allow the customer to add the Product ID themselves. The Product ID can be found by customers under the My Account > API Keys > Product ID column, and it is sent with all completed order emails.

Apache error AH01067

↑ Back to top

Error log message: AH01067: Failed to read FastCGI header, referrer: …

Edit the php.ini file to at least max_execution_time 30 or greater, but not too much or PHP scripts will take too long to complete:

max_execution_time = 30 

If you are running a Apache proxy, the timeout must be greater than ( > ) the php max_execution_time.

https://forum.remirepo.net/viewtopic.php?id=3563

Apache error AH01075

↑ Back to top

Error log message: The timeout specified has expired: AH01075: Error dispatching request to …

In the Apache config file set the ProxyTimeout to 1800, or whatever works for you, but the timeout must be greater than ( > ) the php max_execution_time in the php.ini file.

ProxyTimeout 1800

https://support.plesk.com/hc/en-us/articles/115000064929-Website-is-not-accessible-The-timeout-specified-has-expired-Error-dispatching-request-to

Apache error AH01071

↑ Back to top

Error log message: AH01071: Got error ‘PHP message: PHP Warning: Error while sending QUERY packet …

This error happens when the database cannot handle more connections, because there are too many requests for it to handle. If the server is on a shared host, you need to consider upgrading to an account that has a database that can handle more traffic. If you have your own server then edit the /etc/my.cnf file as follows keeping in mind that you can use a lower allocation than 128 MB.:

max_allowed_packet = 128M

https://dev.mysql.com/doc/refman/8.0/en/packet-too-large.html