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.

eZ debug

Timing: Jan 19 2025 03:39:51
Script start
Timing: Jan 19 2025 03:39:51
Module start 'content'
Timing: Jan 19 2025 03:39:51
Module end 'content'
Timing: Jan 19 2025 03:39:52
Script end

Main resources:

Total runtime0.1410 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.9766180.8281
Module start 'content' 0.00640.0043 769.8047110.0234
Module end 'content' 0.01070.1302 879.8281539.3047
Script end 0.1409  1,419.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.2484200.0002
Check MTime0.00140.9744200.0001
Mysql Total
Database connection0.00060.434110.0006
Mysqli_queries0.100471.20921410.0007
Looping result0.00130.90431390.0000
Template Total0.129992.110.1299
Template load0.00080.575210.0008
Template processing0.129191.546310.1291
Override
Cache load0.00060.407910.0006
Sytem overhead
Fetch class attribute can translate value0.00100.712810.0010
XML
Image XML parsing0.00020.174510.0002
General
dbfile0.00322.2485200.0002
String conversion0.00000.004230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs