Image optimization only pulls a few images then stops
-
Hi,
I am having problems with image optimization on a number of websites.
The request seems to work fine, requesting 200 images. Then I get a notification saying that 200 images are notified to pull. However, when I pull them, either manually or via cron, only 3 or 4 images are pulled. Its then not possible to pull any more images. To continue, I need to clean up unfinished data and start the process again.
I have this problem on numerous websites.
All the best, Mike.
The page I need help with: [log in to see the link]
-
please go to LiteSpeed Cache -> toolbox -> debug setting -> set debug log to ON , debug level to advance , debug include URI add
notify_imgandasync_litespeed,then go to toolbox -> log view -> clean up existing log
now send/pull images again , once it finishes or stops , go to log view again , copy paste and share the log via https://pastebin.ubuntu.com/
Many thanks.
I was trying to start with a clean log for the test, but I have used up my daily quota now. I will either perform the test on a different site or wait until tomorrow.
All the best, Mike.
Hi,
I have performed the test on another website that I am having problems with.
This time there were 73 images requested.
73 images notified to pull.
When I pulled them manually, 17 images were pulled and the optimization status says:
Images notified to pull:
16 groups (56 images)Last pull initiated by cron at
8s ago.Clean Up Unfinished Data: 56 images.
The Pull Images button remains greyed out.
As before, the only way to get out of this would be to clean up the images and start the process again.
Debug log shared here: https://pastebin.ubuntu.com/p/TYVx3SMXmv/
no no , don’t clean up again , the pull doesn’t pull all images at once , it is async operation which means it will pull images per batch , give it another 5 or 10 minutes and check again
OK. I have waited over 15 minutes now. Its still stuck at 56 images. Status shows:
Images notified to pull:
16 groups (56 images)Last pull initiated by cron at
2m 7s ago.Β Clean Up Unfinished Data: 56 images
Request and pull buttons are greyed out.
I have re-pasted the debug log here: https://pastebin.ubuntu.com/p/jTwCg4RBxM/
All the best, Mike.
ποΈ β failed to pull image: cURL error 28: Connection timed out after 10001 milliseconds
this shows the plugin tries to pull again , but somehow the connection was not able to connect
define('LITESPEED_FORCE_WP_REMOTE_GET', true);please try add this to your wp-config.php , clean up unfinished data and try again, this code should change the pulling from parallel to single-thread mode , to avoid possible block, some security measure may be triggered if short time with a lot of requests
That is already in wp-config.php as a result of a ticket I raised last week due to a different error. The ticket ID is 847880. Note that there is a different email address associated with it.
Note that I have also added the QUIC.cloud IP addresses to my Wordfence WAF Firewall whitelist.
By the way, someone has just read this post and tried to sell me professional web developer services by doing a contact form submission on the website that I specified I wanted help with. The contact form submission went to my client clearly. That is shocking!
<?php
require('./wp-load.php');
for ($i = 1; $i <= 50; $i++) {
echo "try on $i: ";
$response = wp_remote_get('https://node9.quic.cloud/dl/d_7552249/686bbe5fcab2d0.02979624.jpg');
if (is_wp_error($response)) {
echo "Error: " . $response->get_error_message() . "<br>";
exit();
}
$status_code = wp_remote_retrieve_response_code($response);
echo "success: $status_code <br>";
}
echo "All good <br>";
?>wordfence might not be enough , if your server has server-level security measure
please try create a php file , name it like
test.phpwith above code, put it at same dir as your wp-config.php , then open it in browser, see what it returns.Hi @qtwrk ,
I am afraid I have spent too much time already trying to debug this issue. It all worked seamlessly prior to version 7. I plan to use a different plugin for my image optimization.
Thanks for your help.
All the best, Mike.
Hi @qtwrk
I would really like to use Litespeed Cache so I am continuing this investigation in my spare time.
I have created a test website. The test website does not have Wordfence. I raised a ticket with my hosting company. They confirmed that Imunify360 is not blocking traffic and they have disabled ModSecurity so there are no firewalls in the way.
I am still seeing the initial pull working, but any subsequent pull is blocked with the following error in the debug log:
ποΈ β failed to pull image: cURL error 28: Connection timed out after 10002 milliseconds
I have run your test php script, but with the image url replaced with the one that is failing in my test website and I get the followig result:
try on 1: Error: cURL error 28: Connection timed out after 5001 milliseconds
The script I ran was:
<?php
require('./wp-load.php');
for ($i = 1; $i <= 50; $i++) {
echo "try on $i: ";
$response = wp_remote_get('https://node9.quic.cloud/dl/d_7588245/686d590061f3f3.33329865.jpg');
if (is_wp_error($response)) {
echo "Error: " . $response->get_error_message() . "<br>";
exit();
}
$status_code = wp_remote_retrieve_response_code($response);
echo "success: $status_code <br>";
}
echo "All good <br>";
?>Any idea what is happening?
https://node9.quic.cloud/dl/d_7588245/686d590061f3f3.33329865.jpgdoes this image open in your browser ?
Yes
the script was simplify calling
wp_remote_get()function to load that image, and it fails , while your browser can opens it , which lead to most probably reason is that your server has blocked the connection to image nodeI’d suggest to check with your hosting provider, if there is any sever-side security measures may block it
you should also forward above test script to hosting provider , they will understand
The topic ‘Image optimization only pulls a few images then stops’ is closed to new replies.