cloudinary / cloudinary_wordpress

Cloudinary's WordPress plugin
GNU General Public License v2.0
38 stars 28 forks source link

Cloudinary Process killed by long process killer #953

Closed ckoch-cars closed 6 months ago

ckoch-cars commented 6 months ago

Bug Description

When trying to create a wordpress gallery (of 20 or more images) that need to be imported from Cloudinary this process sometimes takes long enough that the process is killed by a long process monitor on the host.

When that happens, that incomplete cloudinary downloads remain visible in the gallery selector tool but show up as broken images which must be manually deleted before importing them again.

Expected Behaviour

I'm not sure what would be the preferred outcome here. Maybe cleaning up and deleting the partials?

Steps to reproduce

  1. Go to 'add a new article/post'
  2. Click on 'add a gallery'
  3. Import images from cloudinary
  4. See Failures

Screenshots

Additional context

We run our Wordpress through WPEngine which manages the plugins and keeps them up to date.

Error logs (there are multiple instances of this log line)

nas/content/live/SITENAME/_wpeprivate/logs/apache2-05_01_2024/SITENAME.error.log.2:[Mon Apr 29 17:05:11.192833 2024] [web-96057-i-0108d763a084ca77a] [php:error] [pid 12365] [client 163.116.249.74:0] PHP Fatal error:  Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, string given in /nas/content/live/SITENAME/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-utils.php:713\nStack trace:\n#0 /nas/content/live/SITENAME/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-utils.php(713): fclose('/tmp/kia-ev9-la...')\n#1 /nas/content/live/SITENAME/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-utils.php(702): Cloudinary\\Utils::purge_fragment(0)\n#2 /nas/content/live/SITENAME/wp-includes/class-wp-hook.php(324): Cloudinary\\Utils::purge_fragments('')\n#3 /nas/content/live/SITENAME/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)\n#4 /nas/content/live/SITENAME/wp-includes/plugin.php(517): WP_Hook->do_action(Array)\n#5 /nas/content/live/SITENAME/wp-includes/load.php(1260): do_action('shutdown')\n#6 [internal function]: shutdown_action_hook()\n#7 {main}\n  thrown in /nas/content/live/SITENAME/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-utils.php on line 713, referer: https://SITENAME.wpengine.com/wp-admin/post.php?post=481761&action=edit
wissam-khalili commented 6 months ago

Hi @ckoch-cars ,

WP Engine has WPE_Governor in place and it can kill requests. Can you please check the value of the WPE_GOVERNOR variable in the wp-config.php and set it to false? If it is not there, please add it. define( 'WPE_GOVERNOR', false );

Please let me know if this helps.

Regards, Wissam

ckoch-cars commented 6 months ago

Thank you for the fast response. We have disabled this and that does seem to have helped.