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

🐛 Error in worker causing IndexError #790

Open
2 tasks done
G4st3r21 opened this issue Nov 29, 2023 · 0 comments
Open
2 tasks done

🐛 Error in worker causing IndexError #790

G4st3r21 opened this issue Nov 29, 2023 · 0 comments

Comments

@G4st3r21
Copy link

📜 Description

I encountered an issue while using the upload endpoint of the DocsGPT API. After successfully uploading a file and receiving the response with the status "ok" and a task ID, I observed an error in the worker logs. The error message states the following:

[2023-11-29 15:31:49,384: WARNING/ForkPoolWorker-1] inputs/5203382281/file_84.pdf
[2023-11-29 15:31:49,424: WARNING/ForkPoolWorker-1] <Response [200]>
[2023-11-29 15:31:49,431: WARNING/ForkPoolWorker-1] Grouping small documents
[2023-11-29 15:31:49,432: WARNING/ForkPoolWorker-1] Separating large documents
[2023-11-29 15:31:49,436: ERROR/ForkPoolWorker-1] Task application.api.user.tasks.ingest[eade116a-470f-4e9f-a69f-4c5f084151f6] raised unexpected: IndexError('list index out of range')
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in protected_call
return self.run(*args, **kwargs)
File "/app/application/api/user/tasks.py", line 6, in ingest
resp = ingest_worker(self, directory, formats, name_job, filename, user)
File "/app/application/worker.py", line 94, in ingest_worker
call_openai_api(docs, full_path, self)
File "/app/application/parser/open_ai_func.py", line 38, in call_openai_api
docs_init = [docs[0]]
IndexError: list index out of range

It seems that the error occurred when the worker was trying to process the file file_84.pdf. The IndexError indicates that the list index was out of range in the call_openai_api function.

Could you please investigate this issue and provide a solution? Let me know if you need any additional information. Thank you!

👟 Reproduction steps

  1. Send a file using the upload endpoint.
  2. Receive an "ok" response with a task_id.

👍 Expected behavior

I expected the file to be processed without any errors and to receive a successful response.

👎 Actual Behavior with Screenshots

The worker encountered an IndexError: list index out of range while processing the file.

💻 Operating system

Linux

What browsers are you seeing the problem on?

No response

🤖 What development environment are you experiencing this bug on?

Docker

🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

No response

📃 Provide any additional context for the Bug.

No response

📖 Relevant log output

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🔗 Are you willing to submit PR?

None

🧑‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct
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

1 participant