Forum OpenACS Q&A: Cannot work out what I've done wrong.

I have installed OpenACS 5.0.4 and am trying to get the photo-album package to work. However when I try to upload a picture I get the following error :

[12/Apr/2004:11:17:10][9902.49156][-conn0-] Warning: pa_load_images: error parsing file data /tmp/fileLYXXFG Error: couldn't execute "identify": no such file or directory

I have checked the parameters for the instance until they are imprinted on my retina and cannot see anything wrong with them (they are exactly as my 4.6.3 installation on the same machine that works a treat).

The path to the temporary directory is fine, the permissions are fine, I have set a new temp directory in the parameters so that there is no clash with the other openacs instance: /tmp/photo-album-server02 directory,
the path to Image Magick is fine (/usr/X11R6/bin - just as in the 4.6.3 parameters)..........what on earth is wrong!?

I have tried CVS update to the current committed version in HEAD but no luck.

The error seems to be saying that the server was unable to run Identify on the file that I had uploaded because it cannot find the temporary file /tmp/fileLYXXFG . Why is it looking in /tmp rather than in /tmp/photo-album-server02 ?

Does the new version of photo-album erroneously not respect the parameter, or have I done something stupid.

Many Thanks

Posted by Barry Books on
I had the same problem until I added
export PATH=$PATH:$ORACLE_HOME/bin:/sw/bin:/usr/local/bin
to my startup script. On my machine Image Macick is in /sw/bin
Posted by Richard Hamilton on
Thanks for the reply.

/usr/X11R6/bin is already in the system path, so if as the aolserver user I type 'identify filename', identify runs ok.

So I don't think that that is the problem here unless I am missing something.


Posted by Cathy Sarisky on
I assume you've checked the photo-album parameters and have  FullTempPhotoDir and ImageMagickPath set correctly?  It sounds like those are mis-set.  Also check in the kernel parameters for TmpDir.  It sounds like you've missed a parameter somewhere...?
Posted by Richard Hamilton on

I know it sounds like a parameter is mis-set somewhere (I hope it is!) but I have checked everything you have suggested.

The temp directories in the kernel are set correctly - the relevant one is /tmp, and I have been trying to debug this by looking at the variable contents as the file is uploaded and the temporary file is appearing momentarily in /tmp.

The parameter for the photo-album is correctly set to /tmp/photo-album and ad_parameter is returning the correct value.

Also the path to convert and identify are correct and can be successfully called as the aolserver user from the command line in any diectory on the system as simply 'identify file'.

I have not yet worked out why the temporary file is being put in /tmp when the photo-album parameter is set to /tmp/photo-album.

I have tried modifying the call in photo-add-2.tcl from 'pa_upload_images -remove 1' to 'pa_upload_images -remove 0' so that I can examine the file and try manually 'identify'ing it as the aolserver user but despite my setting this parameter to 0 the file still disappears sharpish after the upload.

I am stumped so far.


Posted by Richard Hamilton on
OK everyone - thank you very much for your input.

It turns out that this is in fact a bug in that the photo album procs in the new version of photo-album do not refer to the ImageMagickPath parameter. They simply call identify and convert like this :

exec identify blah blah

They should call like this :

exec [ad_parameter ImageMagickPath]/identify blah blah

This may explains why Barry was able to work around it by setting 'PATH' in the caller's environment however I am not clear why the call didn't work on my system when /usr/X11R6/bin was in the PATH for all users!

It also clarifies the log error which was complaining that it couldn't find Image Magick after all. I could have tried setting the parameter until the cows came home - no code was referring to it!

I will post this as a bug but in case others follow the error to this thread, the procs affected are :


These are to be found in photo-album-procs.tcl - you will need to do a search and replace for all calls to either 'identify' or 'convert' (I think there are five changes to do).

Remember to re-start your server after modifying the procs files (or set package manager to reload the photo album package files after the modifications).


Posted by Don Baccus on
I've made this change to HEAD ...
Posted by russ m on
This may explains why Barry was able to work around it by setting 'PATH' in the caller's environment however I am not clear why the call didn't work on my system when /usr/X11R6/bin was in the PATH for all users!

Just because your user shells all have a particular PATH set doesn't nescessarily mean daemons will also have the same PATH - it depends on how and where it's set, and how the daemons are being started. Try executing env get PATH in an nscp or a simple debug page, and see if the value returned is what you expect it to be...

Posted by Richard Hamilton on
Don, thanks for committing it, I'll download and test the HEAD version.

Russell, thanks for the explanation. I'll do as you suggest - obviously it won't be what I was expecting, I'll have to brush up on my bash config skills!. I thought that /etc/profile would set the PATH for all users and daemons whilst the bash_profile was user specific for terminal sessions. How would I set the PATH for a daemon running as for example nsadmin from inittab?

Posted by Randy O'Meara on

You need to set the PATH in the same shell that 'exec's nsd. If nsd is launched from a shell script that is launched by init (via inittab), set the PATH (using export for bash) in this script before exec'ing nsd. Otherwise you might look into initscript(5).


Posted by Ryan Gallimore on
I'm unable to upload JPEGs to Photo Album but GIFs work fine. I've added the following MIME types to parameters:


Still, I get this error:

Warning: pa_load_images: error parsing file data /tmp/fileQ5NH58 Error: identify: no decode delegate for this image format `/tmp/fileQ5NH58'.

Is this an ImageMagick configuration problem?

Posted by Ryan Gallimore on
I resolved my problem by installing the JPEG library cited in the ImageMagick readme. Then I recompiled ImageMagick.