twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
Other
23.62k stars 2.43k forks source link

Adding new database extension fails when restarting existing database #8694

Open BOHEUS opened 4 days ago

BOHEUS commented 4 days ago

When running npx nx database:reset twenty-server, there are errors in logs about failed creation of extensions

> ts-node ./scripts/setup-db.ts

query failed: CREATE EXTENSION IF NOT EXISTS "vector"
error: error: extension "vector" is not available
Failed to perform 'create extension "vector (pgvector)"': QueryFailedError: extension "vector" is not available
Performed 'create schema "public"' successfully
Performed 'create schema "metadata"' successfully
Performed 'create schema "core"' successfully
Performed 'create extension "uuid-ossp"' successfully
Performed 'create extension "postgres_fdw"' successfully
Performed 'create extension "wrappers"' successfully
Performed 'create extension "mysql_fdw"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "airtable_fdw"
          HANDLER "airtable_fdw_handler"
          VALIDATOR "airtable_fdw_validator";

error: error: foreign-data wrapper "airtable_fdw" already exists
Performed 'create airtable "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "bigquery_fdw"
          HANDLER "big_query_fdw_handler"
          VALIDATOR "big_query_fdw_validator";

error: error: foreign-data wrapper "bigquery_fdw" already exists
Performed 'create bigQuery "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "clickhouse_fdw"
          HANDLER "click_house_fdw_handler"
          VALIDATOR "click_house_fdw_validator";

error: error: foreign-data wrapper "clickhouse_fdw" already exists
Performed 'create clickHouse "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "firebase_fdw"
          HANDLER "firebase_fdw_handler"
          VALIDATOR "firebase_fdw_validator";

error: error: foreign-data wrapper "firebase_fdw" already exists
Performed 'create firebase "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "logflare_fdw"
          HANDLER "logflare_fdw_handler"
          VALIDATOR "logflare_fdw_validator";

error: error: foreign-data wrapper "logflare_fdw" already exists
Performed 'create logflare "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "s3_fdw"
          HANDLER "s3_fdw_handler"
          VALIDATOR "s3_fdw_validator";

error: error: foreign-data wrapper "s3_fdw" already exists
Performed 'create s3 "wrappers"' successfully
query failed:
          CREATE FOREIGN DATA WRAPPER "stripe_fdw"
          HANDLER "stripe_fdw_handler"
          VALIDATOR "stripe_fdw_validator";

error: error: foreign-data wrapper "stripe_fdw" already exists
Performed 'create stripe "wrappers"' successfully
subson commented 4 days ago

all these extensions do not come enabled by default in postgres installer. I am able to install vector by installing the app version from postgres site but rest of the extensions I am not sure from where to install.

BOHEUS commented 3 days ago

@subson this extensions are installed/created automatically when running npx nx database:reset twenty-server, I'm running database in Docker container

yassinehamouten commented 3 days ago

Hi ! have you found a solution?