Upgrade to latest version doesn't work

I've updated my docker-compose to use twentycrm/twenty-postgres-spilo but now in the server container I'm getting:
[Nest] 1 - 01/20/2025, 11:34:44 AM ERROR [TypeOrmModule] Unable to connect to the database (core). Retrying (1)...
error: database "default" does not exist
at Parser.parseErrorMessage (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:283:98)
at Parser.handlePacket (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:122:29)
at Parser.parse (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:35:38)
at Socket.<anonymous> (/app/node_modules/pg/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
[Nest] 1 - 01/20/2025, 11:34:44 AM ERROR [TypeOrmModule] Unable to connect to the database (core). Retrying (1)...
error: database "default" does not exist
at Parser.parseErrorMessage (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:283:98)
at Parser.handlePacket (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:122:29)
at Parser.parse (/app/node_modules/pg/node_modules/pg-protocol/dist/parser.js:35:38)
at Socket.<anonymous> (/app/node_modules/pg/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
17 Replies
Sebastian
SebastianOP6d ago
tried to update to v0.35.6 ok, looks like I've missed upgrade steps and broke my database, I'll try to run the VM from the snapshot
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
Hi @Sebastian, did you managed to fix your problem?
Sebastian
SebastianOP6d ago
I've managed, but then after migrations core.userWorkspace table was gone, so I've created it from database dump after upgrade. but now I can't access the workspace with the user I've followed this: https://twenty.com/developers/section/self-hosting/upgrade-guide should I run yarn commands after or before restoring the dump?
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
Rather before restoring but it won't hurt running them after
Sebastian
SebastianOP6d ago
but will that solve the issue? after trying to fix the permissions in database at least I can log in, but in the browser console I get: Uncaught (in promise) ApolloError: User is not a member of the workspace @bob any idea what to do here?
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
Sorry, I'm jumping from thread to thread So now you have an access and can normally create a record?
Sebastian
SebastianOP6d ago
no, I keep getting User is not a member of the workspace I just restored everything to version 34
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
You can run this query in database to verify whether your user can access the workspace select * from core."user" as user1 inner join core."userWorkspace" as userw on user1."id"=userw."userId" inner join core.workspace as works on userw."workspaceId"=works.id;
Sebastian
SebastianOP6d ago
yes, I was playing with that whole day, adding and removing stuff in the database, but still no luck I think I'll just keep it at version 33, I don't want to waste anymore time on that could you maybe update the documentation with clearer instructions of upgrades? like what has to be after and before, because right now it's unclear when to do dump and when restore of the dump
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
Sure, if actual version of documentation is unclear, I can fix that
Sebastian
SebastianOP6d ago
because now after restoring from backups which was running version 33, I did run yarn commands for 33 to 34 version, but now I get in the logs:
server-1 | error: error: column User.defaultWorkspaceId does not exist
server-1 | error: error: column User.defaultWorkspaceId does not exist
so I'll restore now to version 33
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
I'm sorry I couldn't help you, as a side note, migrations are one of the most notorious problems as far as I know
Sebastian
SebastianOP6d ago
looks like. also docs are missing updated docker-compose vars, like PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default instead of PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default which I had to find in the repo
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
🤔
Sebastian
SebastianOP6d ago
would you have time tomorrow to have a video call to debug the upgrade process from 33 to 35 version by version?
ɃØĦɆᵾS
ɃØĦɆᵾS6d ago
I'm sorry but I don't think I should be the person helping you with debug (as I'm only a volunteer), if you want, you can book a call with someone from core team https://twenty.com/Book-a-call
Twenty – Open Source CRM
An open source CRM designed for modern teams. Twenty combines extensibility, easy data integration, and a user-friendly interface for an innovative CRM experience.
Sebastian
SebastianOP6d ago
great, thanks, I'll do that!

Did you find this page helpful?