@girish I confirm after update id works
Valexico
Posts
-
Error when trying to connect a Postgresql database : could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied -
Error when trying to connect a Postgresql database : could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied@joseph Sorry it was a bit rough but in short
- Install Superset
- Connect to a PostgreSQL database with SSL :
Workaround :
Use SQLalchemy URII think the issue is that there is no
/root/.postgresql/postgresql.crt
inside the container app -
Error when trying to connect a Postgresql database : could not open certificate file "/root/.postgresql/postgresql.crt": Permission deniedThis error occurs with default engine (psycopg2)
(psycopg2.OperationalError) connection to server at "**********" (151.80.10.***), port 5432 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied (Background on this error at: https://sqlalche.me/e/14/e3q8)
I think it is a cloudron app issue
You can workaround using sqlalchemy.
-
First try app packaging : librechat - issue with postgresql extention (pgvector)Wow thanks @nebulon . I think it would have been necessary one day or another with the current AI hype.
By the way I'd be glad to share my "cloudron packaging prompt engineering" techniques some when. I'll make a second try with another app, I am thinking appsmith
-
First try app packaging : librechat - issue with postgresql extention (pgvector)Hmm I tried a sed and could create a
vectors
extension instead ofvector
But then it cascaded to more errors. And with the different abstraction layers (langchain, sqlalchemy...) I couln't solve the issue.
I think current implementation tries to ceate a table with a VECTOR type anv vecto.rs expects VECTOR(dimension) (or is maybe not loaded properly)
The above exception was the direct cause of the following exception: Nov 27 16:17:11 2024-11-27T15:17:11Z Nov 27 16:17:11 Traceback (most recent call last): Nov 27 16:17:11 File "/app/code/rag_api/main.py", line 46, in <module> Nov 27 16:17:11 from psql import PSQLDatabase, ensure_custom_id_index_on_embedding, pg_health_check Nov 27 16:17:11 File "/app/code/rag_api/psql.py", line 3, in <module> Nov 27 16:17:11 from config import DSN, logger Nov 27 16:17:11 File "/app/code/rag_api/config.py", line 232, in <module> Nov 27 16:17:11 vector_store = get_vector_store( Nov 27 16:17:11 File "/app/code/rag_api/store_factory.py", line 20, in get_vector_store Nov 27 16:17:11 return AsyncPgVector( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py", line 183, in warn_if_direct_instance Nov 27 16:17:11 return wrapped(self, *args, **kwargs) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 341, in __init__ Nov 27 16:17:11 self.__post_init__() Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 355, in __post_init__ Nov 27 16:17:11 self.create_tables_if_not_exists() Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 390, in create_tables_if_not_exists Nov 27 16:17:11 Base.metadata.create_all(session.get_bind()) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/schema.py", line 5825, in create_all Nov 27 16:17:11 bind._run_ddl_visitor( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3254, in _run_ddl_visitor Nov 27 16:17:11 conn._run_ddl_visitor(visitorcallable, element, **kwargs) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2460, in _run_ddl_visitor Nov 27 16:17:11 visitorcallable(self.dialect, self, **kwargs).traverse_single(element) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/visitors.py", line 664, in traverse_single Nov 27 16:17:11 return meth(obj, **kw) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 918, in visit_metadata Nov 27 16:17:11 self.traverse_single( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/visitors.py", line 664, in traverse_single Nov 27 16:17:11 return meth(obj, **kw) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 956, in visit_table Nov 27 16:17:11 )._invoke_with(self.connection) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 314, in _invoke_with Nov 27 16:17:11 return bind.execute(self) Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1421, in execute Nov 27 16:17:11 return meth( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 180, in _execute_on_connection Nov 27 16:17:11 return connection._execute_ddl( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1532, in _execute_ddl Nov 27 16:17:11 ret = self._execute_context( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1849, in _execute_context Nov 27 16:17:11 return self._exec_single_context( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1989, in _exec_single_context Nov 27 16:17:11 self._handle_dbapi_exception( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2356, in _handle_dbapi_exception Nov 27 16:17:11 raise sqlalchemy_exception.with_traceback(exc_info[2]) from e Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1970, in _exec_single_context Nov 27 16:17:11 self.dialect.do_execute( Nov 27 16:17:11 File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 924, in do_execute Nov 27 16:17:11 cursor.execute(statement, parameters) Nov 27 16:17:11 sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) type "vector" does not exist Nov 27 16:17:11 LINE 4: embedding VECTOR, Nov 27 16:17:11 ^ Nov 27 16:17:11 2024-11-27T15:17:11Z Nov 27 16:17:11 [SQL: Nov 27 16:17:11 CREATE TABLE langchain_pg_embedding ( Nov 27 16:17:11 collection_id UUID, Nov 27 16:17:11 embedding VECTOR, Nov 27 16:17:11 document VARCHAR, Nov 27 16:17:11 cmetadata JSON, Nov 27 16:17:11 custom_id VARCHAR, Nov 27 16:17:11 uuid UUID NOT NULL, Nov 27 16:17:11 PRIMARY KEY (uuid), Nov 27 16:17:11 FOREIGN KEY(collection_id) REFERENCES langchain_pg_collection (uuid) ON DELETE CASCADE Nov 27 16:17:11 )
-
First try app packaging : librechat - issue with postgresql extention (pgvector)Thanks for the response @nebulon
I could fix my
start.sh
however, the vector extension is then expected by the app code[SQL: BEGIN;SELECT pg_advisory_xact_lock(1573678846307946496);CREATE EXTENSION IF NOT EXISTS vector;COMMIT;] Nov 27 11:31:05 (Background on this error at: https://sqlalche.me/e/20/e3q8) Nov 27 11:31:05 2024-11-27T10:31:05Z Nov 27 11:31:05 The above exception was the direct cause of the following exception: Nov 27 11:31:05 2024-11-27T10:31:05Z Nov 27 11:31:05 Traceback (most recent call last): Nov 27 11:31:05 File "/app/code/rag_api/main.py", line 46, in <module> Nov 27 11:31:05 from psql import PSQLDatabase, ensure_custom_id_index_on_embedding, pg_health_check Nov 27 11:31:05 File "/app/code/rag_api/psql.py", line 3, in <module> Nov 27 11:31:05 from config import DSN, logger Nov 27 11:31:05 File "/app/code/rag_api/config.py", line 232, in <module> Nov 27 11:31:05 vector_store = get_vector_store( Nov 27 11:31:05 File "/app/code/rag_api/store_factory.py", line 20, in get_vector_store Nov 27 11:31:05 return AsyncPgVector( Nov 27 11:31:05 File "/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py", line 183, in warn_if_direct_instance Nov 27 11:31:05 return wrapped(self, *args, **kwargs) Nov 27 11:31:05 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 341, in __init__ Nov 27 11:31:05 self.__post_init__() Nov 27 11:31:05 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 348, in __post_init__ Nov 27 11:31:05 self.create_vector_extension() Nov 27 11:31:05 File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/pgvector.py", line 386, in create_vector_extension Nov 27 11:31:05 raise Exception(f"Failed to create vector extension: {e}") from e Nov 27 11:31:05 Exception: Failed to create vector extension: (psycopg2.errors.UndefinedFile) could not open extension control file "/usr/share/postgresql/14/extension/vector.control": No such file or directory
And this seems to come directly from Langchain code. I didn't know this interesting verto.rs alternative, however the normal "pgvector" seems more broadly used. Could we have both alternative on Cloudron ? Or maybe a symlink if pgvecto.rs is compatible with classic pgvector ?
-
First try app packaging : librechat - issue with postgresql extention (pgvector)I need help : to install pgvector for postgresql 14 I need to add postgres APT repos, which I don't really want (I try not to mess up my Cloudron server with installing external dependancies).
Is it possible to provide a potgresql-16 DB with cloudron addon (postgresql-16 seem available on the server)
-
First try app packaging : librechat - issue with postgresql extention (pgvector)I have a partial answer : the host has pgvector for postgresql version 16
$ apt list | grep pgvector postgresql-16-pgvector/noble 0.6.0-1 amd64
However cloudron postgresql addon provide version 14. Am I missing something ?
-
First try app packaging : librechat - issue with postgresql extention (pgvector)Response to myself : i just realized that I should install the extension in the host machine and not in the container
I'll try later
Still wondering what the documentation means by "whitelisted" -
First try app packaging : librechat - issue with postgresql extention (pgvector)Hi
I wanted to learn cloudron app packaging, and I am actually working on an AI assistant to generate Clourdon packages bases on source repository. Ibuilt a bunch of nested prompts (with Zed editor which is really cool for this) and had encouraging result so far.
I could generate a working package for Librechat which is requested here.
Sources are here : https://gitlab.com/vlebert/librechat-cloudron
The app can start in Cloudron but I have 2 issues
- SSO with OIDC don't work. It is documented here but I can't make it work.
- There is a sub-app called RAG-API used to interact with uploaded document and which require pgvector extention. How to use this extension in a cloudron package ?
Documentation says vector extension is "whitelisted" : https://docs.cloudron.io/packaging/addons/#postgresql
But I can't create this extention in postgres :
Should it be installed with apt in the Dockerfile ? I made a few attempts but no success...
Any help would be greatly appreciated
-
adding apt dependencies to n8n app (or any other app)Hi @joseph
pandoc is also part of Cloudron n8n package
You're right I didn't realize this. It is a good surprise.
I have other workflow requiring GDAL binaries for example (https://gdal.org/en/latest/). This one is mode specific and is not here. I guess I am good to make a custom packaging...
I found some shady npm packages including binaries but it does not seem properly maintained.
-
adding apt dependencies to n8n app (or any other app)Hi
I need to be able to add apt dependencies to my n8n app. I know that npm packages can be added through an environment variable, but is it possible to add external apt packages to be used with n8n (with bash command n8n node)?
I have another n8n custom install on a dedicated VPS and I cannot migrate my workflows because of this issue.
On this other custom install, I do 2 things I cannot replicate on cloudron :
- Run bash command using external binaries
- Run bash command using external docker images (for example pandoc which is a pain to install without docker)
One workaround I imagine would be to ssh my host server (the cloudron host machine) and use my commands here. But ideally I would like not to pollute my host which only runs Cloudron.
Is it possible somehow to manage this dependancies ?
-
App stuck in error when editing location (domain) while app is shut downYes, it was not on purpose. Nonetheless current behaviour is dangerous if you don't know the technique to restart your stucked app
-
App stuck in error when editing location (domain) while app is shut downThanks for the details
-
App stuck in error when editing location (domain) while app is shut downHi
I had an issue last week with an application (Baserow) :
- The app was stopped
- I tried to add a domain alias in "location" setting
After that the app was stuck in Error state, with error
Error : Inactive - Error getting IP of redis-184ad096-6567-4511-b1a6-b40814b54793 service
.I tried everything but couldn't restart the app. I had to install a new baserow instance and restore from a backup, delete the old one and change the domain again while the app was running.
Today I did a new test to confirm the bug, even with a simple app (LAMP server). And I could reproduce 100% :
- Install LAMP
- Stop App
- Add a domain alias
- -> App stuck in Error mode
Error : Inactive - Error getting IP of redis-184ad096-6567-4511-b1a6-b40814b54793 service
Is there a technique to reboot such stopped App ? I could be very dangerous in production ?
And maybe this issue could be adressed ?
Cheers