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

psycopg.DataError: PostgreSQL text fields cannot contain NUL (0x00) bytes #751

Open
1 task
M-JULIANI opened this issue Apr 24, 2024 · 5 comments
Open
1 task
Labels
bug Something isn't working contributions wanted! Looking for external contributions integration:pgvector

Comments

@M-JULIANI
Copy link

Describe the bug

Running a simple embedding/indexing pipeline based on the pgvector integration (example).

Having no problem when running markdown files, when running the pipeline through pdf files, I get the following error on some pdfs:

psycopg.DataError: PostgreSQL text fields cannot contain NUL (0x00) bytes.

I wonder whether you all have come across this before and whether this might be a common case to solve for in document_writer.

I added a patch to that file to replace null bytes before attempting to write to pg vector

Error message
psycopg.DataError: PostgreSQL text fields cannot contain NUL (0x00) bytes.

Expected behavior
Would expect the pipeline to write valid content to the db, and perhaps ignore null bytes.

Additional context
The PDF includes images, tables, etc. This is the type of PDF I will likely be ingesting, as opposed to a super clean and simple one. The PDF is 28MB.

To Reproduce

  1. Run the following (example) with a large PDF.

FAQ Check

System:

  • OS: macOS Monterey
  • GPU/CPU: Apple M1 Pro
  • Haystack version (commit or version number): 2.0.1
  • DocumentStore: pg-vector
  • Reader: none, only working on indexing pipeline
  • Retriever:none, only working on indexing pipeline
@alez007
Copy link

alez007 commented Apr 28, 2024

just chipping in, I get the same error using the all-minilm ollama embedder and 384 dimensions. the pdf is an invoice so contains a simple table and text

@CarlosFerLo
Copy link

@alez007 Could you add more context, eg. code example or something.

@masci masci assigned masci and unassigned masci May 6, 2024
@masci masci self-assigned this May 21, 2024
@ddorian
Copy link

ddorian commented May 23, 2024

Insert this string into a text column to reproduce:

value = "\x1c\x00Þé`\U00104103Æ\U000eadac\U00018d30I"

@masci masci transferred this issue from deepset-ai/haystack May 23, 2024
@masci
Copy link
Contributor

masci commented May 23, 2024

I'm moving this issue to the core-integrations repository because I think we should address this problem in the integration and not at the Haystack level, at least initially.

@masci masci added bug Something isn't working contributions wanted! Looking for external contributions labels May 23, 2024
@masci masci removed their assignment Jun 10, 2024
@alez007
Copy link

alez007 commented Aug 6, 2024

@alez007 Could you add more context, eg. code example or something.

Hi, sorry for the late reply, I moved on since then and used elasticsearch and that worked fine. I don't have access to that code anymore so can't really help out.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contributions wanted! Looking for external contributions integration:pgvector
Projects
Development

Successfully merging a pull request may close this issue.

5 participants