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

Issue: Cannot run addon without Nix. #3

Open
tenpai-git opened this issue Jan 24, 2025 · 4 comments
Open

Issue: Cannot run addon without Nix. #3

tenpai-git opened this issue Jan 24, 2025 · 4 comments

Comments

@tenpai-git
Copy link

Fri, January 24th, 2025, 10:15: Running 1 addon tasks for trigger Set(ExistingItem)
Fri, January 24th, 2025, 10:15: Preparing item data 'IMG_20250124_190042_612.jpg' for addon
Fri, January 24th, 2025, 10:15: Writing collected item data…
Fri, January 24th, 2025, 10:15: Storing all attachments…
Fri, January 24th, 2025, 10:15: Storing attachment /tmp/docspell-addons/addon-4862853053256892935/item/pdfs/9J7eAqcmcvb-apJPGeaTwh2-h4BqDwpK1wH-E8RxW3ZcTrd
Fri, January 24th, 2025, 10:15: Storing attachment /tmp/docspell-addons/addon-4862853053256892935/item/originals/9J7eAqcmcvb-apJPGeaTwh2-h4BqDwpK1wH-E8RxW3ZcTrd
Fri, January 24th, 2025, 10:15: Storing file metadata
Fri, January 24th, 2025, 10:15: About to run 1 addon(s) in /tmp/docspell-addons/addon-4862853053256892935
Fri, January 24th, 2025, 10:15: Extract 1 addons to /tmp/docspell-addons/addon-4862853053256892935/addons
Fri, January 24th, 2025, 10:15: Extracting AddonArchive(docspell-file:///1/addon/7omFKdA7cSanPHS3fJr17biQAHrc72T2xrxZwdzFXhDw,rotate-pdf-addon,0.2.0-pre)
Fri, January 24th, 2025, 10:15: Executing addon rotate-pdf-addon-0.2.0-pre
Fri, January 24th, 2025, 10:15: Storing user input into file
Fri, January 24th, 2025, 10:15: Attempt to run addon rotate-pdf-addon-0.2.0-pre with runner List(NixFlake)
Fri, January 24th, 2025, 10:15: Prepare addon rotate-pdf-addon-0.2.0-pre for executing via nix
Fri, January 24th, 2025, 10:15: Building with nix build
Fri, January 24th, 2025, 10:15: Running external command: nix build
Fri, January 24th, 2025, 10:15: Job 7XDy6toDK.../1/addon-existing-item/High execution failed. Retrying later.: Cannot run program "nix" (in directory "/tmp/docspell-addons/addon-4862853053256892935/addons/rotate-pdf-addon-0.2.0-pre"): error=2, No such file or directory

Hi @eikek

I'm having trouble getting this addon to run without installing nix. The issue I'm having is that images uploaded to Docspell become converted to PDFs for Tesseract, and those pdfs are always being rotated incorrectly automatically.

So I tried installing the rotation addon to fix the rotated pdf and reprocess the metadata. However, even though I manually installed qpdf and xpdf, I am unable running into the above output where I can't run the addon without nix.

I used the useage guide, but can you help me get the plugin running on a basic Debian install?

@eikek
Copy link
Member

eikek commented Jan 24, 2025

You need to remove the nix-runner from the executors in jour joex config. You can see https://docspell.org/docs/configure/defaults/#joex - search for executor-config. In there is a runner setting. you need to name the ones your joex machine supports

@tenpai-git
Copy link
Author

tenpai-git commented Jan 25, 2025

Okay, thank you for that @eikek

So I wasn't able to get the trivial runner running (never actually heard of this project or runner and couldn't find information about it), so I installed docker, their repos, and set it up for the docspell user.

I still had another permissions error in the job queue but was able to resolve it with the answer in this thread for anyone looking for help on this in the future:
https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue

So I did get it running correctly and I consider this issue "solved" - however it didn't help me because the root problem is really not being able to process the metadata on the file. Actually the converted PDF I think is more garbled because it appended the incorrect metadata after rotating it automatically to the file, too. It may not be saveable after rotation.

Consider this;

  1. I upload a straight image, say from a camera a JPG or PNG
  2. The auto convert automatically rotates it when converting to pdf by 90 degrees one way or another. so it can be tesseract'd.
  3. The meta data (both labels and extracted metadata), gets completely gets messed up because the orientation is wrong and it can't read anything and everything gets messed up.
  4. I rotate it with rotate-pdf-addon, but this does not reprocess any metadata.
  5. Reprocessing the file once again uses the original image and the problem repeats.

So I guess I could upload, rotate the image, save the converted pdf, delete the old entry, upload the new pdf,.. but at scale this is quite an issue.

So I guess my question is... Anyway to not make the converted pdf rotate in the first place ^^; - is there any setting in joex config where I can tell the proper component to not rotate the converted PDF or to try and "find" The correct orientation?

Or could we go about an addon to reprocess the metadata of the rotated file...?

What do you think?

Image

I guess this brings me back to Issue #1 - maybe merge issues?

@eikek
Copy link
Member

eikek commented Jan 25, 2025

hi, in theory, the rotate addon would reprocess the rotated file. not sure why this doesn't work.

@tenpai-git
Copy link
Author

tenpai-git commented Jan 26, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants