Upgrade error 0.3.2 > 0.3.3 : duplicate key value violates unique constraint

duplicate key value violates unique constraint "IndexOnNamePluralAndWorkspaceIdUnique"
yarn command:prod workspace:health -w 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e
yarn command:prod workspace:health -w 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e
reports healthy but:
yarn command:prod workspace:sync-metadata -w 75f6e77a-ec52-43fd-af2b-5e1
ca8319b2e -d
yarn command:prod workspace:sync-metadata -w 75f6e77a-ec52-43fd-af2b-5e1
ca8319b2e -d
fails with:
detail: 'Key ("namePlural", "workspaceId")=(activityTargets, 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e) already exists.'
detail: 'Key ("namePlural", "workspaceId")=(activityTargets, 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e) already exists.'
I tried deleting in "metadata"."objectData" to see if it had any effect but it did not:

delete from "metadata"."objectMetadata" where "namePlural"='activityTargets';
DELETE 2

delete from "metadata"."objectMetadata" where "namePlural"='activityTargets';
DELETE 2
115 Replies
charles
charles8mo ago
Hi @🅹🅰🆈🅱🅴🅴 do you have data in your workspace? If yes you should not delete things from metadata We have introduced the notion of "standard-ids" recently, I think you are missing it
🅹🅰🆈🅱🅴🅴
test server so it is not an issue
charles
charles8mo ago
ok! do you see a standard-id column in your field metadata table? If yes, you should run first: yarn command:prod workspace:add-standard-id (Note that we are on 0.10.0, I can help you migrate directly to this version if you want)
🅹🅰🆈🅱🅴🅴
That might be beneficial yes. Lets see if I can push it to test. I know there was changes with server/frontend not sure if I managed to fix those yet
charles
charles8mo ago
have you added some code on your side? or you are using twenty public images?
🅹🅰🆈🅱🅴🅴
Using twenty public but the docker compose and nginx config needs some love. You merged the images and I havent had a chance to test the changes that was needed. I'll ping back here when It's up and running.
charles
charles8mo ago
ok! it should be easier than before the postgres database is still separated so you should be able to connect it to the new twenty instance
🅹🅰🆈🅱🅴🅴
Most likely tomorrow though, time for dinner and family! 🙂
charles
charles8mo ago
Bon appetit! Ping me if/when you need help
🅹🅰🆈🅱🅴🅴
I'm now getting an error when I try and run migrate:prod in v0.10.0 so I believe it to be functioning. I can't login but I assume that's because of database migrations not finishing attaching output of yarn database:migrate:prod
🅹🅰🆈🅱🅴🅴
\d "core"."user":
🅹🅰🆈🅱🅴🅴
@charles "ping" 🙂
charles
charles8mo ago
mmh, there is an issue with migrations. What do you have in your core._typeorm_migrations table? I think there is a mistake in our migration. I can fix it on main and push a patch to v0.10 but it wont help you right now. I think it's in 1711557405330-addMissingMigration line 39. What you can do is to manually add this constraint to your user table so the migration run
🅹🅰🆈🅱🅴🅴
select * from "core"."_typeorm_migrations";
id | timestamp | name
----+---------------+-----------------------------------------------------
1 | 1700324860820 | SetupCoreTables1700324860820
2 | 1700654387203 | AddAllowImpersonationToWorkspace1700654387203
3 | 1700661180856 | AddCascadeDeleteOnRefreshTokenUser1700661180856
4 | 1700663611659 | AddWorkspaceDeleteCascadeSetNullInUser1700663611659
5 | 1701194529853 | AddFeatureFlags1701194529853
6 | 1702479005171 | AddSubscriptionStatusOnWorkspace1702479005171
7 | 1704825571702 | AddPasswordResetToken1704825571702
8 | 1706613419989 | AddDefaultAvatarUrlToUser1706613419989
9 | 1707778127558 | AddUserWorkspaces1707778127558
10 | 1708535112230 | AddBillingCoreTables1708535112230
11 | 1709233666080 | UpdateBillingCoreTables1709233666080
12 | 1709314035408 | UpdateUserWorkspace1709314035408
select * from "core"."_typeorm_migrations";
id | timestamp | name
----+---------------+-----------------------------------------------------
1 | 1700324860820 | SetupCoreTables1700324860820
2 | 1700654387203 | AddAllowImpersonationToWorkspace1700654387203
3 | 1700661180856 | AddCascadeDeleteOnRefreshTokenUser1700661180856
4 | 1700663611659 | AddWorkspaceDeleteCascadeSetNullInUser1700663611659
5 | 1701194529853 | AddFeatureFlags1701194529853
6 | 1702479005171 | AddSubscriptionStatusOnWorkspace1702479005171
7 | 1704825571702 | AddPasswordResetToken1704825571702
8 | 1706613419989 | AddDefaultAvatarUrlToUser1706613419989
9 | 1707778127558 | AddUserWorkspaces1707778127558
10 | 1708535112230 | AddBillingCoreTables1708535112230
11 | 1709233666080 | UpdateBillingCoreTables1709233666080
12 | 1709314035408 | UpdateUserWorkspace1709314035408
charles
charles8mo ago
actually, it looks legit in Twenty codebase, I don't get why you were missing this constraint
No description
charles
charles8mo ago
nevermind, let's fix it on your workspace
🅹🅰🆈🅱🅴🅴
I added the the FK and ran migration again and it worked
charles
charles8mo ago
ok, perfect! now, make sure to run yarn command:prod workspace:add-standard-id then: - yarn command:prod workspace:health -w {your_workspace_id} -d And send the /logs folder content here, it will tell us how far your workspace postgres schema is from being ready for 0.10
🅹🅰🆈🅱🅴🅴
Weird issue with mergin old and new logs. Last file should be correct
charles
charles8mo ago
Ok! not too bad! we need to migrate the timestamps format https://discord.com/channels/1130383047699738754/1130383048173682821/1225854615883354133 Follow the step 2. to perform the timestamp migration
🅹🅰🆈🅱🅴🅴
COLUMN_DEFAULT_VALUE_NOT_VALID and COLUMN_NULLABILITY_CONFLICT are the only two types of errors left from what I can see
charles
charles8mo ago
ok! yarn command:prod workspace:health -w {workspaceId} --fix default-value yarn command:prod workspace:health -w {workspaceId} --fix nullable
🅹🅰🆈🅱🅴🅴
Fix of issues failed with: BadRequestException: Invalid default value ""
at serializeDefaultValue (/app/packages/twenty-server/dist/src/engine/metadata-modules/field-metadata/utils/serialize-default-value.js:45:11)
at CompositeColumnActionFactory.handleAlterAction (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/factories/composite-column-action.factory.js:64:93)
at CompositeColumnActionFactory.create (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/factories/column-action-abstract.factory.js:23:33)
at WorkspaceMigrationFactory.createColumnAction (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/workspace-migration.factory.js:45:24)
at WorkspaceMigrationFactory.createColumnActions (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/workspace-migration.factory.js:34:36)
at WorkspaceMigrationFieldFactory.updateFieldMigration (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-migration-builder/factories/workspace-migration-field.factory.js:77:61)
at WorkspaceMigrationFieldFactory.create (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-migration-builder/factories/workspace-migration-field.factory.js:37:29)
at WorkspaceNullableFixer.fixColumnNullabilityIssues (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/fixer/workspace-nullable.fixer.js:42:52)
at WorkspaceNullableFixer.createWorkspaceMigrations (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/fixer/workspace-nullable.fixer.js:30:21)
at WorkspaceFixService.createWorkspaceMigrations (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/services/workspace-fix.service.js:32:56) {
response: {
statusCode: 400,
message: 'Invalid default value ""',
error: 'Bad Request'
},
status: 400,
options: {}
}
Fix of issues failed with: BadRequestException: Invalid default value ""
at serializeDefaultValue (/app/packages/twenty-server/dist/src/engine/metadata-modules/field-metadata/utils/serialize-default-value.js:45:11)
at CompositeColumnActionFactory.handleAlterAction (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/factories/composite-column-action.factory.js:64:93)
at CompositeColumnActionFactory.create (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/factories/column-action-abstract.factory.js:23:33)
at WorkspaceMigrationFactory.createColumnAction (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/workspace-migration.factory.js:45:24)
at WorkspaceMigrationFactory.createColumnActions (/app/packages/twenty-server/dist/src/engine/metadata-modules/workspace-migration/workspace-migration.factory.js:34:36)
at WorkspaceMigrationFieldFactory.updateFieldMigration (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-migration-builder/factories/workspace-migration-field.factory.js:77:61)
at WorkspaceMigrationFieldFactory.create (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-migration-builder/factories/workspace-migration-field.factory.js:37:29)
at WorkspaceNullableFixer.fixColumnNullabilityIssues (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/fixer/workspace-nullable.fixer.js:42:52)
at WorkspaceNullableFixer.createWorkspaceMigrations (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/fixer/workspace-nullable.fixer.js:30:21)
at WorkspaceFixService.createWorkspaceMigrations (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-health/services/workspace-fix.service.js:32:56) {
response: {
statusCode: 400,
message: 'Invalid default value ""',
error: 'Bad Request'
},
status: 400,
options: {}
}
charles
charles8mo ago
mmh, that's bad, it should be handled give me 1 sec could you share your metadata.fieldMetadata table?
🅹🅰🆈🅱🅴🅴
Weird formatting
🅹🅰🆈🅱🅴🅴
This might be easier to read
charles
charles8mo ago
it seems to be an issue with a composite field (CURRENCY, LINK, FULL_NAME) I'm trying to reproduce locally the fix command does not seem to work anymore I'm investigating it https://github.com/twentyhq/twenty/pull/5144/files I'm publishing the new images with the fix Ongoing push to dockerhub 🙂 it will be v0.10.1 it's there, let's try again when you have time
🅹🅰🆈🅱🅴🅴
I can't see it? https://hub.docker.com/r/twentycrm/twenty/tags says it's updated but I can't see the image
charles
charles8mo ago
sorry, it's not there yet actually, the amd build is still ongoing
🅹🅰🆈🅱🅴🅴
GitHub
Release Twenty · twentyhq/twenty@b3e1d6b
Building a modern alternative to Salesforce, powered by the community. - Release Twenty · twentyhq/twenty@b3e1d6b
charles
charles8mo ago
that's not this one!
🅹🅰🆈🅱🅴🅴
🙂 I see
charles
charles8mo ago
this one is to create the tag but it's failing, I've created the tag manually for now It's out 🙂
🅹🅰🆈🅱🅴🅴
Fixed 2/2 issues But when I run the check afterwards with -d "Workspace is not healthy, found 2 issues"
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Workspace is not healthy, found 2 issues
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Fixing issues
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Fixed 2/2 issues
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Workspace is not healthy, found 2 issues
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Fixing issues
[Nest] 661 - 04/24/2024, 1:50:41 PM LOG [WorkspaceHealthCommand] Fixed 2/2 issues
when I run it over and over again without -d
🅹🅰🆈🅱🅴🅴
I guess I can correct those manually
charles
charles8mo ago
looks good! could you share your fieldMetadata table again so I can double check?
🅹🅰🆈🅱🅴🅴
(just to make sure we understood eachother - it thinks it fixes the issues but if I run it again it finds the same issues and thinks it fixes them again)
charles
charles8mo ago
do not worry about the two remaining issues they won't impact you for now
charles
charles8mo ago
looks great! okay, no that you workspace is healthy, except these too, we will sync it to the latest version (this will update standard fields and objects) yarn command:prod workspace:sync-metadata -w {workspaceId} -f -f is a flag to bypass health-check
🅹🅰🆈🅱🅴🅴
[Nest] 1007 - 04/24/2024, 2:08:59 PM WARN [SyncWorkspaceMetadataCommand] Workspace contains 2 issues, sync has been forced.
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncObjectMetadataService] Comparing standard objects and fields metadata
Sync of standard objects failed with: Error: Field pipelineStep not found in originalObjectMetadata
at WorkspaceFieldComparator.compare (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/comparators/workspace-field.comparator.js:139:35)
at WorkspaceSyncObjectMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-object-metadata.service.js:77:72)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:59:47)
at async SyncWorkspaceMetadataCommand.run (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command.js:52:54)
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)
at async CommandRunnerService.run (/app/node_modules/nest-commander/src/command-runner.service.js:196:9)
at async CommandFactory.runApplication (/app/node_modules/nest-commander/src/command.factory.js:37:9)
at async bootstrap (/app/packages/twenty-server/dist/src/command/command.js:29:5)
[Nest] 1007 - 04/24/2024, 2:08:59 PM WARN [SyncWorkspaceMetadataCommand] Workspace contains 2 issues, sync has been forced.
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncMetadataService] Syncing standard objects and fields metadata
[Nest] 1007 - 04/24/2024, 2:08:59 PM LOG [WorkspaceSyncObjectMetadataService] Comparing standard objects and fields metadata
Sync of standard objects failed with: Error: Field pipelineStep not found in originalObjectMetadata
at WorkspaceFieldComparator.compare (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/comparators/workspace-field.comparator.js:139:35)
at WorkspaceSyncObjectMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-object-metadata.service.js:77:72)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:59:47)
at async SyncWorkspaceMetadataCommand.run (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command.js:52:54)
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)
at async CommandRunnerService.run (/app/node_modules/nest-commander/src/command-runner.service.js:196:9)
at async CommandFactory.runApplication (/app/node_modules/nest-commander/src/command.factory.js:37:9)
at async bootstrap (/app/packages/twenty-server/dist/src/command/command.js:29:5)
I'm starting to believe I'm cursed!
charles
charles8mo ago
haha, you are not cursed this sync logic is very complex and we still have a few things to figure out 😄 ok, look for pipelineStep field in your fieldMetadata and just delete it
🅹🅰🆈🅱🅴🅴
These two?
select * from "metadata"."fieldMetadata" where name = 'pipelineStep';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isActive | isSyste
m | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+--------------+---------------+--------------+---------------------------+------------+----------+----------+--------
--+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
28ecc1dd-f375-4952-9bba-c9c2308a4766 | 2edcefcf-8940-4859-ba3e-3f1f968eba02 | RELATION | pipelineStep | Pipeline Step | | Opportunity pipeline step | IconKanban | f | t | f
| t | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.055898+00 | 2024-01-30 11:05:25.055898+00 | |
4a7f48e5-0b55-4fd6-ae07-057f4a756df9 | d8f14e4b-f7c4-4430-9ead-91f920d324b4 | RELATION | pipelineStep | Pipeline Step | | Opportunity pipeline step | IconKanban | f | t | f
| t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
select * from "metadata"."fieldMetadata" where name = 'pipelineStep';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isActive | isSyste
m | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+--------------+---------------+--------------+---------------------------+------------+----------+----------+--------
--+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
28ecc1dd-f375-4952-9bba-c9c2308a4766 | 2edcefcf-8940-4859-ba3e-3f1f968eba02 | RELATION | pipelineStep | Pipeline Step | | Opportunity pipeline step | IconKanban | f | t | f
| t | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.055898+00 | 2024-01-30 11:05:25.055898+00 | |
4a7f48e5-0b55-4fd6-ae07-057f4a756df9 | d8f14e4b-f7c4-4430-9ead-91f920d324b4 | RELATION | pipelineStep | Pipeline Step | | Opportunity pipeline step | IconKanban | f | t | f
| t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
charles
charles8mo ago
yes, pipelineStep is completely deprecated
🅹🅰🆈🅱🅴🅴
fk constraint from "relationMetadata"
charles
charles8mo ago
it should be deleted but the sync script is failing to do it, so let's do it manually please also remove the corresponding relationMetadata I'm trying to reproduce the issue locally
🅹🅰🆈🅱🅴🅴
These two I assume
select * from "metadata"."relationMetadata" where "toFieldMetadataId" in(select id from "metadata"."fieldMetadata" where name = 'pipelineStep') or "toFieldMetadataId" in (select id from "metadata"
."fieldMetadata" where name = 'pipelineStep');
id | relationType | fromObjectMetadataId | toObjectMetadataId | fromFieldMetadataId | toFieldMetadataId
| workspaceId | createdAt | updatedAt | onDeleteAction
--------------------------------------+--------------+--------------------------------------+--------------------------------------+--------------------------------------+-----------------------------------
---+--------------------------------------+-------------------------------+-------------------------------+----------------
99f28241-6d67-479b-b583-854fbd10c50c | ONE_TO_MANY | 24901634-74ea-4b6f-9b5a-1b1a85516989 | 2edcefcf-8940-4859-ba3e-3f1f968eba02 | 2693d294-97c9-4caa-9e47-71136fee85ab | 28ecc1dd-f375-4952-9bba-c9c2308a47
66 | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.21449+00 | 2024-01-30 11:05:25.21449+00 | SET_NULL
1eaf2753-c3e4-474a-a1d7-7c99a8266d56 | ONE_TO_MANY | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | d8f14e4b-f7c4-4430-9ead-91f920d324b4 | fc6e52e9-6368-496c-91a0-833c89955e0c | 4a7f48e5-0b55-4fd6-ae07-057f4a756d
f9 | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.896763+00 | 2024-01-30 11:06:04.896763+00 | SET_NULL
(2 rows)
select * from "metadata"."relationMetadata" where "toFieldMetadataId" in(select id from "metadata"."fieldMetadata" where name = 'pipelineStep') or "toFieldMetadataId" in (select id from "metadata"
."fieldMetadata" where name = 'pipelineStep');
id | relationType | fromObjectMetadataId | toObjectMetadataId | fromFieldMetadataId | toFieldMetadataId
| workspaceId | createdAt | updatedAt | onDeleteAction
--------------------------------------+--------------+--------------------------------------+--------------------------------------+--------------------------------------+-----------------------------------
---+--------------------------------------+-------------------------------+-------------------------------+----------------
99f28241-6d67-479b-b583-854fbd10c50c | ONE_TO_MANY | 24901634-74ea-4b6f-9b5a-1b1a85516989 | 2edcefcf-8940-4859-ba3e-3f1f968eba02 | 2693d294-97c9-4caa-9e47-71136fee85ab | 28ecc1dd-f375-4952-9bba-c9c2308a47
66 | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.21449+00 | 2024-01-30 11:05:25.21449+00 | SET_NULL
1eaf2753-c3e4-474a-a1d7-7c99a8266d56 | ONE_TO_MANY | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | d8f14e4b-f7c4-4430-9ead-91f920d324b4 | fc6e52e9-6368-496c-91a0-833c89955e0c | 4a7f48e5-0b55-4fd6-ae07-057f4a756d
f9 | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.896763+00 | 2024-01-30 11:06:04.896763+00 | SET_NULL
(2 rows)
charles
charles8mo ago
yes!
🅹🅰🆈🅱🅴🅴
same with pipelineStepId? I assumed yes and soldiered on and ran into
Sync of standard objects failed with: Error:
Entity 22426d48-9f33-4f08-8039-14d409186aab not found in oldEntities
at /app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:148:23
at Array.map (<anonymous>)
at WorkspaceMetadataUpdaterService.updateEntities (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:145:57)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceMetadataUpdaterService.updateFieldMetadata (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:86:48)
at async WorkspaceSyncFieldMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-field-metadata.service.js:82:44)
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:61:46)
at async SyncWorkspaceMetadataCommand.run (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command.js:52:54)
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)
Sync of standard objects failed with: Error:
Entity 22426d48-9f33-4f08-8039-14d409186aab not found in oldEntities
at /app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:148:23
at Array.map (<anonymous>)
at WorkspaceMetadataUpdaterService.updateEntities (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:145:57)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WorkspaceMetadataUpdaterService.updateFieldMetadata (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:86:48)
at async WorkspaceSyncFieldMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-field-metadata.service.js:82:44)
at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:61:46)
at async SyncWorkspaceMetadataCommand.run (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command.js:52:54)
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)
so I reset back to before deleting pipelineStepId
charles
charles8mo ago
yes you can delete pipelineStepId too ok, we are close to the end, you are facing issues tied to the latest versions :p does 22426d48-9f33-4f08-8039-14d409186aab correspond to the event object in objectMetadata?
🅹🅰🆈🅱🅴🅴
select * from "metadata"."objectMetadata" where id='22426d48-9f33-4f08-8039-14d409186aab';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | i
sCustom | isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId |
standardId | isRemote | isAuditLogged
--------------------------------------+--------------------------------------+----------------+-----------------+-----------------+------------------+--------------------+--------------+-----------------+--
--------+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------
--------------------------------+----------+---------------
22426d48-9f33-4f08-8039-14d409186aab | 561f60c3-281f-4548-8b98-f1de3e25717e | activityTarget | activityTargets | Activity Target | Activity Targets | An activity target | IconCheckbox | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-04-24 14:35:35.705046+00 | | | 20202
020-2945-440e-8d1a-f84672d33d5e | f | t
(1 row)
select * from "metadata"."objectMetadata" where id='22426d48-9f33-4f08-8039-14d409186aab';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | i
sCustom | isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId |
standardId | isRemote | isAuditLogged
--------------------------------------+--------------------------------------+----------------+-----------------+-----------------+------------------+--------------------+--------------+-----------------+--
--------+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------
--------------------------------+----------+---------------
22426d48-9f33-4f08-8039-14d409186aab | 561f60c3-281f-4548-8b98-f1de3e25717e | activityTarget | activityTargets | Activity Target | Activity Targets | An activity target | IconCheckbox | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-04-24 14:35:35.705046+00 | | | 20202
020-2945-440e-8d1a-f84672d33d5e | f | t
(1 row)
It appears not
charles
charles8mo ago
this one does not look good 😦 I'm unsure what the root cause is Investigating it
🅹🅰🆈🅱🅴🅴
It seems to be related to the issues I began with - upgrading from 0.3.2 to 0.3.3 if you look at first post in this thread
charles
charles8mo ago
I can reproduce locally wonderful
🅹🅰🆈🅱🅴🅴
Btw I now also have a third issue in my workspace
{
"type": "RELATION_METADATA_NOT_VALID",
"message": "Field fc6e52e9-6368-496c-91a0-833c89955e0c has invalid relation metadata"
},
{
"type": "RELATION_METADATA_NOT_VALID",
"message": "Field fc6e52e9-6368-496c-91a0-833c89955e0c has invalid relation metadata"
},
select * from "metadata"."fieldMetadata" where id='fc6e52e9-6368-496c-91a0-833c89955e0c';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isAc
tive | isSystem | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+---------------+---------------+--------------+-----------------------------------+-----------------+----------+-----
-----+----------+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
fc6e52e9-6368-496c-91a0-833c89955e0c | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | RELATION | opportunities | Opportunities | | Opportunities linked to the step. | IconTargetArrow | f | t
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
(1 row)
select * from "metadata"."fieldMetadata" where id='fc6e52e9-6368-496c-91a0-833c89955e0c';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isAc
tive | isSystem | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+---------------+---------------+--------------+-----------------------------------+-----------------+----------+-----
-----+----------+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
fc6e52e9-6368-496c-91a0-833c89955e0c | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | RELATION | opportunities | Opportunities | | Opportunities linked to the step. | IconTargetArrow | f | t
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
(1 row)
charles
charles8mo ago
you can delete this field too ok, I've found the issue, there is a bug in the code 😦
🅹🅰🆈🅱🅴🅴
Wonderful! Time well spent then instead of wasting time on a single user you can help all of them!
charles
charles8mo ago
yes! Future updates will be easier, we are putting some process in place to check smooth upgrades Okay, I'm preparing a bug fix https://github.com/twentyhq/twenty/pull/5154/files ongoing deploy to dockerhub
🅹🅰🆈🅱🅴🅴
Will have to check it tomorrow. Dinner & family time again!
charles
charles8mo ago
ok! have a good night it's out, ping me tomorrow :p
🅹🅰🆈🅱🅴🅴
@charles I now reach 0 issues workspace is healthy. I ran
ALTER TABLE "workspace_6zezc5oiagj6yqldcepfgb226"."workspaceMember" ALTER COLUMN "nameFirstName" SET NOT NULL;
ALTER TABLE "workspace_6zezc5oiagj6yqldcepfgb226"."workspaceMember" ALTER COLUMN "nameLastName" SET NOT NULL;
ALTER TABLE "workspace_6zezc5oiagj6yqldcepfgb226"."workspaceMember" ALTER COLUMN "nameFirstName" SET NOT NULL;
ALTER TABLE "workspace_6zezc5oiagj6yqldcepfgb226"."workspaceMember" ALTER COLUMN "nameLastName" SET NOT NULL;
to correct nullability issues
🅹🅰🆈🅱🅴🅴
Although oppurtunities still seem broken:
No description
charles
charles8mo ago
Great! Ok are the other pages working?
🅹🅰🆈🅱🅴🅴
Yes I realized I had screwed up the delete of pipelinestep, checking what happens when I do that correctly
charles
charles8mo ago
Pipeline step are not used anymore you can get rid of them. I think the issue is with your views dc0937e6-4ec5-438b-9b35-c767633a5bac 2024-04-24 14:16:49.906 2024-04-24 14:16:49.906 false 0.0 IconBuildingSkyscraper INDEX table 929b2053-8bf5-4122-80bf-1cf40e8d73d6 All Companies e91f2452-f4fa-43c6-afae-1b7e82933a01 2024-04-24 14:16:49.906 2024-04-24 14:16:49.906 false 0.0 IconUser INDEX table 3988a475-f6ce-4b58-936a-aca8b5347696 All People 810ac59e-e704-434a-9c92-861feb62d7a3 2024-04-24 14:16:49.906 2024-04-24 14:16:49.906 false 0.0 IconTargetArrow INDEX table dce192b4-a33d-467b-a998-d3b3327b90fc All Opportunities 178327cf-7f9a-474d-8889-3a8c209250a8 2024-04-24 14:16:49.906 2024-04-24 14:16:49.906 false 1.0 40b87690-b1bf-42f1-9efa-11fae55cde62 IconLayoutKanban kanban dce192b4-a33d-467b-a998-d3b3327b90fc By Stage Here are the views you should have in your workspace schema views table INDEX view is the default table view, you should have one for each object then for opportunities we also have a Kanban view (but you can create it manually from the View Picker UI) maybe it's not your problem though, do you see any error on the server when you load the Opportunity page?
🅹🅰🆈🅱🅴🅴
When i delete them "correctly" the app stops working and I only get error:

errors [ {…} ]
0 Object { message: "Error", extensions: {…} }
message "Error"
extensions Object { code: "INTERNAL_SERVER_ERROR", response: "Could not find a relation metadata for fc6e52e9-6368-496c-91a0-833c89955e0c" }

errors [ {…} ]
0 Object { message: "Error", extensions: {…} }
message "Error"
extensions Object { code: "INTERNAL_SERVER_ERROR", response: "Could not find a relation metadata for fc6e52e9-6368-496c-91a0-833c89955e0c" }
charles
charles8mo ago
ok! it means you have a field of type RELATION without a relation tied to it what is the fieldMetadata with id: fc6e52e9-6368-496c-91a0-833c89955e0c ? I think you have only deleted one side of the relation (a relation is currently: a relationMetadata + 1 field RELATION on one side + 1 field RELATION on the other side + 1 field UUID on the other side) these 4 entities come together (this is being refactored to be simplified btw but now it works like this)
🅹🅰🆈🅱🅴🅴
select * from "metadata"."fieldMetadata" where id = 'fc6e52e9-6368-496c-91a0-833c89955e0c';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isAc
tive | isSystem | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+---------------+---------------+--------------+-----------------------------------+-----------------+----------+-----
-----+----------+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
fc6e52e9-6368-496c-91a0-833c89955e0c | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | RELATION | opportunities | Opportunities | | Opportunities linked to the step. | IconTargetArrow | f | t
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
(1 row)
select * from "metadata"."fieldMetadata" where id = 'fc6e52e9-6368-496c-91a0-833c89955e0c';
id | objectMetadataId | type | name | label | defaultValue | description | icon | isCustom | isAc
tive | isSystem | isNullable | workspaceId | createdAt | updatedAt | options | standardId
--------------------------------------+--------------------------------------+----------+---------------+---------------+--------------+-----------------------------------+-----------------+----------+-----
-----+----------+------------+--------------------------------------+-------------------------------+-------------------------------+---------+------------
fc6e52e9-6368-496c-91a0-833c89955e0c | 691b95a6-66a7-4ee4-a688-ad36b8afba48 | RELATION | opportunities | Opportunities | | Opportunities linked to the step. | IconTargetArrow | f | t
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | |
(1 row)
charles
charles8mo ago
ok you should delete this field too is 691b95a6-66a7-4ee4-a688-ad36b8afba48 the pipelineStep object? If yes, let's delete it too
🅹🅰🆈🅱🅴🅴
deleting fc.. and
select * from "metadata"."objectMetadata" where id='691b95a6-66a7-4ee4-a688-ad36b8afba48';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | isCustom
| isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | standardId |
isRemote | isAuditLogged
--------------------------------------+--------------------------------------+--------------+---------------+---------------+----------------+-----------------+------------------+-----------------+---------
-+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------------+
----------+---------------
691b95a6-66a7-4ee4-a688-ad36b8afba48 | 561f60c3-281f-4548-8b98-f1de3e25717e | pipelineStep | pipelineSteps | Pipeline Step | Pipeline Steps | A pipeline step | IconLayoutKanban | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | | | |
f | t
(1 row)
select * from "metadata"."objectMetadata" where id='691b95a6-66a7-4ee4-a688-ad36b8afba48';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | isCustom
| isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | standardId |
isRemote | isAuditLogged
--------------------------------------+--------------------------------------+--------------+---------------+---------------+----------------+-----------------+------------------+-----------------+---------
-+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------------+
----------+---------------
691b95a6-66a7-4ee4-a688-ad36b8afba48 | 561f60c3-281f-4548-8b98-f1de3e25717e | pipelineStep | pipelineSteps | Pipeline Step | Pipeline Steps | A pipeline step | IconLayoutKanban | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-01-30 11:06:04.790685+00 | | | |
f | t
(1 row)
With the app-error persisting. Should I sync metadata? This still remains:
select * from "metadata"."objectMetadata" where "nameSingular" like 'pipe%';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | isCustom
| isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | standardId |
isRemote | isAuditLogged
--------------------------------------+--------------------------------------+--------------+---------------+---------------+----------------+-----------------+------------------+-----------------+---------
-+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------------+
----------+---------------
24901634-74ea-4b6f-9b5a-1b1a85516989 | 6508cf70-6c00-44c2-8faf-b7cf1a18eb3b | pipelineStep | pipelineSteps | Pipeline Step | Pipeline Steps | A pipeline step | IconLayoutKanban | DEPRECATED | f
| t | t | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.055898+00 | 2024-01-30 11:05:25.055898+00 | | | |
f | t
select * from "metadata"."objectMetadata" where "nameSingular" like 'pipe%';
id | dataSourceId | nameSingular | namePlural | labelSingular | labelPlural | description | icon | targetTableName | isCustom
| isActive | isSystem | workspaceId | createdAt | updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | standardId |
isRemote | isAuditLogged
--------------------------------------+--------------------------------------+--------------+---------------+---------------+----------------+-----------------+------------------+-----------------+---------
-+----------+----------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------+--------------------------------+------------+
----------+---------------
24901634-74ea-4b6f-9b5a-1b1a85516989 | 6508cf70-6c00-44c2-8faf-b7cf1a18eb3b | pipelineStep | pipelineSteps | Pipeline Step | Pipeline Steps | A pipeline step | IconLayoutKanban | DEPRECATED | f
| t | t | 20202020-1c25-4d02-bf25-6aeccf7ea419 | 2024-01-30 11:05:25.055898+00 | 2024-01-30 11:05:25.055898+00 | | | |
f | t
deleting as well Now it loads the page but no data - still the same fc.. error
charles
charles8mo ago
the other pipelinestep is for the dev workspace (you can completely remove this workspace btw) what does fc stands for?
🅹🅰🆈🅱🅴🅴
fc6e52e9-6368-496c-91a0-833c89955e0c
charles
charles8mo ago
oh sorry ok, so we have a schema cache mechanism please bump the version in metadata.workspaceCacheVersion
🅹🅰🆈🅱🅴🅴
Done sneaky to have version as varchar!
charles
charles8mo ago
good point 🙂 ok, is it working now?
🅹🅰🆈🅱🅴🅴
Sadly not Or wait. Yes
🅹🅰🆈🅱🅴🅴
I was able to create new views but the locked one is still broken. Can I get rid of the locked one? no error messages regarding fc6.. anymore though so it might be something else that's preventing the view from being shown?
🅹🅰🆈🅱🅴🅴
This is the only error I can see from client perspective If I reload the page server logs show:
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 341.59479400515556 ms on query favorite
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 346.6131579875946 ms on query view
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 400.27810499072075 ms on query activity
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 163.26290801167488 ms on query opportunity
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 31.195706009864807 ms on query opportunity
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 341.59479400515556 ms on query favorite
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 346.6131579875946 ms on query view
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 400.27810499072075 ms on query activity
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 163.26290801167488 ms on query opportunity
[Nest] 1 - 04/25/2024, 11:29:11 AM LOG [WorkspaceQueryRunnerService] query time: 31.195706009864807 ms on query opportunity
charles
charles8mo ago
could you delete the new ones and share your workspace view and viewField tables?
🅹🅰🆈🅱🅴🅴
id,createdAt,updatedAt,deletedAt,type,objectMetadataId,name,isCompact,icon,kanbanFieldMetadataId,key,position
1c70221c-aa10-44b5-a4bc-171e681af1f8,2024-01-30 11:06:05.866744+00,2024-01-30 11:06:05.866744+00,,kanban,d8f14e4b-f7c4-4430-9ead-91f920d324b4,All Opportunities,f,"","",INDEX,
2cb4fc98-b9b7-4cf1-b791-05b37cf5c0ff,2024-01-30 11:08:00.500991+00,2024-01-30 11:08:00.500991+00,,table,e5d784ce-c7c3-4d30-b71a-5f5d7e5f355f,All keys,f,"","",INDEX,
65318d72-8f45-4a98-8e57-effcdb0d088e,2024-01-30 11:06:05.866744+00,2024-02-07 14:01:32.521+00,,table,fcd78518-45cb-41e1-b8ef-a1b883681f98,All People,f,"","",INDEX,
fac418f9-a9e1-48fd-9eae-77951a873c67,2024-01-30 11:06:05.866744+00,2024-02-11 20:23:45.149+00,,table,aefad139-13d4-44b8-8338-5f5fb5652343,All Companies,f,"","",INDEX,
id,createdAt,updatedAt,deletedAt,type,objectMetadataId,name,isCompact,icon,kanbanFieldMetadataId,key,position
1c70221c-aa10-44b5-a4bc-171e681af1f8,2024-01-30 11:06:05.866744+00,2024-01-30 11:06:05.866744+00,,kanban,d8f14e4b-f7c4-4430-9ead-91f920d324b4,All Opportunities,f,"","",INDEX,
2cb4fc98-b9b7-4cf1-b791-05b37cf5c0ff,2024-01-30 11:08:00.500991+00,2024-01-30 11:08:00.500991+00,,table,e5d784ce-c7c3-4d30-b71a-5f5d7e5f355f,All keys,f,"","",INDEX,
65318d72-8f45-4a98-8e57-effcdb0d088e,2024-01-30 11:06:05.866744+00,2024-02-07 14:01:32.521+00,,table,fcd78518-45cb-41e1-b8ef-a1b883681f98,All People,f,"","",INDEX,
fac418f9-a9e1-48fd-9eae-77951a873c67,2024-01-30 11:06:05.866744+00,2024-02-11 20:23:45.149+00,,table,aefad139-13d4-44b8-8338-5f5fb5652343,All Companies,f,"","",INDEX,
🅹🅰🆈🅱🅴🅴
it actually gets the correct amount of rows from opportunity though. Just fails to show them "5" in this case
select v.id as "ViewId", vf.id as "ViewFieldId", vf."fieldMetadataId" as "FieldMetaDataId", fm.name from "workspace_6zezc5oiagj6yqldcepfgb226"."view" v join "workspace_6zezc5oiagj6yqldcepfgb226"."viewField" vf on v.id=vf."viewId" join "metadata"."fieldMetadata" fm on vf."fieldMetadataId" = fm.id where v.name='All Opportunities'
;
ViewId | ViewFieldId | FieldMetaDataId | name
--------------------------------------+--------------------------------------+--------------------------------------+----------------
1c70221c-aa10-44b5-a4bc-171e681af1f8 | d6f497b6-f9a4-4bc2-b4ad-e122a105a3a3 | 073bacc3-3c63-48a8-b0d9-f20a0b673f8b | probability
1c70221c-aa10-44b5-a4bc-171e681af1f8 | 0224b918-30d3-4585-8a14-14b171e2317f | 247d7449-3f56-4503-bd42-ef27cad72edf | amount
1c70221c-aa10-44b5-a4bc-171e681af1f8 | df9ceb4f-edd8-4297-912e-726795421f35 | c8cdad06-1abf-42bc-a4a2-5fcb1f12805c | pointOfContact
1c70221c-aa10-44b5-a4bc-171e681af1f8 | e22e02bd-b6d6-4d27-95ea-252b5e3e491d | 88c4d59c-3f28-4ade-be79-1e4012639753 | closeDate
select v.id as "ViewId", vf.id as "ViewFieldId", vf."fieldMetadataId" as "FieldMetaDataId", fm.name from "workspace_6zezc5oiagj6yqldcepfgb226"."view" v join "workspace_6zezc5oiagj6yqldcepfgb226"."viewField" vf on v.id=vf."viewId" join "metadata"."fieldMetadata" fm on vf."fieldMetadataId" = fm.id where v.name='All Opportunities'
;
ViewId | ViewFieldId | FieldMetaDataId | name
--------------------------------------+--------------------------------------+--------------------------------------+----------------
1c70221c-aa10-44b5-a4bc-171e681af1f8 | d6f497b6-f9a4-4bc2-b4ad-e122a105a3a3 | 073bacc3-3c63-48a8-b0d9-f20a0b673f8b | probability
1c70221c-aa10-44b5-a4bc-171e681af1f8 | 0224b918-30d3-4585-8a14-14b171e2317f | 247d7449-3f56-4503-bd42-ef27cad72edf | amount
1c70221c-aa10-44b5-a4bc-171e681af1f8 | df9ceb4f-edd8-4297-912e-726795421f35 | c8cdad06-1abf-42bc-a4a2-5fcb1f12805c | pointOfContact
1c70221c-aa10-44b5-a4bc-171e681af1f8 | e22e02bd-b6d6-4d27-95ea-252b5e3e491d | 88c4d59c-3f28-4ade-be79-1e4012639753 | closeDate
charles
charles8mo ago
okay, make the INDEX All opportunities view a 'table' instead of a 'kanban' in the db! (when you have a kanban view, you need to specifiy the kanbanFieldMetadataId too)
🅹🅰🆈🅱🅴🅴
Can I change the default view to be kanban again or should I leave it as table? (can just create a kanban view I guess?)
charles
charles8mo ago
leave it as a table and you can create a kanban view (which should not be INDEX) INDEX view are meant to be used as a default views to show related records from the show page of a specific record, we want it to always be a table
🅹🅰🆈🅱🅴🅴
Not sure when it appeared but now I have a
"type": "COLUMN_DATA_TYPE_CONFLICT",
"fieldMetadata": {
"id": "28fcd688-a94f-4b0b-bef0-271869a60a26",
"standardId": "20202020-56a1-4f7e-9880-a8493bb899cc",
"objectMetadataId": "12600bf0-52c7-45e2-96d7-a128932c8f79",
"type": "SELECT",
"name": "syncStatus",
"type": "COLUMN_DATA_TYPE_CONFLICT",
"fieldMetadata": {
"id": "28fcd688-a94f-4b0b-bef0-271869a60a26",
"standardId": "20202020-56a1-4f7e-9880-a8493bb899cc",
"objectMetadataId": "12600bf0-52c7-45e2-96d7-a128932c8f79",
"type": "SELECT",
"name": "syncStatus",
🅹🅰🆈🅱🅴🅴
Is this an issue?
🅹🅰🆈🅱🅴🅴
I'm running version v0.10.2 but it reports as 0.4.0
No description
🅹🅰🆈🅱🅴🅴
image running: twentycrm/twenty:v0.10.2 This might just be an issue with your v0.10.x release though
charles
charles8mo ago
interesting :p that's OK, it's a false positive we have!
🅹🅰🆈🅱🅴🅴
In addition all tasks have lost the relations Or rather it seems to not load it correctly If I check tasks -> select person assigned it loads without any relations. But if I go into the opportunity first so it loads tasks that way they are filled in with which opportunity they are connected I know I saw 0.10.0 before upgrading to 0.10.1 or 0.10.2
charles
charles8mo ago
I'll patch that in v0.10.3 tomorrow
🅹🅰🆈🅱🅴🅴
Is this a known issue or something wrong with my migration/upgrade? Couldnt find any in github when I looked atleast
charles
charles8mo ago
I can reproduce it on my environment. It's a bug that has been recently introduced, we will patch it tomorrow not related to your setup 🙂
🅹🅰🆈🅱🅴🅴
Excellent
charles
charles8mo ago
This was a bit painful 😄 but a lot of learnings thanks for going through this
🅹🅰🆈🅱🅴🅴
Our sales team is extremely happy with the application as of now so any kind of migration issue is just meh as compared to the clunkyness of all other crm options we have tried
charles
charles8mo ago
It should only get better 🙂 I'll ping you once the Tasks bug is fixed
🅹🅰🆈🅱🅴🅴
Clunkyness of migration ends up in IT team which happens to like troubleshooting so yay me I guess
charles
charles8mo ago
I'm releasing v0.10.4 with the Task fix 🙂
🅹🅰🆈🅱🅴🅴
Ah that looks better! 👍 I am getting logged out somewhat quickly though with (10-30 minutes maybe, havent tested exactly):
[Nest] 1 - 04/30/2024, 11:31:09 AM ERROR [UserWorkspaceMiddleware] Error while validating token in middleware.
[Nest] 1 - 04/30/2024, 11:31:09 AM ERROR [UserWorkspaceMiddleware] UnauthorizedException: Token has expired.
[Nest] 1 - 04/30/2024, 11:31:09 AM ERROR [UserWorkspaceMiddleware] Error while validating token in middleware.
[Nest] 1 - 04/30/2024, 11:31:09 AM ERROR [UserWorkspaceMiddleware] UnauthorizedException: Token has expired.
In the log. Unclear if it's an issue in my configuration or something more general Is it possible to turn on more verbose logging?
charles
charles8mo ago
yes we have issue with the refreshToken you can set your ACCESS_TOKEN_EXPIRE_IN to a longer time
🅹🅰🆈🅱🅴🅴
I have tried to codify all the steps we took to be able to replicate it on live but either I missed something or something is still not right: getting
"error: error: duplicate key value violates unique constraint \"IndexOnNameObjectMetadataIdAndWorkspaceIdUnique\"
"error: error: duplicate key value violates unique constraint \"IndexOnNameObjectMetadataIdAndWorkspaceIdUnique\"
🅹🅰🆈🅱🅴🅴
driverError: error: duplicate key value violates unique constraint \"IndexOnNameObjectMetadataIdAndWorkspaceIdUnique\"",
" at /app/node_modules/pg/lib/client.js:526:17",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)",
" at async InsertQueryBuilder.execute (/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)",
" at async SubjectExecutor.executeInsertOperations (/app/node_modules/typeorm/persistence/SubjectExecutor.js:260:42)",
" at async SubjectExecutor.execute (/app/node_modules/typeorm/persistence/SubjectExecutor.js:92:9)",
" at async EntityPersistExecutor.execute (/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21)",
" at async WorkspaceMetadataUpdaterService.updateFieldMetadata (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:83:48)",
" at async WorkspaceSyncFieldMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-field-metadata.service.js:82:44)",
" at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:61:46) {",
" length: 378,",
" severity: 'ERROR',",
" code: '23505',",
" detail: 'Key (name, \"objectMetadataId\", \"workspaceId\")=(id, 22426d48-9f33-4f08-8039-14d409186aab, 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e) already exists.',",
driverError: error: duplicate key value violates unique constraint \"IndexOnNameObjectMetadataIdAndWorkspaceIdUnique\"",
" at /app/node_modules/pg/lib/client.js:526:17",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)",
" at async InsertQueryBuilder.execute (/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)",
" at async SubjectExecutor.executeInsertOperations (/app/node_modules/typeorm/persistence/SubjectExecutor.js:260:42)",
" at async SubjectExecutor.execute (/app/node_modules/typeorm/persistence/SubjectExecutor.js:92:9)",
" at async EntityPersistExecutor.execute (/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21)",
" at async WorkspaceMetadataUpdaterService.updateFieldMetadata (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.js:83:48)",
" at async WorkspaceSyncFieldMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-sync-field-metadata.service.js:82:44)",
" at async WorkspaceSyncMetadataService.synchronize (/app/packages/twenty-server/dist/src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.service.js:61:46) {",
" length: 378,",
" severity: 'ERROR',",
" code: '23505',",
" detail: 'Key (name, \"objectMetadataId\", \"workspaceId\")=(id, 22426d48-9f33-4f08-8039-14d409186aab, 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e) already exists.',",
Should this be deleted as well?
select * from "metadata"."objectMetadata" where id ='22426d48-9f33-4f08-8039-14d409186aab';
id | dataSourceId | nameSingular | namePlur
al | labelSingular | labelPlural | description | icon | targetTableName | isCusto
m | isActive | isSystem | workspaceId | createdAt |
updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | stan
dardId | isRemote | isAuditLogged
--------------------------------------+--------------------------------------+----------------+-----------
------+-----------------+------------------+--------------------+--------------+-----------------+--------
--+----------+----------+--------------------------------------+-------------------------------+----------
---------------------+--------------------------------+--------------------------------+------------------
--------------------+----------+---------------
22426d48-9f33-4f08-8039-14d409186aab | 561f60c3-281f-4548-8b98-f1de3e25717e | activityTarget | activityTa
rgets | Activity Target | Activity Targets | An activity target | IconCheckbox | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-05-0
3 08:34:52.202422+00 | | | 20202020-2945-440
e-8d1a-f84672d33d5e | f | t
(1 row)
select * from "metadata"."objectMetadata" where id ='22426d48-9f33-4f08-8039-14d409186aab';
id | dataSourceId | nameSingular | namePlur
al | labelSingular | labelPlural | description | icon | targetTableName | isCusto
m | isActive | isSystem | workspaceId | createdAt |
updatedAt | labelIdentifierFieldMetadataId | imageIdentifierFieldMetadataId | stan
dardId | isRemote | isAuditLogged
--------------------------------------+--------------------------------------+----------------+-----------
------+-----------------+------------------+--------------------+--------------+-----------------+--------
--+----------+----------+--------------------------------------+-------------------------------+----------
---------------------+--------------------------------+--------------------------------+------------------
--------------------+----------+---------------
22426d48-9f33-4f08-8039-14d409186aab | 561f60c3-281f-4548-8b98-f1de3e25717e | activityTarget | activityTa
rgets | Activity Target | Activity Targets | An activity target | IconCheckbox | DEPRECATED | f
| t | t | 75f6e77a-ec52-43fd-af2b-5e1ca8319b2e | 2024-01-30 11:06:04.790685+00 | 2024-05-0
3 08:34:52.202422+00 | | | 20202020-2945-440
e-8d1a-f84672d33d5e | f | t
(1 row)
(I assume 0.10.6 does not fix it but I'm testing that right now instead of 0.10.4) It actually did fix it should have waited before speaking
charles
charles8mo ago
yes, I have been troubleshooting with @iero too and added fixes to v0.10.6 next upgrades will be way smoother I promise
🅹🅰🆈🅱🅴🅴
Thank you for running ahead of me @iero !
greg [iero]
greg [iero]8mo ago
I have the same problem in 0.10.6. I setup a '1d' limit for ACCESS_TOKEN_EXPIRE_IN but same thing
charles
charles8mo ago
we use 7d on the cloud for now FYI, it should not cause too much issue the best practice is to have something like ~30min and to leverage the refresh token, we are working on it too regarding the error above, is it another workspace on on the same? I thought your workspace was fully functional when we worked on it? If you want, we can schedule a voice session to fix your issue on Monday
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
greg [iero]
greg [iero]8mo ago
I forced those (default) parameters in docker-compose.yaml:
services:
server:
environment:
ACCESS_TOKEN_EXPIRES_IN: 30m
REFRESH_TOKEN_EXPIRES_IN: 90d
services:
server:
environment:
ACCESS_TOKEN_EXPIRES_IN: 30m
REFRESH_TOKEN_EXPIRES_IN: 90d
Restarted using docker-compose up --build -d So far it seems to work. I have to refresh the page but I stay connected
Want results from more Discord servers?
Add your server