Skip to content

URL encoding missing #1738

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

Open
Hansehart opened this issue May 13, 2025 · 2 comments
Open

URL encoding missing #1738

Hansehart opened this issue May 13, 2025 · 2 comments
Labels
integration:pgvector P2 type:documentation Improvements or additions to documentation

Comments

@Hansehart
Copy link

Describe the bug
I´ve found an issue using PGVector with Haystack. The problem happens in the file conninfo.py in conninfo_to_dict(), when parsing an string like 'postgresql://postgres:p=ssword@postgres:5432/db' in the psycopg repo.

Reading the Postgresql Documentation, you can see that special characters like '=' in the passwords needs to be encoded in '%3D'. When tested it with the encoding, it worked without any problem.

Currently you get the error: psycopg.OperationalError: [Errno -2] Name or service not known, because the password is in this example 'p' and the hostname is 'ssword@postgres'. I created an issue in psycopg

To Reproduce
It happens in this project in the file document_store.py in PgvectorDocumentStore in _ensure_db_setup. The line is: connection = Connection.connect(conn_str). To reproduce, set the var conn_str to 'postgresql://postgres:p=ssword@postgres:5432/db'

Describe your environment (please complete the following information):

  • Ubuntu 24.04
  • Haystack version: 2.13.2
  • Integration version: 3.3.0
@Hansehart Hansehart added the bug Something isn't working label May 13, 2025
@Hansehart
Copy link
Author

Hansehart commented May 13, 2025

The issue in psycopg has been closed. However would it be an option to encode default special chars? It was a very nasty bug for me and I would prevent the pain for any other in the future, who uses special characters in his password.

@anakin87
Copy link
Member

After an internal discussion, we agreed that there is not much we can do if the connection string is malformed.

TODO:

  • Check if the current error message is informative or it can be improved in this regard. (The outcome may also be to do nothing.)
  • Update docs/integration page to inform users about this point.

@anakin87 anakin87 removed the bug Something isn't working label May 15, 2025
@julian-risch julian-risch added P2 type:documentation Improvements or additions to documentation and removed P1 contributions wanted! Looking for external contributions labels May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration:pgvector P2 type:documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants