unable to create temporary file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
rivarola
Posts: 4
Joined: 2015-06-03T09:57:55-07:00
Authentication code: 6789

unable to create temporary file

Post by rivarola »

Hello,
First, congratulations for the ImageMagick convert utility, that is very usefull and powerfull.
But today, I'm stuck on a permission problem that occurs when the Alfresco ECM (a Tomcat webapp) is run as service on Windows using a service user that is not Administrator (for security purpose). When the convert utility is run by lauching a system command from the Tomcat service, I get this error :

Code: Select all

Execution result: 
   os:         Windows 7
   command:    [C:\Program Files (x86)\ImageMagick-6.7.1-Q16\convert.exe, C:\work\cecm-trunk\temp\Alfresco\ImageMagickContentTransformerWorker_source_4497324710097173389.pdf, +repage, -auto-orient, -background, white, -alpha, Background, -thumbnail, 160x160^>, -gravity, Center, -crop, 160x160+0+0, -extent, 160x160, -auto-orient, C:\work\cecm-trunk\temp\Alfresco\ImageMagickContentTransformerWorker_target_1294637489384402883.png]
   succeeded:  false
   exit code:  1
   out:        
   err:        Magick: unable to create temporary file `C:\work\cecm-trunk\temp\Alfresco\ImageMagickContentTransformerWorker_source_4497324710097173389.pdf': Permission denied @ error/pdf.c/ReadPDFImage/389.
Magick: missing an image filename `C:\work\cecm-trunk\te
	at org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker.transformInternal(ImageMagickContentTransformerWorker.java:183)
	at org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker.transform(AbstractImageMagickContentTransformerWorker.java:249)
The strange thing is that the C:\work\cecm-trunk\temp\Alfresco\ImageMagickContentTransformerWorker_source_4497324710097173389.pdf file exists and is not empty. The window service user has modification permissions under C:\work\cecm-trunk\temp\.

I've already tried to define the MAGICK_TEMPORARY_PATH dir with a writable folder without success.

I have no problem with image -> image conversion using the same service, and pdf -> image conversion works if I run the service as System user. The problem only occurs with pdf -> image transformation when the service runs as normal user.

Any idea ?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: unable to create temporary file

Post by dlemstra »

Can you reproduce this with the latest version of ImageMagick?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
rivarola
Posts: 4
Joined: 2015-06-03T09:57:55-07:00
Authentication code: 6789

Re: unable to create temporary file

Post by rivarola »

Yes, I can reproduce it with ImageMagick 6.9.1 :

Code: Select all

Caused by: org.alfresco.service.cmr.repository.ContentIOException: 05027578 Failed to perform ImageMagick transformation: 
Execution result: 
   os:         Windows Server 2012
   command:    [C:/Program Files/ImageMagick-6.9.1-Q16/convert, D:\CECM\OCSIGENPP\tomcat\temp\Alfresco\ImageMagickContentTransformerWorker_source_1613780199918978696.pdf, +repage, -auto-orient, -background, white, -alpha, Background, -thumbnail, 160x160^>, -gravity, Center, -crop, 160x160+0+0, -extent, 160x160, -auto-orient, D:\CECM\OCSIGENPP\tomcat\temp\Alfresco\ImageMagickContentTransformerWorker_target_1619067051050315207.png]
   succeeded:  false
   exit code:  1
   out:        
   err:        convert.exe: unable to create temporary file `D:\CECM\OCSIGENPP\tomcat\temp\Alfresco\ImageMagickContentTransformerWorker_source_1613780199918978696.pdf': Permission denied @ error/pdf.c/ReadPDFImage/473.
convert.exe: no images defined `D:\CECM\OCSIG
	at org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker.transformInternal(ImageMagickContentTransformerWorker.java:183)
	at org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker.transform(AbstractImageMagickContentTransformerWorker.java:249)
Post Reply