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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 04:38:48
Script start
Timing: Jan 19 2025 04:38:48
Module start 'layout'
Timing: Jan 19 2025 04:38:48
Module start 'content'
Timing: Jan 19 2025 04:38:48
Module end 'content'
Timing: Jan 19 2025 04:38:48
Script end

Main resources:

Total runtime0.0155 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.1797152.6250
Module start 'layout' 0.00580.0031 741.804739.4453
Module start 'content' 0.00900.0045 781.2500105.4766
Module end 'content' 0.01350.0020 886.726646.3047
Script end 0.0155  933.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.6682140.0002
Check MTime0.00127.4243140.0001
Mysql Total
Database connection0.00074.596610.0007
Mysqli_queries0.002717.654830.0009
Looping result0.00000.096810.0000
Template Total0.001710.710.0017
Template load0.00096.110310.0009
Template processing0.00074.588910.0007
Override
Cache load0.00074.376810.0007
General
dbfile0.00031.656780.0000
String conversion0.00000.059940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs