7

I have a project where I keep my uploaded images in src/My/Bundle/Resources/uploads/images/full and use the twig filter imagine_filter to dynamically create thumbnails.

On my local machine it works flawlessly and so does on my server, but there only under the dev environment. When I delete the previously created thumbnails (leaving only the full directory), clear the prod cache and load any web page, the images are not created, their url always remains under media/cache, and the logger gives me the request.ERROR:

"No route found for "GET /uploads/images/avatar/354026c94b773b77ca945b4a6323e15c84102f6b.jpg"" at /<path>/app/cache/prod/classes.php line 1964 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /uploads/images/avatar/354026c94b773b77ca945b4a6323e15c84102f6b.jpg\" at /<path>/app/cache/prod/classes.php:1964, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException:  at /<path>/app/cache/prod/appProdUrlMatcher.php:1816

Some additional infos:

  • I have symlinked src/My/Bundle/Resources/uploads to web/uploads
  • my config is (thumbnail_min is a custom filter): liip_imagine: loaders: default: filesystem: data_root: %kernel.root_dir%/../web/uploads/images/full resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: /uploads/images cache: default filter_sets: avatar: quality: 90 filters: thumbnail_min: { size: 50, mode: inset } .... full: quality: 100
  • permissions are always at least group rw (that's what is needed on the server)
Enoah Netzach
  • 747
  • 6
  • 14

1 Answers1

0

Just experienced a similar problem on my local machine, however still in dev environment.

For me, I was missing group writable permission on the default media/cache folder, which stayed empty after a liip:imagine:cache:remove and page reload. Thus images were linking to empty folder.

To fix, I first made sure that Group was set to Apache's _www (mac) / www-data (linux), e.g.

  • sudo chgrp -R www-data web/media/cache

Then made sure the folder was set to readable, writable and executable, e.g.

  • sudo chmod -R g+rwx web/media/cache

Hope this helps...

djaed
  • 166
  • 2
  • 4
  • unfortunately not, the problem only exists when a lot of images are requested at once, if they are accessed in smaller numbers it doesn't happen, so I'm sure it isn't the permission (as I said in the question..) – Enoah Netzach Dec 10 '14 at 12:39
  • did u find a solution? i am stuck with the same problem – smartius Jan 16 '15 at 15:33