• Hi,

    i’m creating a new website which uses WooCommerceto present some hundred articles in ~250 categories. The articles are managed on an external application which sends all article-data via API to WordPress. The categories are managed in WooCommerce.

    This basically works very well. Creating article, updating etc.

    But: if i send a PUT-request to update an article including one or more categoryallocations it ends in an error 500. In this case only some of the article-data in WooCommerce get updated – but not the categories. In wc-logs I see in this moment an “allowed memory”-error which I cannot resolve with higher memory_limit.

    Example request:

    array(13) {
      ["name"]=>
      string(18) "testarticle"
      ["sku"]=>
      string(6) "010325"
      ["type"]=>
      string(6) "simple"
      ["status"]=>
      string(7) "private"
      ["description"]=>
      string(0) ""
      ["short_description"]=>
      string(39) ""
      ["price"]=>
      string(4) "1.29"
      ["regular_price"]=>
      string(4) "1.99"
      ["sale_price"]=>
      string(4) "1.29"
      ["categories"]=>
      array(1) {
        [0]=>
        array(1) {
          ["id"]=>
          int(201)
        }
      }
      ["images"]=>
      array(0) {
      }
      ["attributes"]=>
      array(1) {
        [0]=>
        array(2) {
          ["id"]=>
          int(1)
          ["options"]=>
          array(1) {
            [0]=>
            string(1) "0"
          }
        }
      }
    }

    The category with the id 201 exists in WooCommerce.
    If it remove the categories-array the request ends with 201 – ok.

    Wordpress 5.6
    WooCommerce 4.9.2
    PHP 7.3

    Can anyone please help with this issue?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support EastOfWest a11n

    (@eastofwest)

    Hi there!

    Are the 500 errors just limited memory issues, or do you have some more detail? There are two places where you can find out more. The first is from WP Admin » WooCommerce » Status » Logs, particularly the “fatal-errors-” logs with a date closest to when the error happened. If you can provide a complete excerpt from there it would be insightful.

    If there’s nothing insightful there, you can also check the “Error log” at the hosting level, a link to which you can usually find from your host’s management panel, or otherwise via FTP in an appropriately named directory. Your host can assist to find it, but it will contain similar entries that should be able to help pinpoint the issue.

    Thread Starter viosys

    (@viosys)

    Hi,
    as mentioned above:

    In wc-logs I see in this moment an “allowed memory”-error which I cannot resolve with higher memory_limit.

    Under Status > Logs I see fatal-errors-Logs, but not with the actual entrys which are visible in the wp-contents/uploads/wc-log-directory. The file in this directory is updated every time a 500 response came back. The only entries there are “Allowed memory”-messages like this:

    2021-01-26T12:19:19+00:00 CRITICAL Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/wordpress/web/public/wp/wp-includes/functions.php in Zeile 624
    
    2021-01-26T12:25:44+00:00 CRITICAL Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/wordpress/web/public/wp/wp-includes/functions.php in Zeile 624
    
    2021-01-26T12:25:55+00:00 CRITICAL Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/wordpress/web/public/wp/wp-includes/functions.php in Zeile 624

    In no other logfile in the hosting is anything mentioned about error although we actived full logging and WordPress-Debugging. This happens on my VM with this project but also identical on the future hosting-space.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘API PUT-Request results in Error 500’ is closed to new replies.