sjafferali / paperless-titles-from-ai

A paperless-ngx postconsume script that automatically generates meaningful titles of ingested documents using openai or other llm providers such as ollama.
MIT License
26 stars 1 forks source link

Script fails: returned non-zero exit status 1 #15

Open maxbec opened 2 days ago

maxbec commented 2 days ago

Hey,

i get this error on post-consume (The *** are only for more privacy):

Command '['/usr/src/paperless/scripts/app/main.py', '140', '***_NTF_1.1.4.pdf', '/usr/src/paperless/media/documents/originals/***/***/***/***_Posteingang_03.pdf', '/usr/src/paperless/media/documents/thumbnails/0000140.webp', '/api/documents/140/download/', '/api/documents/140/thumb/', '***', 'Posteingang']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/usr/local/lib/python3.12/site-packages/celery/app/trace.py", line 453, in trace_task

    R = retval = fun(*args, **kwargs)

                 ^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/celery/app/trace.py", line 736, in __protected_call__

    return self.run(*args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 327, in main_wrap

    raise exc_info[1]

  File "/usr/src/paperless/src/documents/tasks.py", line 148, in consume_file

    msg = plugin.run()

          ^^^^^^^^^^^^

  File "/usr/src/paperless/src/documents/consumer.py", line 632, in run

    self.run_post_consume_script(document)

  File "/usr/src/paperless/src/documents/consumer.py", line 344, in run_post_consume_script

    self._fail(

  File "/usr/src/paperless/src/documents/consumer.py", line 151, in _fail

    raise ConsumerError(f"{self.filename}: {log_message or message}") from exception
Any ideas what i am doing wrong here?
sjafferali commented 2 days ago

It seems like the post consume script errored out, although, the cause isn't evident from the log snippet you provided. Could you provide the full logs from that post consume task? I would expect the lines before the above traceback to be more useful. Feel free to redact anything you need.

Alternatively, you can also try running the below command that failed manually from inside the docker container.

/usr/src/paperless/scripts/app/main.py 140 ***_NTF_1.1.4.pdf /usr/src/paperless/media/documents/originals/***/***/***/***_Posteingang_03.pdf /usr/src/paperless/media/documents/thumbnails/0000140.webp /api/documents/140/download/ /api/documents/140/thumb/ *** Posteingang