Broken image links in publication and admin site within the new custodian theme
  • Hi everyone,

    I looked in the forum for a solution for an annoying problem with images, which appear "sporadically" someway broken within the publication and admin site. The image upload itself works with no trouble through the admin interface, but the uploaded image files could not get displayed.

    Getting some  links like:
    http://<MY-SITE>/images/cache/500x333/crop_/images|cms-image-000000099.jpg (Article) => There's no "/images/cache/500x333/crop_/" path in my newscoop directory!!)
    or
    http://<MY-SITE&gt;/images/cache/150x150/fit/images%7Ccms-image-000000099.jpg (media archive) => The referenced file "images%7Ccms-image-000000099.jpg" ist not within th "./images/cache/150x150/fit/" directory.

    Whereas on the filesystem, the new uploaded image is only within these paths:
    ./images/cms-image-000000099.jpg
    ./images/thumbnails/cms-thumb-000000099.jpg


    I'm running Newscoop 4.0.3 on a debin machine with nginx. If this issue is very specific (e.g. due to the used rewrite rules), here are mines https://wiki.sourcefabric.org/display/CS/Install+Newscoop+under+Nginx

    Any help ?

    Regards
    Wahid


    720 x 848 - 31K
    1294 x 498 - 86K
  • 16 Comments sorted by
  • so after some testing here i have suggestion:

    try to remove break from location ~* /+cache/ . i think it's not triggering php but returning index.php content

  • Hi Wahid,

    Interesting (and you are right, annoying too) issue :-)

    Images broken are the images renditions Newscoop generates out of the original image, and those directories are created on the fly. Clearly there is a problem when either creating the directory or placing the image into an already existing directory.

    There are several users already using Newscoop renditions in production environments experimenting no issues at all with images, so this might be a platform specific. We will investigate this anyway and will let you know here soon.

    Thanks for reporting.

    All Best and a Happy NY !

  • I think you use Windows Environment. This is because Windows does not support the character % in its file name system.
  • do you have images/cache directory writable?
    this 500x333/crop/ part should be autogenerated
  • Hi Wahid,


    Interesting (and you are right, annoying too) issue :-)

    Images broken are the images renditions Newscoop generates out of the original image, and those directories are created on the fly. Clearly there is a problem when either creating the directory or placing the image into an already existing directory.

    There are several users already using Newscoop renditions in production environments experimenting no issues at all with images, so this might be a platform specific. We will investigate this anyway and will let you know here soon.

    Thanks for reporting.

    All Best and a Happy NY !

    @Holman Thank you for the feedback. Sure it's a platform specific behavior. 

    sdancer75 said:

    I think you use Windows Environment. This is because Windows does not support the character % in its file name system.


    @sdancer75 Fortunately not :) , as said it's Debian Linux environment.

    do you have images/cache directory writable?

    this 500x333/crop/ part should be autogenerated

    @Petr I think you may be right with your supposition. The permissions for the image directory in my newscoop install look like the following:

    ./images 775
    ./images/cache 755
    ./images/thumnails 775
    ./images/image_cache 755

    As you see for the ".images/cache" and "images/image_cache" directories the user group has only "Execute/Read"-Permissions. The fact is: I didn't modify any of the dir/file permissions within the newscoop installation folder after untaring the release tarball.

    So should I now change the permissions of both directories into 775 ?


    Thank you & best Regards
    Wahid

    +++ UPDATE +++
    I set every directory permission inside .images/cache (and cache itself!) recursively into 775 and even 777 with no success. Dynamically created images could even so not get created :-/ !
    Post edited by Wahid Atif at 2013-01-11 08:14:45
  • Make sure the user running the webserver is owner of the images/cache directory or that has write permissions there.

    You may have 755 or 775 for images/directory, but if the user and group owners of that directory is user = root, group = root, then it doesn't help.
  • Aha, didn't see the update, if 777 didn't make the trick then there must be something else. Any other info on settings you could share?
  • Aha, didn't see the update, if 777 didn't make the trick then there must be something else. Any other info on settings you could share?



    @Holman The user and group with the tried permissions are of course not root. I have an own user for the virtual host. I couldn't understand why some image files could be created within the ".images/thumbnails" directory but not inside the ".images/cache", even that the user permissions are the same.

    Which settings should I look for ? php ? 
  • it might nginx escaping, can u try to open in browser image url and replace there %7C with %257C or just with | ?
  • it might nginx escaping, can u try to open in browser image url and replace there %7C with %257C or just with | ?


    Hi Petr,

    unfortunately it didn't work! Any other suggestion ?

    Regards
    Wahid
    Post edited by Wahid Atif at 2013-01-20 06:15:19
  • i'm not sure, could you send me your site credentials (via pm) so i can debug it there?
  • i'm not sure, could you send me your site credentials (via pm) so i can debug it there?



    Hi Petr,

    you meant the site administration credentials?

  • hi, i would need ssh/ftp access so i can debug the code
  • or maybe just your nginx setup i will try to reproduce it, do you have debian stable or testing?

  • or maybe just your nginx setup i will try to reproduce it, do you have debian stable or testing?



    Hi Petr,

    actually , I just used the nginx host config from Martin Saturka on Confluence (see https://wiki.sourcefabric.org/display/CS/Install+Newscoop+under+Nginx).

    I attached the nginx host file.

    I hoped it gives a hint to the the problem.

    Regards
    Wahid
  • Reply to @Petr+Jasek:




    so after some testing here i have suggestion:


    try to remove break from location ~* /+cache/ . i think it's not triggering php but returning index.php content




    Bingo, it works :) ! Thank you  !
    I will leave a comment under the nginx how-to in Confluence , so that Martin Saturka will know about it.

    Kind regards
    Wahid