Error 400 when i try to upload a PDF file #9461
Replies: 3 comments 5 replies
-
As far as I understand your error log, the document processing pipeline of LibreChat is using langchain, which relies on the I'd try something like the local PDF24 tools to process that PDF. You could try to compress it a bit for instance and then try re-uploading that new version to LibreChat again. It's also possible that PDF24 will already tell you there's a problem with that PDF when you try to use tools on it. Maybe that'll help as well. |
Beta Was this translation helpful? Give feedback.
-
Seems you have something wrong with your vectordb, i think i can not contact it. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help. I tried another PDF file and received the following log message: LibreChat | 2025-09-08 08:21:41 error: Failed to load service key from file: /app/api/data/auth.json ENOENT: no such file or directory, open '/app/api/data/auth.json' I should point out that the upload and file search had worked before, but the feature hasn't been used for quite some time. I can upload images and they are processed correctly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When I try to upload a PDF file, I receive the error message: "Error Processing File."
The logs show the following:
rag_api | 2025-09-05 07:00:38,917 - pypdf._reader - WARNING - Object 4 0 not defined.
rag_api | 2025-09-05 07:00:38,918 - root - ERROR - Error during file processing: Invalid object in /Pages
rag_api | Traceback: Traceback (most recent call last):
rag_api | File "/app/app/routes/document_routes.py", line 486, in embed_file
rag_api | data, known_type, file_ext = await load_file_content(
rag_api | File "/app/app/routes/document_routes.py", line 96, in load_file_content
rag_api | data = await run_in_executor(executor, loader.load)
LibreChat | 2025-09-05 07:00:38 error: Error uploading vectors The server responded with status 400: Request failed with status code 400
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/runnables/config.py", line 622, in run_in_executor
LibreChat | 2025-09-05 07:00:38 error: [/files] Error processing file: Request failed with status code 400
rag_api | return await asyncio.get_running_loop().run_in_executor(executor_or_config, wrapper)
rag_api | File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
rag_api | result = self.fn(*self.args, **self.kwargs)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/runnables/config.py", line 608, in wrapper
rag_api | return func(*args, **kwargs)
rag_api | File "/app/app/utils/document_loader.py", line 243, in load
rag_api | return loader.load()
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/document_loaders/base.py", line 32, in load
rag_api | return list(self.lazy_load())
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_community/document_loaders/pdf.py", line 305, in lazy_load
rag_api | yield from self.parser.lazy_parse(blob)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_community/document_loaders/parsers/pdf.py", line 391, in lazy_parse
rag_api | "total_pages": len(pdf_reader.pages),
rag_api | File "/usr/local/lib/python3.10/site-packages/pypdf/_page.py", line 2164, in len
rag_api | return self.length_function()
rag_api | File "/usr/local/lib/python3.10/site-packages/pypdf/_doc_common.py", line 349, in get_num_pages
rag_api | self._flatten(self._readonly)
rag_api | File "/usr/local/lib/python3.10/site-packages/pypdf/_doc_common.py", line 1157, in _flatten
rag_api | raise PdfReadError("Invalid object in /Pages")
rag_api | pypdf.errors.PdfReadError: Invalid object in /Pages
rag_api |
rag_api | 2025-09-05 07:00:38,921 - root - INFO - Request POST http://rag_api:8000/embed - 400
Can anaybody help?
Thank you
Andreas
Beta Was this translation helpful? Give feedback.
All reactions