T
Twenty2d ago
Ferdi

Error during upgrade - Field of type RELATION is a many to one relation but does not have a join col

Hi community! During another attempt to upgrade my Twenty instance, I got stuck at the error described in https://github.com/twentyhq/twenty/issues/14896. Any ideas how to resolve this?
18 Replies
Prastoin
Prastoin2d ago
Hey @Ferdi, could you please share your workspace version in database located at core.workspace.version ?
Ferdi
FerdiOP2d ago
It's 0.53.0
Prastoin
Prastoin2d ago
Please make sure to have a backup of a functional db dump Please try running
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
an re-attempt 0.53.6 upgrade ( not 0.54 ) lets try fixing your instance on 0.53 first
Ferdi
FerdiOP2d ago
0.53.6 does not exist (as a Docker image), do you mean 0.53.8 ? Running the command you suggested yields:
ERROR [MigrateRelationsToFieldMetadataCommand] Error in workspace edd7b1fd-3e21-49ea-aeaf-cb5d3be614ca: relation "metadata.objectMetadata" does not exist
ERROR [MigrateRelationsToFieldMetadataCommand] Error in workspace edd7b1fd-3e21-49ea-aeaf-cb5d3be614ca: relation "metadata.objectMetadata" does not exist
Prastoin
Prastoin2d ago
are you re-using an instance that you attempted to upgrade to an higher non incremental version ?
Ferdi
FerdiOP2d ago
It's the same instance that I previously (yesterday) move from 0.53.0 to 0.54.6.
Prastoin
Prastoin2d ago
What version are you currently running commands on ?
Ferdi
FerdiOP2d ago
0.53.0
Prastoin
Prastoin2d ago
Has your 0.53 instance been healthy/working before ?
Ferdi
FerdiOP2d ago
Yes
Prastoin
Prastoin2d ago
I assume you've: ( on same pg instance ) 0.53.0 -> 0.54.6 0.54.6 -> 0.53.6 0.53.6 -> 0.53.0 Please try going back to 0.54.6 and running
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
yarn command:prod upgrade:0-52:migrate-relations-to-field-metadata
Ferdi
FerdiOP2d ago
Same error. What I now did though is: - Drop database and load clean backup corresponding to (non-upgraded) state at 0.53.0 - Run the command you sent - Upgrade to 0.53.8 -> was successful Now I tried to go to 0.54.6 and am getting a new error now:
QueryFailedError: column viewFilter.subFieldName does not exist
QueryFailedError: column viewFilter.subFieldName does not exist
Prastoin
Prastoin2d ago
Ok cool checking please try running
yarn command:prod workspace:sync-metadata
yarn command:prod workspace:sync-metadata
Ferdi
FerdiOP2d ago
No description
Ferdi
FerdiOP2d ago
Does this error tell you anything? Gotta bounce now, will get back here later today. Thanks a lot for your support already!
Prastoin
Prastoin2d ago
Unfortunately on mobile atm ! Will investigate tomorrow in what db migrations is introduced this column Latest attempt could be running an
yarn database:migrate:prod
yarn database:migrate:prod
No worries !
Ferdi
FerdiOP2d ago
Didn't help, unfortunately.
Prastoin
Prastoin2d ago
Ok I will reach back with further information

Did you find this page helpful?