Skip to content

[Question]: Issue with setting up OpenAI Embedding RAG for LibreChat running on Unraid #5089

@MikeNatC

Description

@MikeNatC

What is your question?

I am running my LibreChat docker container on Unraid. I am trying to enable RAG with OpenAI embeddings based on the instructions at this page, which are:

  1. Insert environment variable RAG_API_URL=http://host.docker.internal:8000

  2. Insert environment variable RAG_OPENAI_API_KEY=sk-your-openai-api-key-example
    (I inserted my OpenAI API key.)

  3. Change my repository to: ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest

4, Run the command to start up the Docker containers.

The problem is that the LibreChat instance will fail to start up. I've inserted the details of my error log below.

Thank you for your help!

More Details

Here is the error log:

text error warn system array login

self.dbapi_connection = connection = pool._invoke_creator(self)

File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 616, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 389, in create_vector_extension
session.execute(statement)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2306, in execute
return self._execute_internal(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2181, in _execute_internal
conn = self._connection_for_bind(bind)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2050, in _connection_for_bind
return trans._connection_for_bind(engine, execution_options)
File "", line 2, in _connection_for_bind
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
ret_value = fn(self, *arg, **kw)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1144, in _connection_for_bind
conn = bind.connect()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3279, in connect
return self._connection_cls(self)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 147, in init
Connection._handle_dbapi_exception_noconnection(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2443, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 145, in init
self._dbapi_connection = engine.raw_connection()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3303, in raw_connection
return self.pool.connect()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 449, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 179, in _do_get
with util.safe_reraise():
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 177, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 674, in init
self.__connect()
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
with util.safe_reraise():
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 616, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db" to address: Name or service not known

(Background on this error at: https://sqlalche.me/e/20/e3q8)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/main.py", line 49, in
from psql import PSQLDatabase, ensure_custom_id_index_on_embedding, pg_health_check
File "/app/psql.py", line 3, in
from config import DSN, logger
File "/app/config.py", line 264, in
vector_store = get_vector_store(
File "/app/store_factory.py", line 22, in get_vector_store
return AsyncPgVector(
File "/usr/local/lib/python3.10/site-packages/langchain_core/_api/deprecation.py", line 216, in warn_if_direct_instance
return wrapped(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 347, in init
self.post_init()
File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 354, in post_init
self.create_vector_extension()
File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 392, in create_vector_extension
raise Exception(f"Failed to create vector extension: {e}") from e
Exception: Failed to create vector extension: (psycopg2.OperationalError) could not translate host name "db" to address: Name or service not known

(Background on this error at: https://sqlalche.me/e/20/e3q8)

What is the main subject of your question?

Other

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓ questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions