Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [paperless.parsing] Thumbnail generation with ImageMagick failed #895

Closed
MrThiemann opened this issue May 7, 2022 · 12 comments
Closed
Labels
bug Bug report or a Bug-fix stale unconfirmed

Comments

@MrThiemann
Copy link

Description

when my files consumed, i became the error:
[2022-05-07 17:01:07,376] [WARNING] [paperless.parsing] Thumbnail generation with ImageMagick failed, falling back to ghostscript. Check your /etc/ImageMagick-x/policy.xml!

but not with every document, but felt like every third one... (always different)
Bildschirmfoto 2022-05-07 um 19 01 42

Steps to reproduce

Scan document an uploaded this in /var/www/uploads
then i used a script that checked if a new file in "www" and then moved it to /opt/paperless/consume

Webserver logs

[WARNING] [paperless.parsing] Thumbnail generation with ImageMagick failed, falling back to ghostscript. Check your /etc/ImageMagick-x/policy.xml!

Paperless-ngx version

1.7.0

Host OS

Proxmox LXC Debian 11

Installation method

Bare metal

Browser

No response

Configuration changes

No response

Other

No response

@MrThiemann MrThiemann added bug Bug report or a Bug-fix unconfirmed labels May 7, 2022
@qcasey
Copy link
Member

qcasey commented May 10, 2022

Thank you for reporting. Are you able to share any of these failing documents with us?

@stale
Copy link

stale bot commented Jun 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 10, 2022
@stale stale bot closed this as completed Jun 17, 2022
@x4FF3
Copy link

x4FF3 commented Oct 26, 2022

hi, installed my instance today. and also stumbled upon this.

@StanDaMan0505
Copy link

StanDaMan0505 commented Nov 24, 2022

I also stumbled upon this warning in 1.9.2

Additionally, I found these messages in the log:
convert-im6.q16: cache resources exhausted /tmp/magick-YDw87kvL7kw7NvDUD81N2llf-TC2pS3y1' @ error/cache.c/OpenPixelCache/4095. convert-im6.q16: no images defined /tmp/paperless/paperless-0usybfvg/convert.webp' @ error/convert.c/ConvertImageCommand/3229.
[2022-11-24 07:47:06,692] [WARNING] [paperless.parsing] Thumbnail generation with ImageMagick failed, falling back to ghostscript. Check your /etc/ImageMagick-x/policy.xml!

@nsar1907
Copy link

I also stumbled upon this warning in 1.9.2

[2022-11-28 04:36:32,768] [WARNING] [paperless.parsing] Thumbnail generation with ImageMagick failed, falling back to ghostscript. Check your /etc/ImageMagick-x/policy.xml!

@halfbyte
Copy link

I've looked at the file that gets mentioned and I think this might be a hint:

<!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />

This is from a yunohost paperless-ngx installation. I am no expert in ImageMagick config, but that sounds to me as if it would prevent convert from reading these file types?

@lordyod
Copy link

lordyod commented Feb 21, 2023

Hi, this should probably not be closed. Just did a fresh baremetal install, consumed ~1200 docs, every single one gives this error.

Additionally, when I try to use the admin document_thumbnails tool I get the following:

root@paperless:/opt/paperless/src# sudo -u paperless ../venv/bin/python3 manage.py document_thumbnails
  0%|                                                                                                                                                                                       | 0/1169 [00:00<?, ?it/s]convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/741.
convert: no images defined `/tmp/paperless/paperless-gkkqedz2/convert.webp' @ error/convert.c/ConvertImageCommand/3342.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/741.
convert: no images defined `/tmp/paperless/paperless-1cd9zbji/convert.webp' @ error/convert.c/ConvertImageCommand/3342.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/741.
convert: no images defined `/tmp/paperless/paperless-rctsafwu/convert.webp' @ error/convert.c/ConvertImageCommand/3342.
convert: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/741.
convert: no images defined `/tmp/paperless/paperless-1cd9zbji/convert_gs.webp' @ error/convert.c/ConvertImageCommand/3342.
convert: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/741.
convert: no images defined `/tmp/paperless/paperless-gkkqedz2/convert_gs.webp' @ error/convert.c/ConvertImageCommand/3342.

@HolgerM1
Copy link

HolgerM1 commented Mar 2, 2023

Same her on paperless-ngx 1.13:
[WARNING] [paperless.parsing] Thumbnail generation with ImageMagick failed, falling back to ghostscript. Check your /etc/ImageMagick-x/policy.xml!
This was happening on importing a bunch of PDFs I exported from my former DMS.
Is anybody having an idea if this impacts the functionality?

@MortRainey
Copy link

MortRainey commented Mar 16, 2023

https://docs.paperless-ngx.com/setup/

Point 13 did it for me:

Configure ImageMagick to allow processing of PDF documents. Most distributions have this disabled by default, since PDF documents can contain malware. If you don't do this, paperless will fall back to ghostscript for certain steps such as thumbnail generation.

Edit /etc/ImageMagick-6/policy.xml and adjust
policy domain="coder" rights="none" pattern="PDF"
to
policy domain="coder" rights="read|write" pattern="PDF"

on bare matel Installation.

@HolgerM1
Copy link

HolgerM1 commented Mar 17, 2023

Unfortunateley II do not have an folder "/etc/ImageMagik-6"?!

@ndom91
Copy link

ndom91 commented Apr 6, 2023

Just ran into this too on a fresh bare-metal install of 1.14.0-beta.rc1 on a fresh Ubuntu 22.04.

Looks like you might have to just remove this line from the aforementioned /etc/ImageMagik-6/policy.xml to allow it to run on PDFs

<policy domain="coder" rights="none" pattern="PDF" />

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug report or a Bug-fix stale unconfirmed
Projects
Archived in project
Development

No branches or pull requests

10 participants