• Resolved danrancan

    (@danrancan)


    When trying to regenerate thumbnails using this plugin, the majority of files regenerate correctly. However, I am getting some errors that are all the same with different files. In wordpress gui using the regenerate thumbnails plugin, the error is:

    Skipped Attachment ID 58: Gateway Time-out

    I am running a LEMP server and have full access to my server. So when using wp-cli, and running the command wp media regenerate 58 60 65 66 I am getting the following errors:

    Found 4 images to regenerate.

    PHP Warning:  unlink(/var/www/oddcake.net/wp-content/uploads/2020/02/geometric-3066080-300x169.jpg): Permission denied in phar:///usr/local/bin/wp/vendor/wp-cli/media-command/src/Media_Command.php on line 645
    Warning: unlink(/var/www/oddcake.net/wp-content/uploads/2020/02/geometric-3066080-300x169.jpg): Permission denied in phar:///usr/local/bin/wp/vendor/wp-cli/media-command/src/Media_Command.php on line 645
    PHP Warning:  unlink(/var/www/oddcake.net/wp-content/uploads/2020/02/geometric-3066080-200x200.jpg): Permission denied in phar:///usr/local/bin/wp/vendor/wp-cli/media-command/src/Media_Command.php on line 645
    Warning: unlink(/var/www/oddcake.net/wp-content/uploads/2020/02/geometric-3066080-200x200.jpg): Permission denied in phar:///usr/local/bin/wp/vendor/wp-cli/media-command/src/Media_Command.php on line 645

    etc… etc..

    How can I fix this plugin and prevent it from timing out, and how can I fix the wp-cli problem? I am assuming they go hand in hand somehow. Thank you for any help!

    • This topic was modified 4 years, 8 months ago by danrancan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Alex (a11n)

    (@alexsanford1)

    From the CLI warning, it seems that it is having trouble deleting unused thumbnail files. Are the 300x169 and 200x200 sizes ones that you expect it to be trying to delete?

    I would first check the files (e.g. /var/www/oddcake.net/wp-content/uploads/2020/02/geometric-3066080-300x169.jpg) to see if the permissions are set up as expected. It looks like the WordPress process does not have permissions to remove these files.

    Can you tell if there are any thumbnails that you are expecting it to generate but are not being generated? Or is it only failing to remove the unused ones?

    Just chiming in: To get around the Gateway Time-out (and since you have full access to the instance) in the web UI (obviously, this won’t make a difference with the CLI), perhaps you could try:

    • Make sure that your machine is hitting the instance’s direct IP address (in the case that you are behind some sort proxy like Cloudflare, etc) by adding it to your /etc/hosts
    • Set your nginx timeout to something very high (fastcgi_read_timeout or proxy_read_timeout, etc)
    • Though I’m guessing that the timeout response code is being sent from nginx (since PHP would just throw an exception), it probably wouldn’t hurt to make sure that max_execution_time is set sufficiently high in php.ini

    Just some ideas…
    Daniel

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Errors Encountered: Skipped Attachment ID 58: Gateway Time-out’ is closed to new replies.