T
Twenty6mo ago
VOLVES

npx nx database:reset twenty-serverNOUVEAU

Hello, 'I'm trying to setup the project using the one link for docker, every thing is working well until i couldn't connect with [email protected]. putting error of
ERROR [ExceptionsHandler] relation "core.user" does not exist
ERROR [ExceptionsHandler] relation "core.user" does not exist
How could i solve this please ? thanks
6 Replies
charles
charles6mo ago
It seems that your database is not properly initialized. Are you looking to contribute or to self-host?
VOLVES
VOLVESOP6mo ago
Hello @charles , thanks for your response, I'm deploying the project on a Vps using docker
Zeylos
Zeylos6mo ago
tried to setup latest on a fresh vm tonight, I had some issues with the DB too, not sure how it's suppose to work on the default compose file ? ended up with something like this for the db container
db:
image: twentycrm/twenty-postgres:v0.22
volumes:
- /opt/twenty/db-data:/bitnami/postgresql
environment:
POSTGRESQL_USER: twenty
POSTGRESQL_DATABASE: default
POSTGRESQL_PASSWORD: pouet
POSTGRESQL_POSTGRES_PASSWORD: pouet
healthcheck:
test: pg_isready -U twenty -d default
interval: 5s
timeout: 5s
retries: 10
restart: always
db:
image: twentycrm/twenty-postgres:v0.22
volumes:
- /opt/twenty/db-data:/bitnami/postgresql
environment:
POSTGRESQL_USER: twenty
POSTGRESQL_DATABASE: default
POSTGRESQL_PASSWORD: pouet
POSTGRESQL_POSTGRES_PASSWORD: pouet
healthcheck:
test: pg_isready -U twenty -d default
interval: 5s
timeout: 5s
retries: 10
restart: always
and gave this postgresql_url to the server
PG_DATABASE_URL: postgres://postgres:pouet@db:5432/default
PG_DATABASE_URL: postgres://postgres:pouet@db:5432/default
the 'twenty' postgres user in my example is not used by the server (but it's used by the healthcheck lol) but if I don't give that, the bitnami postgres container screams at startup (empty password for default user). -- it looks like with the default compose + env : - the init.sql is not launched (no twenty user, no default db) - the database_url uses the 'twenty' postgres user with 'twenty' password by default when I tried to replicate this with POSTGRESQL_* vars and giving the default DATABASE_URL to the server, I had errors when creating the extensions (because twenty is not superuser and I think bitnami does not permit to do that with env vars) what we could do with the default compose is - use the postgres user by default - or if we don't want to use a postgres superuser for the app, use postgresql trusted extensionshttps://www.postgresql.org/docs/current/sql-createextension.html
if the extension is marked trusted in its control file, then it can be installed by any user who has CREATE privilege on the current database
by adding trusted = true in every extension control file we want to enable with the twenty user (there is a lot, it may require work) - or anything else but that's what came in my head tonight 🙂
charles
charles6mo ago
GitHub
twenty/packages/twenty-docker/docker-compose.yml at main · twentyhq...
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty
charles
charles6mo ago
The issues is that you are setting the default POSTGRESQL_USER to 'twenty'. You should leave it to its default 'postgres' upon first database boot the postgres user will create 'twenty' super user, it's part of the init script Here as POSTGRESQL_USER already is 'twenty', 'twenty' superuser cannot be created and the whole process is failing
Zeylos
Zeylos6mo ago
yea the init.sql wasn't played on my install need to test again later
Want results from more Discord servers?
Add your server