Upgrade 0.22.1 to v0.23.0 issues

Following the guide I'm running
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -f
yarn command:prod upgrade-0.23
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -f
yarn command:prod upgrade-0.23
But during workspace-sync I receive:
0:11 PM ERROR [CompositeColumnActionFactory] Current property not found for altered property: primaryLinkLabel
[Nest] 762 - 08/07/2024, 2:10:11 PM ERROR [WorkspaceSyncMetadataService] Sync of standard objects failed with:
[Nest] 762 - 08/07/2024, 2:10:11 PM ERROR [WorkspaceSyncMetadataService] Error: Current property not found for altered property: primaryLinkLabel
0:11 PM ERROR [CompositeColumnActionFactory] Current property not found for altered property: primaryLinkLabel
[Nest] 762 - 08/07/2024, 2:10:11 PM ERROR [WorkspaceSyncMetadataService] Sync of standard objects failed with:
[Nest] 762 - 08/07/2024, 2:10:11 PM ERROR [WorkspaceSyncMetadataService] Error: Current property not found for altered property: primaryLinkLabel
if I then continue with next command I get:
27 Replies
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
Nest] 859 - 08/07/2024, 2:11:45 PM LOG [UpdateActivitiesCommand] Running command on 1 workspaces
[Nest] 859 - 08/07/2024, 2:11:46 PM LOG [UpdateActivitiesCommand] Running command on workspace 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e failed
[Nest] 859 - 08/07/2024, 2:11:46 PM ERROR [UpdateActivitiesCommand] Migration failed for workspace 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e: No metadata for "task" was found., EntityMetadataNotFoundError: No metadata for "task" was found.
at WorkspaceDataSource.getMetadata (/app/node_modules/typeorm/data-source/DataSource.js:304:19)
at get metadata [as metadata] (/app/node_modules/typeorm/repository/Repository.js:15:40)
at WorkspaceRepository.create (/app/node_modules/typeorm/repository/Repository.js:52:41)
at updateActivities (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:110:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async UpdateActivitiesCommand.executeWithQueryRunner (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:279:21)
at async UpdateActivitiesCommand.sharedBoilerplate (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:257:21)
at async UpgradeTo0_23Command.run (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-upgrade-version.command.js:43:9)
at async Command.<anonymous> (/app/node_modules/nest-commander/src/command-runner.service.js:156:24)
at async Command.parseAsync (/app/node_modules/commander/lib/command.js:936:5)
[Nest] 859 - 08/07/2024, 2:11:46 PM LOG [UpdateActivitiesCommand] Command completed!
Nest] 859 - 08/07/2024, 2:11:45 PM LOG [UpdateActivitiesCommand] Running command on 1 workspaces
[Nest] 859 - 08/07/2024, 2:11:46 PM LOG [UpdateActivitiesCommand] Running command on workspace 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e failed
[Nest] 859 - 08/07/2024, 2:11:46 PM ERROR [UpdateActivitiesCommand] Migration failed for workspace 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e: No metadata for "task" was found., EntityMetadataNotFoundError: No metadata for "task" was found.
at WorkspaceDataSource.getMetadata (/app/node_modules/typeorm/data-source/DataSource.js:304:19)
at get metadata [as metadata] (/app/node_modules/typeorm/repository/Repository.js:15:40)
at WorkspaceRepository.create (/app/node_modules/typeorm/repository/Repository.js:52:41)
at updateActivities (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:110:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async UpdateActivitiesCommand.executeWithQueryRunner (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:279:21)
at async UpdateActivitiesCommand.sharedBoilerplate (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:257:21)
at async UpgradeTo0_23Command.run (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-upgrade-version.command.js:43:9)
at async Command.<anonymous> (/app/node_modules/nest-commander/src/command-runner.service.js:156:24)
at async Command.parseAsync (/app/node_modules/commander/lib/command.js:936:5)
[Nest] 859 - 08/07/2024, 2:11:46 PM LOG [UpdateActivitiesCommand] Command completed!
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
The issues I'm facing are reproducible without any real data. I created https://github.com/twentyhq/twenty/issues/6578 with a reproducer
GitHub
Upgrade from 0.22.1 to 0.23.0 missing metadata for task Β· Issue #65...
Bug Description bash <(curl -sL https://git.new/20) change TAG to 0.22.1 docker compose up login to app and create a task and opportunity docker compose down change tag to 0.23.0 docker compose ...
thomast
thomastβ€’4mo ago
cc @Weiko @πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄ do you still need help? I see this issue as solved
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
I have not marked it solved on purpose at least It seems to be a general bug because if I start from scratch it reproduces
thomast
thomastβ€’4mo ago
Alright removing the tag and leaving it to @Weiko. He has more context on this upgrade
Unknown User
Unknown Userβ€’4mo ago
Message Not Public
Sign In & Join Server To View
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
Yes that is the issue i created once I realized I could reproduce it cleanly without any real data
Rob
Robβ€’4mo ago
I get a similar error. Except instead of task, it’s failing on β€œnote”
Weiko
Weikoβ€’4mo ago
Ok I can reproduce, having a look today. Thanks for the detailed description πŸ‘Œ @πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄ can you run yarn command:prod upgrade-0.23 before yarn command:prod workspace:sync-metadata I think the order is wrong in our doc. A sync-metadata is actually included in the upgrade-0.23 for that reason, because in this case the order matter The first error you have is due to the fact that it's trying to sync and auto fix a link field but it should have been migrated to the new links field type before because link field are not supproted after 0.23. This is why you need to run the command upgrade-0.23 first
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
@Weiko I've left work but I will get back to you tomorrow. I do believe there was issues in that order as well but not necessarily the same ones. Does it work when you do it according to my steps in issue report?
Weiko
Weikoβ€’4mo ago
It does yes. I can't reproduce the error you have with upgrade-0.23 but at least it explains why sync-metadata fails if you run it first. So now we need to understand why upgrade-0.23 does not work for existing workspaces. It did with a fresh workspace. If we look at the error, it tells you it can't move data from activity table to task table (that's part of. the upgarde) because the task table does not exist yet, hence why we included a sync-metadata in between operations that are executed during the upgrade
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
If I start from empty docker compose 0.22.1, create user, create workspace, create task with company+person relationship, create oppurtunity, then stop, change to 0.23, start and run migrate prod it works without any errors from what I can see but when I run
yarn command:prod upgrade-0.23
yarn command:prod upgrade-0.23
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
Trying now with v0.23.1 instead of v0.23.0 I can atleast run it on my reproducer. There are a lot of issues left on the workspace though - not something I would expect on database created and upgraded only one version.
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
Nvm if I have a task it still fails (forgot to create the task in the empty workspace) @Weiko are you able to reproduce the issue with upgrade from database created in 0.22.1->0.23.x ? If so is that something that will be corrected or should we look into trying to upgrade and manually fix the data?
Weiko
Weikoβ€’4mo ago
I won't be available for the next 3 days and won't be able to push a fix unfortunately. I'll let @thomast or @charles see if a patch can be pushed or if we can provide a manual action (SQL query to fix your workspace) for you
charles
charlesβ€’4mo ago
I'm back @πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄, on v0.23.1 i have a typescript issue. I'll fix it (we are also releasing a nice performance update), make it v0.23.2 and see if I face the same inconsistencies while 0.22.1->0.23.x it's likely though
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
@charles It's seems like a general issue since I can recreate it without our data by creating a workspace in 0.22.x and adding a task to it and then trying to upgrade to 0.23.x
charles
charlesβ€’4mo ago
I haven't forgot, planning on pushing a patch tonight I can reproduce the issue, working on a patch
πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄
My colleague @koenig will likely be taking over since I am no longer with the company that was using twenty. Thank you for amazing help @charles and if I ever find another use for twenty you are sure to hear from me again! Great piece of software!
charles
charlesβ€’4mo ago
@πŸ…ΉπŸ…°πŸ†ˆπŸ…±πŸ…΄πŸ…΄ it was very nice discussing with you, I'll hope you seeing you back at some point, wishing you the best !
Rob
Robβ€’4mo ago
@charles my upgrade to v0.23.2 from v0.22.1 is failing with the following error
[Nest] 174 - 08/22/2024, 2:14:46 AM LOG [UpdateActivitiesCommand] Running command on 2 workspaces
[Nest] 174 - 08/22/2024, 2:14:47 AM LOG [UpdateActivitiesCommand] Running command on workspace 6e278d07-a88a-45d3-86c9-daea30a9b0e5 failed
[Nest] 174 - 08/22/2024, 2:14:47 AM ERROR [UpdateActivitiesCommand] Migration failed for workspace 6e278d07-a88a-45d3-86c9-daea30a9b0e5: No metadata for "note" was found., EntityMetadataNotFoundError: No metadata for "note" was found.
at WorkspaceDataSource.getMetadata (/app/node_modules/typeorm/data-source/DataSource.js:304:19)
at get metadata [as metadata] (/app/node_modules/typeorm/repository/Repository.js:15:40)
at WorkspaceRepository.create (/app/node_modules/typeorm/repository/Repository.js:52:41)
at updateActivities (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:68:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async UpdateActivitiesCommand.executeWithQueryRunner (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:279:21)
at async UpdateActivitiesCommand.sharedBoilerplate (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:257:21)
at async UpgradeTo0_23Command.run (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-upgrade-version.command.js:44:9)
at async Command.<anonymous> (/app/node_modules/nest-commander/src/command-runner.service.js:162:24)
at async Command.parseAsync (/app/node_modules/commander/lib/command.js:936:5)
[Nest] 174 - 08/22/2024, 2:14:46 AM LOG [UpdateActivitiesCommand] Running command on 2 workspaces
[Nest] 174 - 08/22/2024, 2:14:47 AM LOG [UpdateActivitiesCommand] Running command on workspace 6e278d07-a88a-45d3-86c9-daea30a9b0e5 failed
[Nest] 174 - 08/22/2024, 2:14:47 AM ERROR [UpdateActivitiesCommand] Migration failed for workspace 6e278d07-a88a-45d3-86c9-daea30a9b0e5: No metadata for "note" was found., EntityMetadataNotFoundError: No metadata for "note" was found.
at WorkspaceDataSource.getMetadata (/app/node_modules/typeorm/data-source/DataSource.js:304:19)
at get metadata [as metadata] (/app/node_modules/typeorm/repository/Repository.js:15:40)
at WorkspaceRepository.create (/app/node_modules/typeorm/repository/Repository.js:52:41)
at updateActivities (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:68:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async UpdateActivitiesCommand.executeWithQueryRunner (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:279:21)
at async UpdateActivitiesCommand.sharedBoilerplate (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-update-activities.command.js:257:21)
at async UpgradeTo0_23Command.run (/app/packages/twenty-server/dist/src/database/commands/upgrade-version/0-23/0-23-upgrade-version.command.js:44:9)
at async Command.<anonymous> (/app/node_modules/nest-commander/src/command-runner.service.js:162:24)
at async Command.parseAsync (/app/node_modules/commander/lib/command.js:936:5)
I ran yarn database:migrate:prod and then yarn command:prod upgrade-0.23. I also tried with yarn command:prod workspace:sync-metadata -f in the middle Do you have any suggestions to fix this? THANKS!
charles
charlesβ€’4mo ago
Hi Rob, would you be available today for a quick call?
Rob
Robβ€’4mo ago
Thanks @charles , just DM’d you some times.
charles
charlesβ€’4mo ago
Investigated with Rob, turns out that a custom field was not having isCustom: true in fieldMetadata table
Want results from more Discord servers?
Add your server