I'm currently running the latest rag_api docker image, and have trouble with some of the PDF files.
This is the backtrace from the FastAPI backend
2025-07-21 12:42:02,569 - root - ERROR - Error during file processing: 'utf-8' codec can't encode character '\ud835' in position 416: surrogates not allowed
Traceback: Traceback (most recent call last):
File "/app/app/routes/document_routes.py", line 419, in embed_file
result = await store_data_in_vector_db(
File "/app/app/routes/document_routes.py", line 274, in store_data_in_vector_db
docs = [
File "/app/app/routes/document_routes.py", line 280, in <listcomp>
"digest": generate_digest(doc.page_content),
File "/app/app/routes/document_routes.py", line 252, in generate_digest
hash_obj = hashlib.md5(page_content.encode())
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud835' in position 416: surrogates not allowed
I'm currently running the latest rag_api docker image, and have trouble with some of the PDF files.
This is the backtrace from the FastAPI backend
So the PDFs might contain invalid utf-8 characters for hashing