T
Twentyβ€’4w ago
JΓ©rΓ©my

Try to setup Twenty on local

Hello, I tried following this documentation (https://twenty.com/developers/local-setup) to set up a local installation on my Mac. However, I encountered the following error when running npx nx start: [0] [Nest] 54095 - 22/11/2024 10:22:01 ERROR [ExceptionHandler] connect ECONNREFUSED ::1:6379 [0] Error: connect ECONNREFUSED ::1:6379 Do you have any solution for this? (I am a junior developer.) Thank you in advance! 😊
Twenty - Local Setup
Mostly for contributors or curious developers
18 Replies
Weiko
Weikoβ€’4w ago
Which step did you follow? It seems redis is missing
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
I unzipped Twenty. I already have PostgreSQL, so I simply created the database. I installed Redis using Brew (7.2.6). Then, I followed steps 5, 6, and 7 as explained.
Weiko
Weikoβ€’4w ago
Is redis running properly?
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
Redis wasn't properly started, that was my mistake. Now, when I run the command npx nx database:reset twenty-server, I get the following errors: NX Ran target typeorm for project twenty-server (1s) With additional flags: migration:run --d=src/database/typeorm/metadata/metadata.datasource βœ– 1/1 failed βœ” 0/1 succeeded [0 read from cache] Warning: command "nx typeorm -- migration:run -d src/database/typeorm/metadata/metadata.datasource" exited with non-zero status code NX Ran target database:migrate for project twenty-server and 2 task(s) they depend on (2s) βœ– 1/3 failed βœ” 2/3 succeeded [2 read from cache] Warning: command "nx database:migrate" exited with non-zero status code NX Ran target database:reset for project twenty-server and 2 task(s) they depend on (33s) βœ– 1/3 failed βœ” 2/3 succeeded [2 read from cache] πŸ˜… any idea @Weiko
thomast
thomastβ€’4w ago
@JΓ©rΓ©my can you run the commands separately and provide better error messages? Hard to understand what is failling there πŸ™‚
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
I didn't properly understand your request earlier, I think. The previous errors appear when I run npx nx database:reset twenty-server How can I run this commands separately?
thomast
thomastβ€’4w ago
Could for example try to run npx nx run twenty-server:typeorm -- migration:run -d src/database/typeorm/metadata/metadata.datasource.ts and share the error message
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
I have this error message Error during migration run: error: role "postgres" does not exist at Parser.parseErrorMessage (/Users/cap/Documents/www/twenty-main/node_modules/pg/node_modules/pg-protocol/src/parser.ts:369:69) at Parser.handlePacket (/Users/cap/Documents/www/twenty-main/node_modules/pg/node_modules/pg-protocol/src/parser.ts:188:21) at Parser.parse (/Users/cap/Documents/www/twenty-main/node_modules/pg/node_modules/pg-protocol/src/parser.ts:103:30) at Socket.<anonymous> (/Users/cap/Documents/www/twenty-main/node_modules/pg/node_modules/pg-protocol/src/index.ts:7:48) at Socket.emit (node:events:513:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Socket.Readable.push (node:internal/streams/readable:234:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) { length: 100, severity: 'FATAL', code: '28000', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'miscinit.c', line: '710', routine: 'InitializeSessionUserId' } Warning: command "ts-node ../../node_modules/typeorm/cli.js migration:run -d src/database/typeorm/metadata/metadata.datasource.ts" exited with non-zero status code β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” NX Ran target typeorm for project twenty-server (1s) With additional flags: migration:run --d=src/database/typeorm/metadata/metadata.datasource.ts βœ– 1/1 failed βœ” 0/1 succeeded [0 read from cache] i create my database with : psql postgres -c "CREATE DATABASE "default";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"
Weiko
Weikoβ€’4w ago
@JΓ©rΓ©my do you have postgres running when you do brew services (nevermind, I read the error too quickly, you clearly reach your SQL server there)
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
yes
thomast
thomastβ€’4w ago
@FΓ©lix is it linked to the upgrade?
Weiko
Weikoβ€’4w ago
What's in your server .env? PG_DATABASE_URL Seems like it's trying to connect with 'postgres' user which is not the standard way I believe
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
in the packages/twenty-server/.env i have : PG_DATABASE_URL=postgres://postgres:twenty@localhost:5432/default
Weiko
Weikoβ€’4w ago
This command created a user named "twenty' for you, use that one instead πŸ™‚ You should have PG_DATABASE_URL=postgres://twenty:twenty@localhost:5432/default
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
seems ok for database, i have new errors now aha
Weiko
Weikoβ€’4w ago
@FΓ©lix I think we should update the docs for people running their own SQL server and not running spilo? Seems not up to date πŸ™‚ What's the error? πŸ™‚
JΓ©rΓ©my
JΓ©rΓ©myOPβ€’4w ago
Its okkkk thats working !!! thanks a lot @Weiko @thomast
Weiko
Weikoβ€’4w ago
Great πŸ™‚
Want results from more Discord servers?
Add your server