Postgres Error During Local Setup

Hi, I am getting the following errors when following the local setup instructions (after running npx nx database:reset twenty-server ):
Error during migration run:
error: role "postgres" does not exist
at Parser.parseErrorMessage (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:369:69)
at Parser.handlePacket (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:188:21)
at Parser.parse (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:103:30)
at Socket.<anonymous> (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/index.ts:7:48)
at Socket.emit (node:events:517:28)
at Socket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Socket.Readable.push (node:internal/streams/readable:278: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: '798',
routine: 'InitializeSessionUserId'
}
Warning: command "ts-node ../../node_modules/typeorm/cli.js migration:run -d src/database/typeorm/metadata/metadata.datasource" exited with non-zero status code
Error during migration run:
error: role "postgres" does not exist
at Parser.parseErrorMessage (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:369:69)
at Parser.handlePacket (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:188:21)
at Parser.parse (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/parser.ts:103:30)
at Socket.<anonymous> (/Users/bellahuang/ECE444/twenty/node_modules/pg/node_modules/pg-protocol/src/index.ts:7:48)
at Socket.emit (node:events:517:28)
at Socket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Socket.Readable.push (node:internal/streams/readable:278: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: '798',
routine: 'InitializeSessionUserId'
}
Warning: command "ts-node ../../node_modules/typeorm/cli.js migration:run -d src/database/typeorm/metadata/metadata.datasource" exited with non-zero status code
4 Replies
Bella H
Bella HOP4w ago
———————————————————————————————————————————————————————————————————————————————————————————————————

NX Ran target typeorm for project twenty-server (2s)

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 (3s)

✖ 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 (44s)

✖ 1/3 failed
✔ 2/3 succeeded [2 read from cache]
———————————————————————————————————————————————————————————————————————————————————————————————————

NX Ran target typeorm for project twenty-server (2s)

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 (3s)

✖ 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 (44s)

✖ 1/3 failed
✔ 2/3 succeeded [2 read from cache]
thomast
thomast4w ago
hi @Bella H, what steps did you follow here https://twenty.com/developers/local-setup?
Twenty - Local Setup
Mostly for contributors or curious developers
Bella H
Bella HOP4w ago
Hi @thomast , I went through steps 1-7 for Mac OS, and ran into the above error after running npx nx database:reset twenty-server at step 7
thomast
thomast4w ago
what option did you choose for step 3? can you provide the available roles you have in your postgres DB? could you provide your PG_DATABASE_URL in your .env @Bella H
Want results from more Discord servers?
Add your server