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β€’2mo 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β€’2mo ago
Alright removing the tag and leaving it to @Weiko. He has more context on this upgrade
Unknown User
Unknown Userβ€’2mo 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β€’2mo ago
I get a similar error. Except instead of task, it’s failing on β€œnote”
Weiko
Weikoβ€’2mo 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β€’2mo 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.
Want results from more Discord servers?
Add your server