After cached thumbnails are removed from the filesystem Craft is unable to regenerate them due to an error being thrown when unlinking non-existent source files. My volumes are all Amazon S3 so I'm thinking this tracks back to it wrongly trying to work with the local filesystem.
If I suppress errors from the unlink call at https://github.com/yiisoft/yii2/blob/22832b7c49602ac99aa2296905aef1c074d89bd5/framework/helpers/BaseFileHelper.php#L407 then the thumbnails generate as expected.
2018-02-20 21:16:43 [10.0.1.1][9][-][warning][craft\services\AssetTransforms::getLocalImageSource] Unable to delete the file "/home/vagrant/app/cms/storage/runtime/assets/sources/1498.jpg".
2018-02-20 21:16:43 [10.0.1.1][9][-][error][craft\errors\VolumeObjectNotFoundException] craft\errors\VolumeObjectNotFoundException: The file "File-1.jpg" does not exist, in /home/vagrant/app/cms/vendor/craftcms/cms/src/services/AssetTransforms.php:851
Stack trace:
#0 /home/vagrant/app/cms/vendor/craftcms/cms/src/services/Assets.php(702): craft\services\AssetTransforms->getLocalImageSource(Object(craft\elements\Asset))
#1 /home/vagrant/app/cms/vendor/craftcms/cms/src/services/Assets.php(629): craft\services\Assets->getThumbPath(Object(craft\elements\Asset), 60, 60, true, true)
#2 /home/vagrant/app/cms/vendor/craftcms/cms/src/controllers/AssetsController.php(825): craft\services\Assets->getThumbUrl(Object(craft\elements\Asset), 60, 60, true)
#3 [internal function]: craft\controllers\AssetsController->actionGenerateThumb('13e82a54-fa1b-4...', 60, 60)
#4 /home/vagrant/app/cms/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#5 /home/vagrant/app/cms/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#6 /home/vagrant/app/cms/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller->runAction('generate-thumb', Array)
#7 /home/vagrant/app/cms/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('generate-thumb', Array)
#8 /home/vagrant/app/cms/vendor/craftcms/cms/src/web/Application.php(224): yii\base\Module->runAction('assets/generate...', Array)
#9 /home/vagrant/app/cms/vendor/craftcms/cms/src/web/Application.php(432): craft\web\Application->runAction('assets/generate...', Array)
#10 /home/vagrant/app/cms/vendor/craftcms/cms/src/web/Application.php(208): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#11 /home/vagrant/app/cms/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#12 /home/vagrant/app/public/cms.php(15): yii\base\Application->run()
#13 {main}
Yikes, thanks for pointing that out. Fixed now, and we’ll get a new release out today.
Same issue when deleting assets https://craftcms.stackexchange.com/questions/23943/craft-3-rc-11-deleting-assets-issue/23945#23945
Looking at this with fresh eyes, I think I must have been sleep-typing earlier. The “fix” in 30db5af5b596e267db136a218209a65cc9fde36e doesn’t actually fix anything at all, and I don’t think I had a grasp of what the actual bug was. ¯_(ツ)_/¯
Fixed for real now though.
Most helpful comment
Yikes, thanks for pointing that out. Fixed now, and we’ll get a new release out today.