Closed tiborrr closed 4 months ago
This is what I get:
$ docker pull tiborr/docspell-addon-example
Using default tag: latest
Error response from daemon: pull access denied for tiborr/docspell-addon-example, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I assume I have to configure something perhaps?
How stupid. I already found the issue. Can you update the plugin and retry once?
I made a typo. It should be:
tiborrr/docspell-addon-example
I retried with your plugin version 0.8.0 and it's getting better :)
First try, it seems to work but the main.py
cannot be found:
>> [docspell-addon-example-0.8.0 (err)] Status: Downloaded newer image for tiborrr/docspell-addon-example:0.8.0 (addon-version: "0.8.0", task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", addon-name: "docspell-addon-example", jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
>> [docspell-addon-example-0.8.0 (err)] python: can't open file '/mnt/work/main.py': [Errno 2] No such file or directory (addon-version: "0.8.0", task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", addon-name: "docspell-addon-example", jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
>> [docspell-addon-example-0.8.0 (err)] (addon-version: "0.8.0", task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", addon-name: "docspell-addon-example", jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
Closing process: `docker run --rm --name docspell-addon-example-0.8.0-cpBhP --mount type=bind,source=/tmp/docspell-addons/addon-1492956184831617862,target=/mnt/work --mount type=bind,source=/tmp/docspell-addons/addon-output-1673668666144778459,target=/mnt/output --mount type=bind,source=/tmp/docspell-addon-cache/J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX,target=/mnt/cache --network none --env ADDON_DIR=addons/docspell-addon-example-0.8.0 --env ITEM_DATA_JSON=item/item-data.json --env ITEM_DIR=item --env TMP_DIR=temp --env TMPDIR=temp --env CACHE_DIR=/mnt/cache --env ITEM_ARGS_JSON=item/given-data.json --env ITEM_ORIGINAL_JSON=item/source-files.json --env ITEM_PDF_JSON=item/pdf-files.json --env OUTPUT_DIR=/mnt/output --env ITEM_ORIGINAL_DIR=item/originals --env ITEM_PDF_DIR=item/pdfs -w /mnt/work tiborrr/docspell-addon-example:0.8.0 arguments/user-input` (addon-version: "0.8.0", task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", addon-name: "docspell-addon-example", jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
Addon docspell-addon-example-0.8.0 returned non-zero: 2 (addon-version: "0.8.0", task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", addon-name: "docspell-addon-example",jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
Addon result: AddonExecutionResult(List(ExecutionError(2)),true) (task: "process-item", addon-task-id: "J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX", jobInfo: "GghTru99N.../1/process-item/High", jobId: "GghTru99NH7-1QU2W7RB6dY-77cjRCrAiER-sg3CjtpePXf", group: "1")
I set the working dir to a directory prepared at the host (bound to /mnt/work
in the container). This is used to lookup the main.py
. Perhaps you could use an absolute path in the entrypoint?
If I remove that option, it works fine:
Running external command: docker run --rm --name docspell-addon-example-0.8.0-3JGAia --mount type=bind,source=/tmp/docspell-addons/addon-11732978759257757192,target=/mnt/work --mount type=bind,source=/tmp/docspell-addons/addon-output-11868189249312441700,target=/mnt/output --mount type=bind,source=/tmp/docspell-addon-cache/J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX,target=/mnt/cache --network none --env ADDON_DIR=addons/docspell-addon-example-0.8.0 --env ITEM_DATA_JSON=item/item-data.json --env ITEM_DIR=item --env TMP_DIR=temp --env TMPDIR=temp --env CACHE_DIR=/mnt/cache --env ITEM_ARGS_JSON=item/given-data.json --env ITEM_ORIGINAL_JSON=item/source-files.json --env ITEM_PDF_JSON=item/pdf-files.json --env OUTPUT_DIR=/mnt/output --env ITEM_ORIGINAL_DIR=item/originals --env ITEM_PDF_DIR=item/pdfs tiborrr/docspell-addon-example:0.8.0 arguments/user-input
Waiting for command to terminate…
>> [docspell-addon-example-0.8.0 (out)] Hello arguments/user-input
>> [docspell-addon-example-0.8.0 (out)]
Closing process: `docker run --rm --name docspell-addon-example-0.8.0-3JGAia --mount type=bind,source=/tmp/docspell-addons/addon-11732978759257757192,target=/mnt/work --mount type=bind,source=/tmp/docspell-addons/addon-output-11868189249312441700,target=/mnt/output --mount type=bind,source=/tmp/docspell-addon-cache/J5QnTyfi7o6-vDWGyp32pVz-s9Te5iVxcCC-94cVVoem1mX,target=/mnt/cache --network none --env ADDON_DIR=addons/docspell-addon-example-0.8.0 --env ITEM_DATA_JSON=item/item-data.json --env ITEM_DIR=item --env TMP_DIR=temp --env TMPDIR=temp --env CACHE_DIR=/mnt/cache --env ITEM_ARGS_JSON=item/given-data.json --env ITEM_ORIGINAL_JSON=item/source-files.json --env ITEM_PDF_JSON=item/pdf-files.json --env OUTPUT_DIR=/mnt/output --env ITEM_ORIGINAL_DIR=item/originals --env ITEM_PDF_DIR=item/pdfs tiborrr/docspell-addon-example:0.8.0 arguments/user-input`
Addon docspell-addon-example-0.8.0 executed successfully!
I updated it. Now the example should work.
Once it works it would be great to add this somewhere for other people to use.
If you do the update and run it again, then it should work.
I tested it again successfully! Thank you for testing this!
Where do you like to add this example? If you want you can add it somewhere in the docs, and/or also use a topic on github docspell-addon
(makes it easier to discover, like this)?
Edit: Perhaps it could be added to this page: https://docspell.org/docs/addons/writing/#examples
Both would be best. Then what you have on your website reflects what is in the docspell repo. How do we achieve that result? Do you fork my example repo? Or can you make some kind of link?
If you decide to fork it, then make sure to adjust the .github files. Because they currently point to my docker repo.
I have updated my repo so its easier to port. I have made the things that require configuration a Github secret in the github release file.
I don't think it needs to be forked - or do you intend to remove it from your account soon? I would simply point to it in the docs.
Pointing to it in the docs would be fine. I do not intend to remove it.
Found the issue. This was caused by a missing volume in the docker compose.
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp # this line was misssing
I am now getting this error:
I also think it's weird you are getting this
pull access denied for tiborr/docspell-addon-example
because this is a public repo.link to docker hub
Can you check what happens if you do
docker pull tiborr/docspell-addon-example
in your joex instanceOriginally posted by @tiborrr in https://github.com/eikek/docspell/issues/2650#issuecomment-2139689454