Errors upgrading from 0.12 to 0.20

Hello, I updated the docker from 0.12 to 0.20 using docker-compose up --build -d I have some errors in the logs (attached), but it seems to work.
12 Replies
greg [iero]
greg [iero]5mo ago
I saw that I have to migrade DB using those commands:
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -w $workspaceId -f
yarn command:prod migrate-0.20:update-message-channel-sync-status-enum
yarn command:prod migrate-0.20:update-message-channel-visibility-enum
yarn command:prod migrate-0.20:backfill-record-position -w $workspaceId
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -w $workspaceId -f
yarn command:prod migrate-0.20:update-message-channel-sync-status-enum
yarn command:prod migrate-0.20:update-message-channel-visibility-enum
yarn command:prod migrate-0.20:backfill-record-position -w $workspaceId
I launched a yarn database:migrate:prod and I have no error. Then I launched yarn command:prod workspace:sync-metadata -w 7823fcc0-feff-4ae5-8555-86c42cf82b6c -f and I have many errors (attached) starting with: Error executing migration QueryFailedError: type "workspace_741y2bhupr008ai8qozyb7f58.messageChannel_syncStatus_enum" does not exist
charles
charles5mo ago
I think you might have some legacy errors from 0.3.3. Could you make sure that your enum is named: messageChannel_syncStatus_enum and not messageChannel_syncstatus_enum ?
greg [iero]
greg [iero]5mo ago
Bonjour @charles Indeed, it seems to be the first one.
No description
greg [iero]
greg [iero]5mo ago
How do I update this?
charles
charles5mo ago
you can just rename it using an SQL query: ALTER TYPE workspace_153t7qnxistacfxobsx8zmpy8."messageChannel_syncstatus_enum" RENAME TO "messageChannel_syncStatus_enum";
greg [iero]
greg [iero]5mo ago
Thanks @charles All good, now the second command works. I only have two warnings:
[Nest] 6790 - 06/18/2024, 6:52:30 AM WARN [SyncWorkspaceMetadataCommand] Workspace health check failed with error, but sync has been forced.
[Nest] 6790 - 06/18/2024, 6:52:30 AM WARN [SyncWorkspaceMetadataCommand] NotFoundException: Table calendarEvent not found in schema workspace_741y2bhupr008ai8qozyb7f58
[Nest] 6790 - 06/18/2024, 6:52:30 AM WARN [SyncWorkspaceMetadataCommand] Workspace health check failed with error, but sync has been forced.
[Nest] 6790 - 06/18/2024, 6:52:30 AM WARN [SyncWorkspaceMetadataCommand] NotFoundException: Table calendarEvent not found in schema workspace_741y2bhupr008ai8qozyb7f58
charles
charles5mo ago
The second one is a bit worrying. Do you see the calendarEvent table in your workspace schema?
greg [iero]
greg [iero]5mo ago
Yes this one?
No description
greg [iero]
greg [iero]5mo ago
It seems the table exists now (just created with the following commands?):
yarn command:prod migrate-0.20:update-message-channel-sync-status-enum
yarn command:prod migrate-0.20:update-message-channel-visibility-enum
yarn command:prod migrate-0.20:backfill-record-position -w $workspaceId
yarn command:prod migrate-0.20:update-message-channel-sync-status-enum
yarn command:prod migrate-0.20:update-message-channel-visibility-enum
yarn command:prod migrate-0.20:backfill-record-position -w $workspaceId
So I relaunched yarn command:prod workspace:sync-metadata -w $workspaceId -f and now I only have:
[Nest] 7516 - 06/18/2024, 7:00:00 AM WARN [SyncWorkspaceMetadataCommand] Workspace contains 12 issues, sync has been forced.
[Nest] 7516 - 06/18/2024, 7:00:00 AM WARN [SyncWorkspaceMetadataCommand] Workspace contains 12 issues, sync has been forced.
yarn command:prod migrate-0.20:update-message-channel-sync-status-enum When I try this command, I get:
[Nest] 7861 - 06/18/2024, 7:02:46 AM LOG [UpdateMessageChannelSyncStatusEnumCommand] Running command on 2 workspaces
[Nest] 7861 - 06/18/2024, 7:02:46 AM LOG [UpdateMessageChannelSyncStatusEnumCommand] Object metadata for messageChannel not found in workspace 20202020-1c25-4d02-bf25-6aeccf7ea419
[Nest] 7861 - 06/18/2024, 7:02:46 AM LOG [UpdateMessageChannelSyncStatusEnumCommand] Running command on 2 workspaces
[Nest] 7861 - 06/18/2024, 7:02:46 AM LOG [UpdateMessageChannelSyncStatusEnumCommand] Object metadata for messageChannel not found in workspace 20202020-1c25-4d02-bf25-6aeccf7ea419
charles
charles5mo ago
Ok, looks better! sorry there is a mistake in the command: you should add the -w option to these commands otherwise it tries to sync all workspaces and I suspect you have a legacy demo workspace in your database (you can just delete it btw + delete all data tied to its workspaceId in metadata and core schema)
greg [iero]
greg [iero]5mo ago
Seems all good. Thanks @charles Très bonne journée à toi 🙂
Want results from more Discord servers?
Add your server