ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
We are using ImageMagick and JMagick in our production environment, initially it was really hard to configure everything on Production, Its been almost two month we are using ImageMagick and Jmagick and its worked very good in term of performance, but the problem after every week or two we found that its throws the following error and then we have no other option but to restart the production Weblogic server and everything start working as expected.
Postscript delegate failed `/opt2/jmagick-cache-storage/859e6ae6-fe90-46b8-86c9-caa99e9bea39.pdf':
No such file or directory @ error/pdf.c/ReadPDFImage/678
at magick.MagickImage.readImage(Native Method)
Server environment is:
1- Oracle Enterprise Redhat Linux 7.2
2- WebLogic Server 10.3
3- JDK 1.7
4- ImageMagick 6.7.8
5- Ghostscript 9.18
6- Jmagick Latest
In order to reproduce the problem on local machine I wrote the small program with 100 concurrent thread (all thread read the same file and save it into 'jmagick-cache-storageTest' directory with unique name and then ImageMagick try to generate the thumbnail of saved file , first iteration for all thread its generate thumbnail properly and in second iteration some where after 60th thread it start throwing this error ) and it actually crashed after 30,40 mint and throw the following error:
Postscript delegate failed `/opt2/jmagick-cache-storageTest/859e6ae6-fe90-46b8-86c9-caa99e9bea39.pdf':
No such file or directory @ error/pdf.c/ReadPDFImage/678
at magick.MagickImage.readImage(Native Method)
Local environment is:
1- Centos Linux 7.2
2- JDK 1.7
3- ImageMagick 6.7.8
4- Ghostscript 9.18 (also tried with 9.20)
6- Jmagick Latest
its seems that this is ImageMagick problem, any guidance.
Thanks in advance.
Postscript delegate failed `/opt2/jmagick-cache-storage/859e6ae6-fe90-46b8-86c9-caa99e9bea39.pdf':
No such file or directory @ error/pdf.c/ReadPDFImage/678
at magick.MagickImage.readImage(Native Method)
Server environment is:
1- Oracle Enterprise Redhat Linux 7.2
2- WebLogic Server 10.3
3- JDK 1.7
4- ImageMagick 6.7.8
5- Ghostscript 9.18
6- Jmagick Latest
In order to reproduce the problem on local machine I wrote the small program with 100 concurrent thread (all thread read the same file and save it into 'jmagick-cache-storageTest' directory with unique name and then ImageMagick try to generate the thumbnail of saved file , first iteration for all thread its generate thumbnail properly and in second iteration some where after 60th thread it start throwing this error ) and it actually crashed after 30,40 mint and throw the following error:
Postscript delegate failed `/opt2/jmagick-cache-storageTest/859e6ae6-fe90-46b8-86c9-caa99e9bea39.pdf':
No such file or directory @ error/pdf.c/ReadPDFImage/678
at magick.MagickImage.readImage(Native Method)
Local environment is:
1- Centos Linux 7.2
2- JDK 1.7
3- ImageMagick 6.7.8
4- Ghostscript 9.18 (also tried with 9.20)
6- Jmagick Latest
its seems that this is ImageMagick problem, any guidance.
Thanks in advance.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Please Note that we are converting PDF into JPEG thumbnail, and the possible reason might be JPEG delegates?
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Download the latest release of ImageMagick, 6.9.6-7. Try it with the program you wrote. Does it still fail? If so, post a URL to your test program so we download it and attempt to reproduce the problem. If we can reproduce it, we should be able to find the source of the failure. With 100 threads, you are likely running into a resource constraint, however without reproducing the problem locally, we can't be sure.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
We are having the crashing issue on our production server which have high resource 20 physical core, 48GB memory and only few hundred user are uploading the file at a time and it crashed. and we have to restart the server and everything start working normally , now its happend very often almost twice a day.
Anyhow as per your suggestion I upgraded the Imagemagick on our test environement, and find out new problem
ImageMagick:
Version: ImageMagick 6.9.6-8 Q16 x86_64 2016-12-11 http://www.imagemagick.org
Copyright: Copyright 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig jng jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib
GhostScript:
GPL Ghostscript 9.20 (2016-09-26)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
Commnad to generate pdf to jpg or PNG :
> convert thumnailproblem.pdf th.jpg
>convert thumnailproblem.pdf th.png
generate the empty/Blank Images. which was working fine the old version which I have.
Please note that only few pdf file have this issue, I have lot of other pdf which are working fine but few of them have the issue of empty/blank image.
Can you kindly guide me what should I do ?
Anyhow as per your suggestion I upgraded the Imagemagick on our test environement, and find out new problem
ImageMagick:
Version: ImageMagick 6.9.6-8 Q16 x86_64 2016-12-11 http://www.imagemagick.org
Copyright: Copyright 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig jng jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib
GhostScript:
GPL Ghostscript 9.20 (2016-09-26)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
Commnad to generate pdf to jpg or PNG :
> convert thumnailproblem.pdf th.jpg
>convert thumnailproblem.pdf th.png
generate the empty/Blank Images. which was working fine the old version which I have.
Please note that only few pdf file have this issue, I have lot of other pdf which are working fine but few of them have the issue of empty/blank image.
Can you kindly guide me what should I do ?
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Please note that we are using Oracle Enterprise Redhat Linux 7.2 in our test as well as production environment.
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
We're using ImageMagick 6.9.6-8 and Ghostscript 9.20. Your PDF converted with expected results-- that is we get 15 pages of rendered text without any visible artifacts. With an older version of Ghostscript, we did get a blank page with this exception: ERROR: Unable to process JPXDecode data.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
and what version of ghostscript-devel you are using?
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
We're using ghostscript-devel, version 9.20-5.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
from where I can get "ghostscript-devel" , version 9.20-5 for centos/Redhat, as I did not find the ghostscript-devel 9.20-5 package for centos (yes for Fedora its available), as only available devel package for centos/redhat is 9.07.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Does it mean that we can not use Latest Imagemagick on Centos/Redhat Linux ?
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Can you view the PDF with this command: gs 'Blank Thumbnail SVU.pdf'? Do you get expected results? If so, does ImageMagick render the PDF from the command line, e.g. convert my.pdf my.gif? If so, perhaps its a threading issue. Rebuild ImageMagick from source. Add --without-gslib to your configure command-line, e.g. configure --without-gslib. Now build and install ImageMagick. Does the PDF render now in a threaded environment? If so, let us know. We may need to single thread Ghostscript execution.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Thank you for your support, Anyhow We decided to externalize ImageMagick and we are planning to run the pdf processing in a separate cluster of machine, so that even its fail we can redirect traffic to other machine, Can you kindly suggest us Which Linux OS you guys are recommending to RUN the Latest and greatest of ImageMagick and Ghostscript, Please note that we will use Jmagick wrapper library for PDF Processing in JAVA.
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
It doesn't matter which Linux OS you choose. However, be sure to install the latest releases of ImageMagick and Ghostscript to help ensure your PDF's will render properly.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Error in multithreaded environement - After upgrading IM. Please note that not all the execution is failed, out of 100 thread few thread are throwing following exception, Please note that we needed ImageMagick 6.9.*** in order to compile JMagick Lib, as we can not compile Jmagick with version 7,
java.io.IOException: magick.MagickApiException: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-2567L1Zc_GvIp8HA%d" "-f/tmp/magick-25670TCob9drImc0" "-f/tmp/magick-2567KsTeiEj8HQj3"' (-1) @ error/delegate.c/ExternalDelegateCommand/483
at JavaMagickMultiThread.processAndSavePdfAndPagesJMagick(JavaMagickMultiThread.java:148)
at JavaMagickMultiThread$1.run(JavaMagickMultiThread.java:44)
at java.lang.Thread.run(Thread.java:745)
Caused by: magick.MagickApiException: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-2567L1Zc_GvIp8HA%d" "-f/tmp/magick-25670TCob9drImc0" "-f/tmp/magick-2567KsTeiEj8HQj3"' (-1) @ error/delegate.c/ExternalDelegateCommand/483
at magick.MagickImage.readImage(Native Method)
at magick.MagickImage.<init>(MagickImage.java:96)
at JavaMagickMultiThread.processAndSavePdfAndPagesJMagick(JavaMagickMultiThread.java:103)
... 2 more
java.io.IOException: magick.MagickApiException: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-2567L1Zc_GvIp8HA%d" "-f/tmp/magick-25670TCob9drImc0" "-f/tmp/magick-2567KsTeiEj8HQj3"' (-1) @ error/delegate.c/ExternalDelegateCommand/483
at JavaMagickMultiThread.processAndSavePdfAndPagesJMagick(JavaMagickMultiThread.java:148)
at JavaMagickMultiThread$1.run(JavaMagickMultiThread.java:44)
at java.lang.Thread.run(Thread.java:745)
Caused by: magick.MagickApiException: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-2567L1Zc_GvIp8HA%d" "-f/tmp/magick-25670TCob9drImc0" "-f/tmp/magick-2567KsTeiEj8HQj3"' (-1) @ error/delegate.c/ExternalDelegateCommand/483
at magick.MagickImage.readImage(Native Method)
at magick.MagickImage.<init>(MagickImage.java:96)
at JavaMagickMultiThread.processAndSavePdfAndPagesJMagick(JavaMagickMultiThread.java:103)
... 2 more
Last edited by nazakatqureshi on 2016-12-18T07:05:03-07:00, edited 1 time in total.
-
- Posts: 19
- Joined: 2016-11-21T01:13:17-07:00
- Authentication code: 1151
Re: ImageMagick crashed Weblogic in Enterpise Oracle Redhat Linux 7.2
Can you kindly guide me , what to do now ?