Topic on Extension talk:CirrusSearch

Error creating thumbnail: convert: unable to extend cache File too large

3
S0ring (talkcontribs)

PDF file with large resolution (~3,500 × 2,500 or larger) in the "Search results" won't show a thumbnail, but the following error:

Error creating thumbnail: convert: unable to extend cache `/tmp/magick-67rYBVGl1cqvlF': File too large @ error/cache.c/OpenPixelCache/4104. convert: no images defined `images/tmp/transform_bc3ca503600a.jpg' @ error/convert.c/ConvertImageCommand/3258.

Note. Other PDF files with smaller resolution i.e. (~1,300 × 1,750) will show a thumbnail as expected.


From the logs result the error:

File::transform: Doing stat for mwstore://local-backend/local-thumb/2/21/<filename>.pdf/page1-120px-<filename>.pdf.jpg

[FileOperation] FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/2/21/<filename>.pdf/page1-120px-<filename>.pdf.jpg does not exist.

PdfHandler::doTransform: called wfMkdirParents(images/tmp)

PdfHandler::doTransform: ('/usr/bin/gs' '-sDEVICE=jpeg' '-sOutputFile=-' '-dFirstPage=1' '-dLastPage=1' '-dSAFER' '-r150' '-dBATCH' '-dNOPAUSE' '-q' 'images/2/21/<filename>.pdf' | '/usr/bin/convert' '-depth' '8' '-quality' '95' '-resize' '120' '-' 'images/tmp/transform_bc3ca503600a.jpg')

[exec] MediaWiki\Shell\Command::execute: /bin/bash '/var/www/html/includes/shell/limit.sh' '('\''/usr/bin/gs'\'' '\''-sDEVICE=jpeg'\'' '\''-sOutputFile=-'\'' '\''-dFirstPage=1'\'' '\''-dLastPage=1'\'' '\''-dSAFER'\'' '\''-r150'\'' '\''-dBATCH'\'' '\''-dNOPAUSE'\'' '\''-q'\'' '\''images/2/21/<filename>.pdf'\'' | '\''/usr/bin/convert'\'' '\''-depth'\'' '\''8'\'' '\''-quality'\'' '\''95'\'' '\''-resize'\'' '\''120'\'' '\''-'\'' '\''images/tmp/transform_bc3ca503600a.jpg'\'')' 'MW_INCLUDE_STDERR=1;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'

[thumbnail] Removing bad 0-byte thumbnail "images/tmp/transform_bc3ca503600a.jpg". unlink() succeeded

[thumbnail] thumbnail failed on 2b475d55050d: error 1 "convert: unable to extend cache `/tmp/magick-67rYBVGl1cqvlF': File too large @ error/cache.c/OpenPixelCache/4104.

convert: no images defined `images/tmp/transform_bc3ca503600a.jpg' @ error/convert.c/ConvertImageCommand/3258." from "('/usr/bin/gs' '-sDEVICE=jpeg' '-sOutputFile=-' '-dFirstPage=1' '-dLastPage=1' '-dSAFER' '-r150' '-dBATCH' '-dNOPAUSE' '-q' 'images/2/21/<filename>.pdf' | '/usr/bin/convert' '-depth' '8' '-quality' '95' '-resize' '120' '-' 'images/tmp/transform_bc3ca503600a.jpg')"


The /tmp partition is enough free space (14G out of 30G):

# df -h /tmp

Filesystem      Size  Used Avail Use% Mounted on

overlay          30G   16G   14G  54% /


The problem seems to be on the browser side, while on the line command no error occurs:

# /usr/bin/gs -sDEVICE=jpeg -sOutputFile=- -dFirstPage=1 -dLastPage=1 -dSAFER -r150 -dBATCH -dNOPAUSE -q images/2/21/<filename>.pdf | /usr/bin/convert -depth 8 -quality 95 -resize 120 - images/tmp/transform_ea069aa2269a.jpg

# ls -lrt images/tmp/transform_ea069aa2269a.jpg

-rw-r--r-- 1 root root 3370 Feb 18 09:11 images/tmp/transform_ea069aa2269a.jpg



Ciencia Al Poder (talkcontribs)
S0ring (talkcontribs)

Indeed it worked! Thank you!