• Resolved OgdenNews

    (@ogdennews)


    We have been using the WP Offload Media Lite plugin for a decade now, pretty much since its inception. We use it on upwards of 100 sites. After the release of 3.2.0 – some sites (not all) will no longer move media to their S3 bucket after upload. All sites are on similar servers, using similar plugins and similar custom themes. There is no real rhyme or reason to why some sites still work and others do not. I’m hoping someone here has an idea.

    I created a test site from a copy of one of our live sites that no longer worked. I enabled debugging on it and I am finding that a DeliciousBrains function is not receiving enough arguments and is failing. I am assuming this to be the reason for the plugin’s failure to move images to S3 but I am unable to determine why the function is not getting the necessary arguments. Here is a copy of the debug log. The function fails a total of 6 times from 1 image upload.

    [30-Mar-2023 14:54:24 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    [30-Mar-2023 14:54:24 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    [30-Mar-2023 14:54:25 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    [30-Mar-2023 14:54:25 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    [30-Mar-2023 14:54:25 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    [30-Mar-2023 14:54:26 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::DeliciousBrains\WP_Offload_Media\Integrations\{closure}(), 4 passed in ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php on line 287 and exactly 5 expected in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php:159
    Stack trace:
    #0 ***SITE_DIRECTORY***/wp-includes/class-wp-hook.php(287): DeliciousBrains\WP_Offload_Media\Integrations\Media_Library->DeliciousBrains\WP_Offload_Media\Integrations\{closure}(NULL, 24, '_wp_attached_fi...', true)
    #1 ***SITE_DIRECTORY***/wp-includes/plugin.php(206): WP_Hook->apply_filters(NULL, Array)
    #2 ***SITE_DIRECTORY***/wp-includes/meta.php(514): apply_filters('get_post_metada...', NULL, 24, '_wp_attached_fi...', true)
    #3 ***SITE_DIRECTORY***/wp-includes/post.php(2215): get_metadata('post', 24, '_wp_attached_fi...', true)
    #4 ***SITE_DIRECTORY***/wp-includes/post.php(499): get_post_meta(24, in ***SITE_DIRECTORY***/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 159
    

    If I revert the plugin back to v3.1.0 – everything works as it should again. I update the plugin to v3.2.0 or v3.2.1 again and the images no longer move to S3. Something has obviously changed from v3.1.0 and previous versions that is causing this issue, but I am unable to determine what exactly.

    Any help is greatly appreciated! Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Delicious Brains

    (@deliciousbrains)

    @ogdennews don’t suppose you’re using a version of WordPress earlier than v5.5?

    -IJ

    Thread Starter OgdenNews

    (@ogdennews)

    actually………yes I was. We normally never upgrade to the newest version to avoid running into new WordPress bugs. We let them upgrade naturally. Although that means we might typically be a few versions behind, it prevents us from having to scramble around fixing 100 sites when a zero-day bug gets discovered that wrecks every site.

    I upgraded this site to the latest WordPress version and it did indeed correct the problem. That was a rookie mistake on my part. Even though we don’t upgrade our live sites to the latest version, I should have tried that when I created the test site.

    I went back and looked at all the sites I tested thus far. Naturally – all the sites that were working were above 5.5 and all the sites that were failing were on 5.4 . For some reason, comparing the WP versions between the good and bad sites never crossed my mind.

    I very much appreciate your time and thank you once again for a fantastic and absolutely essential product!

    Thanks!

    Plugin Author Delicious Brains

    (@deliciousbrains)

    Thanks for the kind words @ogdennews, much appreciated.

    It was your detailed support request that helped us determine what the issue was.

    In WP Offload Media 3.2.0 we fixed a bug by using a filter that had a parameter needed for the fix added in WP 5.5. We didn’t realize at the time that the filter had been changed in WP 5.5.

    As a result, we’ve updated the required version of WP to v5.5+ for WP Offload Media Lite 3.2.0+. This means anyone else using a version of WP earlier than v5.5 will not run into this issue.

    Thanks for your help.

    -IJ

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Images fail to move to S3 using v3.2.0+’ is closed to new replies.