rag_api icon indicating copy to clipboard operation
rag_api copied to clipboard

Azure Container App cannot start : 'AsyncPgVector' object has no attribute '_bind'

Open geodanchev opened this issue 1 year ago • 2 comments

what follows is the log from the container: `2024-07-18T06:10:51.977995561Z return wrapped(self, *args, **kwargs) 2024-07-18T06:10:51.978002664Z File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 316, in init 2024-07-18T06:10:51.978022051Z self._bind = connection if connection else self._create_engine() 2024-07-18T06:10:51.978050684Z File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 367, in _create_engine 2024-07-18T06:10:51.978056404Z return sqlalchemy.create_engine(url=self.connection_string, **self.engine_args) 2024-07-18T06:10:51.978062266Z File "", line 2, in create_engine 2024-07-18T06:10:51.978067806Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned 2024-07-18T06:10:51.978073216Z return fn(*args, **kwargs) # type: ignore[no-any-return] 2024-07-18T06:10:51.978078826Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 546, in create_engine 2024-07-18T06:10:51.978084336Z u = _url.make_url(url) 2024-07-18T06:10:51.978089787Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 842, in make_url 2024-07-18T06:10:51.978095087Z return _parse_url(name_or_url) 2024-07-18T06:10:51.978100397Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 905, in _parse_url 2024-07-18T06:10:51.978110385Z return URL.create(name, **components) # type: ignore 2024-07-18T06:10:51.978116607Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 211, in create 2024-07-18T06:10:51.978122307Z cls._assert_port(port), 2024-07-18T06:10:51.978130663Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 221, in _assert_port 2024-07-18T06:10:51.978136854Z return int(port) 2024-07-18T06:10:51.978142775Z ValueError: invalid literal for int() with base 10: ''

2024-07-18T06:10:52.188295543Z Exception ignored in: <function PGVector.del at 0x73fd3f873e20>

2024-07-18T06:10:52.188447576Z Traceback (most recent call last): 2024-07-18T06:10:52.188474917Z File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 359, in del 2024-07-18T06:10:52.188529549Z if isinstance(self._bind, sqlalchemy.engine.Connection): 2024-07-18T06:10:52.188536822Z AttributeError: 'AsyncPgVector' object has no attribute '_bind'`

I made a research and I think a PORT configuration is missing, but I don't know how to set that port. My environment variables are the same as my local installation which is working perfect. I've checked that a couple of times.

Any help ?

geodanchev avatar Jul 24 '24 06:07 geodanchev

I am also encountering the same error when deploying to Google Cloud Run

raymelon avatar Aug 07 '24 17:08 raymelon

I am also encountering the same error when deploying to Google Cloud Run

Update: Matching RAG_PORT to the Container Port solves the issue in my case

image

raymelon avatar Aug 07 '24 18:08 raymelon