Forums / Install & configuration / Problem with ImageMagick

Problem with ImageMagick

Author Message

Norman Leutner

Wednesday 27 July 2005 1:22:54 am

Hi together,

Im currently having a Problem with ImageMagick.

You can take a look at http://ho.satrinxa.de/ho/testimage

Every time a new image variation should be created i got:


Warning: eZImageShellHandler::convert Jul 27 2005 10:09:52 
Failed executing: /usr/bin/convert '-quality' '75' '-geometry' '360x440>' 'var/plain/storage/images/testimage/191-1-ger-DE/testimage.jpg' 'JPEG:var/plain/storage/images/testimage/191-1-ger-DE/testimage_imagelarge.jpg', Error: , Return: 1 
Error: eZImageManager::createImageAlias Jul 27 2005 10:09:52 
Failed converting var/plain/storage/images/testimage/191-1-ger-DE/testimage.jpg to alias original in directory var/plain/storage/images/testimage/191-1-ger-DE 

apache logfile:

convert: unable to open image `var/plain/storage/images/testimage/191-1-ger-DE/testimage.jpg': Permission denied. 
convert: missing an image filename `JPEG:var/plain/storage/images/testimage/191-1-ger-DE/testimage_small.jpg'. 

Seems to be a permission problem, but the image is uploaded correctly and permissions are set to 666 on the original image file.

Im using RedHat ES 4 with ImageMagick-6.0.7.1

I tried almost everything to fix that problem...

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Wednesday 27 July 2005 2:00:34 am

I wrote a small testscript that works fine:

<?php

exec("/usr/bin/convert -geometry 100x75 bild.jpg bild_klein.jpg");

?>

So its no general problem with ImageMagick

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Wednesday 27 July 2005 2:37:49 am

If i call my script with the image uploaded my eZpublish, the script return the same error.

I uploaded a image to the same folder that works fine with the testscript

[root@ds80-237-184-87 191-1-ger-DE]# ls -al
total 216
drwxrwxrwx  2 apache apache   4096 Jul 27 11:29 .
drwxrwxrwx  3 apache apache   4096 Jul 26 14:21 ..
-rw-r--r--  1 root   root    47216 Mar 25 14:27 testimage2.jpg
-rw-rw-rw-  1 apache apache 140608 Jul 26 14:21 testimage.jpg

Maybe it's a problem if the file is owned by apache.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Wednesday 27 July 2005 2:49:40 am

ok, i changed the owner and got the same problem:

-rw-r--r--  1 root   root    47216 Mar 25 14:27 testimage2.jpg
-rw-r--r--  1 root   root   140608 Jul 26 14:21 testimage.jpg

testimage2.jpg in convertes correctly.
testimage.jpg returns the error.

This rehavior is really weird....

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Wednesday 27 July 2005 2:57:47 am

Next step:

Maybe there is a limit for the apache user itself within Red Hat ES 4

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Monday 01 August 2005 2:08:04 am

I changed the memory limit "max locked memory" within the
/etc/security/limits.conf
to 64 MB.

no result.

Removed the ImageMagick rpm package.
Reinstalled it.

no changes.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Monday 01 August 2005 2:20:21 am

Looking through my logfiles i found the following within the /var/log/messages

Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.493:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.499:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.499:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.499:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.499:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.500:0): avc:  denied  { getattr } for  pid=8941 comm=convert path=/var/www/html/hoppecke/ezp360/var/plain/storage/images/crashing_testimage/197-1-ger-DE/crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file
Aug  1 10:18:42 ds80-237-184-87 kernel: audit(1122884322.500:0): avc:  denied  { read } for  pid=8941 comm=convert name=crashing_testimage.jpg dev=sda3 ino=6735000 scontext=user_u:system_r:httpd_sys_script_t tcontext=root:object_r:httpd_tmp_t tclass=file

So its a problem with the preinstalled SELinux within RedHat ES 4.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Jason Senich

Friday 12 August 2005 8:09:48 am

I've been screwing around with this problem for two days and I think I've just solved it. I'm running Mandriva LE 2005 in paranoid mode so I figured that it was some sort of permissions issue since it was working fine on our old Mandrak 10.0 and 10.1 installs in a lower security mode. I added the apache user to the xgrp group and then restarted the httpd service and everything seems to work fine now. I hope this helps out with your problem.