Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

Installation fails due to missing postgres vector extension #7

@victor-sm

Description

@victor-sm

Installation of the stack fails due to missing vector extension. Replacing the postgres:16-alpine image with pgvector/pgvector:pg16 solves the problem and allows the installation to continue without errors. After the initial installation a downgrade back to postgres:16-alpine doesn't seem to throw errors anymore. I haven't tested this deeper, so maybe I just haven't triggered a codepath which needs the extension during normal use. I assume the python installation script doesn't catch the exception.

This is my error log:

learnhouse-db | 2026-04-23 18:11:14.849 UTC [47] ERROR: extension "vector" is not available
learnhouse-db | 2026-04-23 18:11:14.849 UTC [47] DETAIL: Could not open extension control file "/usr/local/share/postgresql/extension/vector.control": No such file or directory.
learnhouse-db | 2026-04-23 18:11:14.849 UTC [47] HINT: The extension must first be installed on the system where PostgreSQL is running.
learnhouse-db | 2026-04-23 18:11:14.849 UTC [47] STATEMENT: CREATE EXTENSION IF NOT EXISTS vector
learnhouse-app | WARNING:root:pgvector extension not available — RAG features will be disabled. Install pgvector on your PostgreSQL server to enable course chatbot. Error: (psycopg2.errors.FeatureNotSupported) extension "vector" is not available
learnhouse-app | DETAIL: Could not open extension control file "/usr/local/share/postgresql/extension/vector.control": No such file or directory.
learnhouse-app | HINT: The extension must first be installed on the system where PostgreSQL is running.
learnhouse-app | [SQL: CREATE EXTENSION IF NOT EXISTS vector]
learnhouse-app | (Background on this error at: https://sqlalche.me/e/20/tw8g)
learnhouse-app | [collab] FATAL: COLLAB_INTERNAL_KEY is not set
learnhouse-app | App [learnhouse-collab:2] exited with code [1] via signal [SIGINT]
learnhouse-app | App [learnhouse-collab:2] starting in -fork mode-
learnhouse-app | App [learnhouse-collab:2] online
learnhouse-app | [collab] FATAL: COLLAB_INTERNAL_KEY is not set
learnhouse-app | App [learnhouse-collab:2] exited with code [1] via signal [SIGINT]
learnhouse-app | Script /usr/bin/node had too many unstable restarts (16). Stopped. "errored"
learnhouse-db | 2026-04-23 18:11:15.573 UTC [47] ERROR: type "vector" does not exist at character 367
learnhouse-db | 2026-04-23 18:11:15.573 UTC [47] STATEMENT:
learnhouse-db | CREATE TABLE course_embedding (
learnhouse-db | id SERIAL NOT NULL,
learnhouse-db | org_id INTEGER,
learnhouse-db | course_id INTEGER,
learnhouse-db | activity_id INTEGER,
learnhouse-db | activity_uuid VARCHAR NOT NULL,
learnhouse-db | block_uuid VARCHAR,
learnhouse-db | source_type VARCHAR NOT NULL,
learnhouse-db | chunk_text TEXT,
learnhouse-db | chunk_index INTEGER NOT NULL,
learnhouse-db | activity_name VARCHAR NOT NULL,
learnhouse-db | chapter_name VARCHAR NOT NULL,
learnhouse-db | course_name VARCHAR NOT NULL,
learnhouse-db | embedding VECTOR(768),
learnhouse-db | creation_date VARCHAR NOT NULL,
learnhouse-db | update_date VARCHAR NOT NULL,
learnhouse-db | PRIMARY KEY (id),
learnhouse-db | FOREIGN KEY(org_id) REFERENCES organization (id) ON DELETE CASCADE,
learnhouse-db | FOREIGN KEY(course_id) REFERENCES course (id) ON DELETE CASCADE,
learnhouse-db | FOREIGN KEY(activity_id) REFERENCES activity (id) ON DELETE CASCADE
learnhouse-db | )
learnhouse-db |
learnhouse-db |
learnhouse-app | Traceback (most recent call last):
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
learnhouse-app | self.dialect.do_execute(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | cursor, str_statement, effective_parameters, context
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
learnhouse-app | cursor.execute(statement, parameters)
learnhouse-app | ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | psycopg2.errors.UndefinedObject: type "vector" does not exist
learnhouse-app | LINE 15: embedding VECTOR(768),
learnhouse-app | ^
learnhouse-app | The above exception was the direct cause of the following exception:
learnhouse-app | Traceback (most recent call last):
learnhouse-app | File "/app/api/app.py", line 5, in
learnhouse-app | from src.core.events.events import shutdown_app, startup_app
learnhouse-app | File "/app/api/src/core/events/events.py", line 6, in
learnhouse-app | from src.core.events.autoinstall import auto_install
learnhouse-app | File "/app/api/src/core/events/autoinstall.py", line 5, in
learnhouse-app | from cli import install
learnhouse-app | File "/app/api/cli.py", line 9, in
learnhouse-app | from src.services.setup.setup import (
learnhouse-app | ...<3 lines>...
learnhouse-app | )
learnhouse-app | File "/app/api/src/services/setup/setup.py", line 16, in
learnhouse-app | from src.security.rbac.constants import ADMIN_ROLE_ID
learnhouse-app | File "/app/api/src/security/rbac/init.py", line 51, in
learnhouse-app | from src.security.rbac.resource_access import (
learnhouse-app | ...<2 lines>...
learnhouse-app | )
learnhouse-app | File "/app/api/src/security/rbac/resource_access.py", line 30, in
learnhouse-app | from src.security.rbac.rbac import (
learnhouse-app | ...<2 lines>...
learnhouse-app | )
learnhouse-app | File "/app/api/src/security/rbac/rbac.py", line 20, in
learnhouse-app | from src.security.superadmin import is_user_superadmin
learnhouse-app | File "/app/api/src/security/superadmin.py", line 4, in
learnhouse-app | from src.core.events.database import get_db_session
learnhouse-app | File "/app/api/src/core/events/database.py", line 98, in
learnhouse-app | SQLModel.metadata.create_all(engine)
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/schema.py", line 5928, in create_all
learnhouse-app | bind._run_ddl_visitor(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 3260, in _run_ddl_visitor
learnhouse-app | conn._run_ddl_visitor(visitorcallable, element, **kwargs)
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 2467, in _run_ddl_visitor
learnhouse-app | ).traverse_single(element)
learnhouse-app | ~~~~~~~~~~~~~~~^^^^^^^^^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/visitors.py", line 661, in traverse_single
learnhouse-app | return meth(obj, **kw)
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/ddl.py", line 984, in visit_metadata
learnhouse-app | self.traverse_single(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | table,
learnhouse-app | ^^^^^^
learnhouse-app | ...<2 lines>...
learnhouse-app | _is_metadata_operation=True,
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/visitors.py", line 661, in traverse_single
learnhouse-app | return meth(obj, **kw)
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/ddl.py", line 1022, in visit_table
learnhouse-app | )._invoke_with(self.connection)
learnhouse-app | ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/ddl.py", line 321, in _invoke_with
learnhouse-app | return bind.execute(self)
learnhouse-app | ~~~~~~~~~~~~^^^^^^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
learnhouse-app | return meth(
learnhouse-app | self,
learnhouse-app | distilled_parameters,
learnhouse-app | execution_options or NO_OPTIONS,
learnhouse-app | )
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/sql/ddl.py", line 187, in _execute_on_connection
learnhouse-app | return connection._execute_ddl(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | self, distilled_params, execution_options
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1530, in _execute_ddl
learnhouse-app | ret = self._execute_context(
learnhouse-app | dialect,
learnhouse-app | ...<4 lines>...
learnhouse-app | compiled,
learnhouse-app | )
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
learnhouse-app | return self._exec_single_context(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | dialect, context, statement, parameters
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
learnhouse-app | self._handle_dbapi_exception(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | e, str_statement, effective_parameters, cursor, context
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
learnhouse-app | raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
learnhouse-app | self.dialect.do_execute(
learnhouse-app | ~~~~~~~~~~~~~~~~~~~~~~~^
learnhouse-app | cursor, str_statement, effective_parameters, context
learnhouse-app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | )
learnhouse-app | ^
learnhouse-app | File "/app/api/.venv/lib/python3.14/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
learnhouse-app | cursor.execute(statement, parameters)
learnhouse-app | ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
learnhouse-app | sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) type "vector" does not exist
learnhouse-app | LINE 15: embedding VECTOR(768),
learnhouse-app | ^
learnhouse-app | [SQL:
learnhouse-app | CREATE TABLE course_embedding (
learnhouse-app | id SERIAL NOT NULL,
learnhouse-app | org_id INTEGER,
learnhouse-app | course_id INTEGER,
learnhouse-app | activity_id INTEGER,
learnhouse-app | activity_uuid VARCHAR NOT NULL,
learnhouse-app | block_uuid VARCHAR,
learnhouse-app | source_type VARCHAR NOT NULL,
learnhouse-app | chunk_text TEXT,
learnhouse-app | chunk_index INTEGER NOT NULL,
learnhouse-app | activity_name VARCHAR NOT NULL,
learnhouse-app | chapter_name VARCHAR NOT NULL,
learnhouse-app | course_name VARCHAR NOT NULL,
learnhouse-app | embedding VECTOR(768),
learnhouse-app | creation_date VARCHAR NOT NULL,
learnhouse-app | update_date VARCHAR NOT NULL,
learnhouse-app | PRIMARY KEY (id),
learnhouse-app | FOREIGN KEY(org_id) REFERENCES organization (id) ON DELETE CASCADE,
learnhouse-app | FOREIGN KEY(course_id) REFERENCES course (id) ON DELETE CASCADE,
learnhouse-app | FOREIGN KEY(activity_id) REFERENCES activity (id) ON DELETE CASCADE
learnhouse-app | )
learnhouse-app | ]
learnhouse-app | (Background on this error at: https://sqlalche.me/e/20/f405)
learnhouse-app | App [learnhouse-api:1] exited with code [1] via signal [SIGINT]
learnhouse-app | App [learnhouse-api:1] starting in -fork mode-
learnhouse-app | App [learnhouse-api:1] online

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions