Upgrade to v0.23.0 failing

Hi @charles hope you and team are doing well! I'm running into issues with the v0.23.0 migration following the upgrade guide on the docs page. - yarn database:migrate:prod ✅ - yarn command:prod workspace:sync-metadata -f ❌ I'm receiving the following errors after running the second command:
[Nest] 551 - 08/06/2024, 12:14:56 PM WARN [SyncWorkspaceMetadataCommand] Workspace contains 7 issues, sync has been forced.
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Comparing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Updating workspace metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Generating migrations
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Saving migrations
[Nest] 551 - 08/06/2024, 12:14:56 PM ERROR [WorkspaceSyncMetadataService] Sync of standard objects failed with:
[Nest] 551 - 08/06/2024, 12:14:56 PM ERROR [WorkspaceSyncMetadataService] Error: Field demoUrl not found in originalObjectMetadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [SyncWorkspaceMetadataCommand] Finished synchronizing all active workspaces (1 workspaces).
[Nest] 551 - 08/06/2024, 12:14:56 PM WARN [SyncWorkspaceMetadataCommand] Workspace contains 7 issues, sync has been forced.
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Comparing standard objects and fields metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Updating workspace metadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Generating migrations
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [WorkspaceSyncObjectMetadataService] Saving migrations
[Nest] 551 - 08/06/2024, 12:14:56 PM ERROR [WorkspaceSyncMetadataService] Sync of standard objects failed with:
[Nest] 551 - 08/06/2024, 12:14:56 PM ERROR [WorkspaceSyncMetadataService] Error: Field demoUrl not found in originalObjectMetadata
[Nest] 551 - 08/06/2024, 12:14:56 PM LOG [SyncWorkspaceMetadataCommand] Finished synchronizing all active workspaces (1 workspaces).
Any help would be appreciated, thanks!
102 Replies
thomast
thomast2mo ago
cc @Weiko , you probably have more context on 0.23
Skyfox675
Skyfox6752mo ago
If it helps, I'm all for wiping out the troublesome "demoUrl" attribute. There were some other errors related to profile pictures and workspace avatars and attachments missing as well. I'm also open to resetting those to defaults and wiping all attachments to get this up and running again.
Weiko
Weiko2mo ago
Hi @Skyfox675, that's weird, this one seems to be a custom field, the sync command should ignore those. Did you rename an existing standard-field by any chance? If we check in the field-metadata table, does demoUrl have isCustom: false or a standardId?
Skyfox675
Skyfox6752mo ago
@Weiko sorry for the late reply, late getting home from the office.. Ok so assuming my psql game isn't too rust 😅 , it looks like demoUrl has isCustom=f and standardId IS NULL
Weiko
Weiko2mo ago
Ok so that's the issue. demoUrl is not a standard field. isCustom should be true. If you change its value to true it should be ignored by the sync command It shouldn't be false though, I'm not sure what happened. Did you create this field via the UI? Or updated it by any chance?
Skyfox675
Skyfox6752mo ago
I've guaranteed only made data model changes via the UI, I'm not looking for trouble 😂 I did start on v0.10 when first starting to use Twenty. I recently found a misconfiguration with my deployment that wasn't persisting .local-data correctly. So I may have missing data that may still be referenced in the database. Happy to wipe out all of those entries if needed for missing data. I did originally start by extending the standard Company object via the UI and adding attributes specific to my business/processes there, until @charles highly recommended not doing this (thank you btw) and as of v0.20.0 I added an Automation Custom Object that has all of these custom fields. But I don't remember if demoUrl is on the standard Company, or both (Automation and Company) FYI I do have daily pg_dumps available should we need to restore anything
Weiko
Weiko2mo ago
I see! Well, hard to tell, I don't see any other report / bugs related to custom fields having the wrong isCustom value. I'll keep an eye on it. Did the rest succeed for you? We changed the model a lot these last few months but we are trying to make upgrade easier after each update. Let me know if you still have any issue
Skyfox675
Skyfox6752mo ago
Would you mind providing the exact psql query I should run to change the field value, I can work it out myself if it's too much, would rather be safer though if it's something easy for you to share
Weiko
Weiko2mo ago
@Skyfox675
UPDATE "metadata"."fieldMetadata" SET "isCustom"=TRUE WHERE "name"='demoUrl';
UPDATE "metadata"."fieldMetadata" SET "isCustom"=TRUE WHERE "name"='demoUrl';
Should do the trick
Skyfox675
Skyfox6752mo ago
Amazing, thank you, running now 🙏
default=# UPDATE "metadata"."fieldMetadata" SET "isCustom"=TRUE WHERE "name"='demoUrl';
UPDATE 1
default=# SELECT "metadata"."fieldMetadata"."name","metadata"."fieldMetadata"."isCustom", "metadata"."fieldMetadata"."standardId" FROM "metadata"."fieldMetadata" WHERE "name"='demoUrl';
name | isCustom | standardId
---------+----------+------------
demoUrl | t |
(1 row)
default=# UPDATE "metadata"."fieldMetadata" SET "isCustom"=TRUE WHERE "name"='demoUrl';
UPDATE 1
default=# SELECT "metadata"."fieldMetadata"."name","metadata"."fieldMetadata"."isCustom", "metadata"."fieldMetadata"."standardId" FROM "metadata"."fieldMetadata" WHERE "name"='demoUrl';
name | isCustom | standardId
---------+----------+------------
demoUrl | t |
(1 row)
Weiko
Weiko2mo ago
So now if you try the command, it should not pick it up during the sync
Skyfox675
Skyfox6752mo ago
Giving it a shot now!
Skyfox675
Skyfox6752mo ago
Looks like it failed on another field invoicePortalLink this did (or still does) reside on both Company and Automation. I believe though that for Automation since the introduction of Link types in 0.12 I removed the <type> from the attribute name so this might actually be the Company field
Weiko
Weiko2mo ago
Probably the same reason, I'm guessing this field has isCustom:false
Skyfox675
Skyfox6752mo ago
No description
Want results from more Discord servers?
Add your server