0

Very recently I had to perform a minor upgrade on an extension (eBizmarts Mailchimp) in my Magento 2.1.7 installation. It went smoothly, as usual, even though it is terrifying to do this for fear of Magento completely breaking!

Anyway, after going through all the usual steps, and cleaning caches, etc, the site was returned to LIVE status, and all appeared to be normal. My steps are as follows: bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy en_GB bin/magento indexer:reindex bin/magento cache:clean bin/magento cache:flush Reapply permissions

That night, and every night since, I get an email at 1:20am with these contents:

Product alerts cron warnings

Warning: getimagesize(): Filename cannot be empty in /var/www/vhosts/website/htdocs/vendor/magento/module-catalog/Model/Product/Image.php on line 922

Warning: getimagesize(): Filename cannot be empty in /var/www/vhosts/website/htdocs/vendor/magento/module-catalog/Model/Product/Image.php on line 922

Warning: getimagesize(): Filename cannot be empty in /var/www/vhosts/website/htdocs/vendor/magento/module-catalog/Model/Product/Image.php on line 922

And so it continues, exactly the same for another 91 lines.

I do not see any corresponding error in any log files.

I can only imagine that something is perhaps cached on the server somewhere (in Magento) causing this, but it isn't actually causing an error? Maybe it is but I don't know about it.

Has anyone come across this before and knows what the issue is, and more importantly, how to fix it?

I am able to manually run cron on the server without any errors. When I use the command:

bin/magento cron:run

I get the following message back:

Ran jobs by schedule.

The error did not happen before the last update as mentioned above, and any products that have been added since the update have all got perfectly working images against them.

Could it be an unseen rogue image on a new item maybe? Or maybe 94 new items (one for each entry in this email)?

How do I debug this with no apparently useful info beyond this email?

1 Answer 1

1

I don't have a 2.1.7 available at the moment, but:

  1. You could temporarily edit the core to output a more precise error message, maybe with a SKU
  2. if you only do bin/magento cron:run when the conjob in question (product alerts) is not scheduled, it will not be executed and you won't be able to see the error messages. n98-magerun2 has a nice command sys:cron:run that actually lets you run a job by code. If you run php n98-magerun2.phar sys:cron:run catalog_product_alert from your command line, you could also be able to reproduce the error on your development machine
  3. In my Magento (v2.1.8), there's a comment in line 922, but some placeholder-functionality using getimagesize() is right below. So you might want to check this setting first, to see if it is configured correctly
4
  • Thanks for this useful response! Appreciated!! I am keen to try out n98-magerun2, but having searched through tons of documentation about it, I cannot find out if it is a server based installation, or a magento based installation? I think it is server based, but I cannot find a definitive answer to this, and I am worried about installing it and breaking my Magento!
    – robgt
    Jul 3, 2018 at 10:34
  • 1
    You don't install it. It's a PHAR file, similar to Java's JAR files. You simply download it, log into your server with SSH (or use your local terminal) and execute it using PHP. Complete guide here: github.com/netz98/n98-magerun#download-and-install-phar-file and yes, that's it. It does not interfere with your Magento installation. A normal user that requests the front- oder backend will have no contact with n98-magerun Jul 3, 2018 at 10:58
  • Oh, the link is for Magento 1. Here is an update: github.com/netz98/n98-magerun2#download-and-install-phar-file Jul 3, 2018 at 10:59
  • Thanks again for the help. Making more sense to me right now :-) Time to have a play with n98-magerun2!
    – robgt
    Jul 3, 2018 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.