T
Twenty4mo ago
marie

v0.22 upgrade warnings

Hey! We have just released v0.22.0 🎉 If you self-host you will need to run the below commands to transition to v0.22.0:
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -f
yarn command:prod upgrade-0.22
yarn database:migrate:prod
yarn command:prod workspace:sync-metadata -f
yarn command:prod upgrade-0.22
GitHub
Release Enhanced Kanban Board and Navigation bars, bulk deletion · ...
What's Changed Refactor calendar to use new sync statuses and stages by @bosiraphael in #6141 Navigate to field settings page on Go to Settings by @ijreilly in #6128 Fix wrong email direction ...
26 Replies
Rob
Rob4mo ago
Congratulations on the release!! While running sync-metadata I got the following errors (full log in attachment.
query failed: INSERT INTO "metadata"."fieldMetadata"("id", "standardId", "objectMetadataId", "type", "name", "label", "defaultValue", "description", "icon", "options", "settings", "isCustom", "isActive", "isSystem", "...
error: error: duplicate key value violates unique constraint "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique"
Sync of standard objects failed with: QueryFailedError: duplicate key value violates unique constraint "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique"
`{"addressStreet1":"''","addressStreet2":"''","addressCity":"''","addressState":"''","addressCountry":"''","addressPostcode":"''","addressLat":null,"addressLng":null}`,
...
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:63:46) {
length: 392,
severity: 'ERROR',
code: '23505',
detail: 'Key (name, "objectMetadataId", "workspaceId")=(objectMetadataId, 03191507-24d0-48b6-8db2-907a9d1294d7, 6e278d07-a88a-45d3-86c9-daea30a9b0e5) already exists.',
...
[Nest] 223 - 07/17/2024, 12:50:09 AM WARN [SyncWorkspaceMetadataCommand] Workspace contains 2 issues, sync has been forced.
query failed: INSERT INTO "metadata"."fieldMetadata"("id", "standardId", "objectMetadataId", "type", "name", "label", "defaultValue", "description", "icon", "options", "settings", "isCustom", "isActive", "isSystem", "...
error: error: duplicate key value violates unique constraint "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique"
Sync of standard objects failed with: QueryFailedError: duplicate key value violates unique constraint "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique"
`{"addressStreet1":"''","addressStreet2":"''","addressCity":"''","addressState":"''","addressCountry":"''","addressPostcode":"''","addressLat":null,"addressLng":null}`,
...
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:63:46) {
length: 392,
severity: 'ERROR',
code: '23505',
detail: 'Key (name, "objectMetadataId", "workspaceId")=(objectMetadataId, 03191507-24d0-48b6-8db2-907a9d1294d7, 6e278d07-a88a-45d3-86c9-daea30a9b0e5) already exists.',
...
[Nest] 223 - 07/17/2024, 12:50:09 AM WARN [SyncWorkspaceMetadataCommand] Workspace contains 2 issues, sync has been forced.
and then on the upgrade-0.22 command i get the error [Nest] 267 - 07/17/2024, 12:51:09 AM LOG [AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand] Error - missing new Address standard field of type Address, please run workspace-sync-metadata on your workspace (6e278d07-a88a-45d3-86c9-daea30a9b0e5) before running this command Is this a critical issue and do you suggest I try and fix it? If so, do you have any advice on how i might tackle this? Thanks!!!!
marie
marie4mo ago
Hi @Rob thank you!! About your issue, the issue from the upgrade-0.22 command is not critical at all, but the one in sync-metadata is more annoying. In our latest version we transitioned the standard field on company "address" to a new "address" composite field that contains subfields such as street, city, state etc. The sync-metadata script is supposed to deprecate the previous version of this field (by renaming it address_old and updating its fieldmetadata value isCustom to true) and introduce the new one (by creating a new address field). Your error indicates that the field with the name "address" already exists; maybe the deprecation of the old address field failed for some reason. Could you please show me - what are your pending migrations (metadata > workspace migration > sort by "applied at" desc to get the most recent ones) - which address field you have in your fieldMetadata (metadata > fieldMetadata > filter by name "address"): the whole row Thank you for your patience !
Rob
Rob4mo ago
Thanks @marie I have attached both info as csv files. Thanks for your assistance!
marie
marie4mo ago
Thanks @Rob ! Can you confirm you are trying to migrate from to v0.22 from 0.21 and not from an older version ? If not, that could cause issues. Also, would it be possible for you to dm me a dump of your db so I can try to reproduce locally ?
Rob
Rob4mo ago
Thanks @marie . I am upgrading from 0.21 to 0.22 (0.21 seemed to work perfectly for the last few weeks). Sending you the db dump now
marie
marie4mo ago
Hi @Rob , I started investigating but could not reproduce on my end - I will further investigate tomorrow and keep you posted, thanks for your patience
Rob
Rob4mo ago
Thanks @marie please let me know if there is anything I can do/share to make it easier for you. I can also jump on a call if that’s easier for you. Thanks again
thilles
thilles4mo ago
Hi @marie! I also got some other errors while following the upgrade commands from 0.21.2 to 0.22.0. Anything known?
greg [iero]
greg [iero]4mo ago
Hello @marie and @charles, same for me after updating from 0.21 to 0.22. When I enter:
yarn command:prod workspace:sync-metadata -f
yarn command:prod workspace:sync-metadata -f
greg [iero]
greg [iero]4mo ago
I get those errors
charles
charles4mo ago
@greg [iero] @thilles @Rob we are taking a look this morning 🙂
Rob
Rob4mo ago
Thanks @charles
charles
charles4mo ago
@Rob we cannot reproduce the issue with your dump, it's running smoothly on our side, would it be possible to schedule a call to have a look directly on your setup? Just to make sure, what postgres version are you running? 15.5? @thilles there is an extra S in your default value FULL_MESSAGES_LIST_FETCH_PENDING. Could you check that: - on your workspaceSchema, messageChannels table, that the default of the syncStage enum is FULL_MESSAGE_LIST_FETCH_PENDING - in metadata schema, fieldMetadata where name = syncStage of objectMetadata messageChannels that defaultValue is also FULL_MESSAGE_LIST_FETCH_PENDING it should be easy to fix, sorry about that we thought that this was not impacting self-hosting @greg [iero] you seem to have the same problem than @Rob, would be great to schedule a call to troubleshoot
Rob
Rob4mo ago
@charles I can jump on a call. Can you do in 20 min from now? And I am using the docker image " image: twentycrm/twenty-postgres:v0.20.0" for the database. Should I upgrade to v0.22?
charles
charles4mo ago
@Rob yes we can hop in a call with @marie at 12:00 (in 13 min) it that works for you we will be in the voice channel
Rob
Rob4mo ago
that works! thanks
charles
charles4mo ago
@thilles could you also try to run yarn command:prod migrate-0.22:update-message-channel-sync-stage-enum @Rob and @greg [iero] issues fixed 🙂
Rob
Rob4mo ago
Thanks @charles and @marie . Appreciate the help. I am now trying to fix the number of fields issue. I have removed 10 fields and the people page is still not loading. I will continue to try and remove additional fields.
thilles
thilles4mo ago
Will try that tonight, thanks!
charles
charles4mo ago
That's an annoying limitation indeed @Rob. I'll take a look this sprint to see if we can be smarter in the fields we query
Rob
Rob4mo ago
Thanks. I have now removed enough fields and it is working. I think it was 12+ fields to deactivate. Thanks again for the great software
greg [iero]
greg [iero]4mo ago
Thanks a lot @marie @charles , I pushed the same correction to my production server and everything is working well
thilles
thilles4mo ago
yarn command:prod migrate-0.22:update-message-channel-sync-stage-enum seemed to sort of work. At least after running sync-metadata and upgrade-0.22 afterwards, I got the new address field. Although the FULL_MESSAGES_LIST_FETCH_PENDING naming errors are still present. Would going from 0.21.2 -> 0.22.1 (instead of 0.22.0) fix this from the start? Currently only playing around in dev env syncStage enum seems to be default FULL_MESSAGE_LIST_FETCH_PENDING
-- Generated by the database client.
CREATE TABLE workspace_29p7xdle6v00po764fzkgp6i3."messageChannel"(
id uuid NOT NULL DEFAULT public.uuid_generate_v4(),
...
"syncStage" "messageChannel_syncStage_enum" NOT NULL DEFAULT 'FULL_MESSAGE_LIST_FETCH_PENDING'::"messageChannel_syncStage_enum",
...
PRIMARY KEY(id),
CONSTRAINT FK_2e966cbb240771c67630d52895c FOREIGN key("connectedAccountId") REFERENCES "connectedAccount"(id)
);
-- Generated by the database client.
CREATE TABLE workspace_29p7xdle6v00po764fzkgp6i3."messageChannel"(
id uuid NOT NULL DEFAULT public.uuid_generate_v4(),
...
"syncStage" "messageChannel_syncStage_enum" NOT NULL DEFAULT 'FULL_MESSAGE_LIST_FETCH_PENDING'::"messageChannel_syncStage_enum",
...
PRIMARY KEY(id),
CONSTRAINT FK_2e966cbb240771c67630d52895c FOREIGN key("connectedAccountId") REFERENCES "connectedAccount"(id)
);
thilles
thilles4mo ago
but in metadata."fieldMetadata" the default is still "'FULL_MESSAGES_LIST_FETCH_PENDING'"
No description
charles
charles4mo ago
@thilles I think that if you just update the fieldMetadata you should be good to go! (make sure to check the "options" also)
Rob
Rob4mo ago
@charles @marie thank you, again, for helping with my upgrade issues. And then helping to identify that I needed to delete fields to reduce below the 100 limit because of the new standard fields added in v0.22. Just an FYI, I ran in to another problem. All my rest calls started failing even on depth =1. I’ve removed additional fields and changed depth to 0 for now. I will probably move to graphql next to optimise the queries and stay below the 100 limit. I suspect that rest queries might ignore that fields are deactivated. I just noticed that there is a PR to add further standard fields (created by). Which will mean I need to delete more of my custom fields to ensure the webui works. I understand that the product is in constant development and you will be adding new features and fields etc. I’m pleased to be an early user and understand that means potential bugs or that I may need to change our workflow over time. Can you provide any rough guidance as to how many custom fields you recommend I use and don’t go above for the next few months (until you switch out the underlying library)?
Want results from more Discord servers?
Add your server