T
Twenty2w ago
John

Failed upgrade from 0.52 to 0.53, Error: Join column name is not defined

I attempted to upgrade to 0.53 this morning and recieved the following error. I needed to roll back as I was unable to log in. server-1 | Exception Captured server-1 | { user: undefined, workspace: undefined } server-1 | [ server-1 | Error: Join column name is not defined server-1 | at generateFields (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/utils/generate-fields.utils.js:40:23) server-1 | at ObjectTypeDefinitionFactory.create (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/factories/object-type-definition.factory.js:47:65) server-1 | at /app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/type-definitions.generator.js:94:112 server-1 | at Array.map (<anonymous>) server-1 | at TypeDefinitionsGenerator.generateObjectTypeDefs (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/type-definitions.generator.js:94:57) server-1 | at TypeDefinitionsGenerator.generateMetadataTypeDefs (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/type-definitions.generator.js:88:14) server-1 | at TypeDefinitionsGenerator.generate (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/type-definitions.generator.js:38:20) server-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) server-1 | at async WorkspaceGraphQLSchemaFactory.create (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema-builder/workspace-graphql-schema.factory.js:29:9) server-1 | at async WorkspaceSchemaFactory.createGraphQLSchema (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-schema.factory.js:79:41) server-1 | ]
24 Replies
John
JohnOP2w ago
Upon rolling back the application appears to be working per usual although I capture the following exception upon rolling back: [ TwentyORMException [Error]: User workspace role map not found after recompute for workspace 0f714868-4a83-4ea0-8967-d6f0b452e9f3 at getFromCacheWithRecompute (/app/packages/twenty-server/dist/src/engine/utils/get-data-from-cache-with-recompute.util.js:25:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async UserRoleService.getRoleIdForUserWorkspace (/app/packages/twenty-server/dist/src/engine/metadata-modules/user-role/user-role.service.js:63:38) at async GraphqlQueryFindManyResolverService.execute (/app/packages/twenty-server/dist/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.js:62:28) at async Object.favoriteFolders (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-resolver-builder/factories/find-many-resolver.factory.js:33:20) at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42) at async /app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35 at async Promise.all (index 0) { code: 'USER_WORKSPACE_ROLE_MAP_VERSION_NOT_FOUND' } ]
Prastoin
Prastoin2w ago
Hey @John Could you please describe what operation you've done ? First log should be resolved by refreshing your browser and second log looks like either a cache desyncho or a missing upgrade from 0.44
John
JohnOP2w ago
- First I upgraded from 0.52 -> 0.53. This generated the first log. Refreshing didn't fix the issue, though I can try testing again. - Second I rolled back the upgrade by changing the version tag back which created the above error
Prastoin
Prastoin2w ago
Unfortunately the only way to rollback is restoring a backup we do not maintain downgrading Please restore to a previous backup and inspect your workspace version, and share it there
John
JohnOP2w ago
No description
John
JohnOP2w ago
From the upgrade guide, I don't believe there should be any issues migrating from 0.52 to 0.53, correct?
Prastoin
Prastoin2w ago
There's this documented knonw issue in the upgrade guide
Prastoin
Prastoin2w ago
No description
Prastoin
Prastoin2w ago
Yours looks like to be at 0.52.1 which is problematic Please refer to the documentation or this thread where we described how to proceed ( see first message ) https://discord.com/channels/1130383047699738754/1371872441449844787 Sorry for the inconvenience Feel free to reach out in case you face any blocking point
John
JohnOP2w ago
Just to make sure I am following the above thread correctly, if 'SELECT version from core.workspace;' returns 0.51.0, then I am good to pull 0.52.11 and upgrade?
Prastoin
Prastoin2w ago
Yes ( to the edited message ) Please store migrate and upgrade commands logs and share if you encounter any errors while upgrading from 0.51 to 0.52.11 And double check workspace.version gets updated after each upgrade is always safer
John
JohnOP2w ago
Hmmm.... I am still encountering an error...
John
JohnOP2w ago
Prastoin
Prastoin2w ago
This means you haven't run the 0.52 upgrade successfully What does your workspace version says ? Just to double check, you're using our official twenty image from docker huh or building a custom one ?
John
JohnOP2w ago
Official image. The workspace says v0.52.11 in the db and the admin panel
Prastoin
Prastoin2w ago
Regarding your upgrade process everything seems fine, for some reason your workflow object model does not seem to have been migrated using the 0.52 upgrade command Could you please try running this command in your 0.53 twenty-server ? ( atomic versions commands are available across versions )
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
And re-attempt the migrate + upgrade
John
JohnOP2w ago
🥳 🥳 🥳
No description
No description
John
JohnOP2w ago
Odd that the above migration was missed for some reason. Is there any way to check which other migration commands may have been missed (I assume the answer is no since the DB thought that command had already been run)?
Prastoin
Prastoin2w ago
Hey John ! Glad to hear your issue has been resolved ! Run commands are not stored in database only database migrations This is the only other one command from 0.52 upgrade upgrade:0-52:upgrade-date-and-date-time-field-settings ( you should be able to check if it has been run by looking at your field metadata date database definition displayFormat value )
export enum DateDisplayFormat {
RELATIVE = 'RELATIVE',
USER_SETTINGS = 'USER_SETTINGS',
CUSTOM = 'CUSTOM',
}
export enum DateDisplayFormat {
RELATIVE = 'RELATIVE',
USER_SETTINGS = 'USER_SETTINGS',
CUSTOM = 'CUSTOM',
}
Or just run it one more time, usually commands are idempotent
yarn command:prod upgrade:0-52:upgrade-date-and-date-time-field-settings
yarn command:prod upgrade:0-52:upgrade-date-and-date-time-field-settings
Prastoin
Prastoin2w ago
Be careful the current version might be different than your workspace version ( we should display in the front in case the current workspace does not match the current app version cc @Félix )
No description
John
JohnOP2w ago
May not be clear above, but the first screenshot is postico which shows 0.53.8 in the core.workspace table. Is there somewhere else I should be looking in the db?
Prastoin
Prastoin2w ago
Ah sorry ! haven't zoomed in the first screen Congrats ! you've succesfully migrated to 0.53.8 !
John
JohnOP2w ago
Ty, lemme know if there are any other logs you need if triangulating this with other issues
Prastoin
Prastoin2w ago
Thanks ! Will let you know in case !

Did you find this page helpful?