T
Twenty2mo 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?
30 Replies
Prastoin
Prastoin2mo ago
Hey @Ferdi, could you please share your workspace version in database located at core.workspace.version ?
Ferdi
FerdiOP2mo ago
It's 0.53.0
Prastoin
Prastoin2mo 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
FerdiOP2mo 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
Prastoin2mo ago
are you re-using an instance that you attempted to upgrade to an higher non incremental version ?
Ferdi
FerdiOP2mo ago
It's the same instance that I previously (yesterday) move from 0.53.0 to 0.54.6.
Prastoin
Prastoin2mo ago
What version are you currently running commands on ?
Ferdi
FerdiOP2mo ago
0.53.0
Prastoin
Prastoin2mo ago
Has your 0.53 instance been healthy/working before ?
Ferdi
FerdiOP2mo ago
Yes
Prastoin
Prastoin2mo 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
FerdiOP2mo 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
Prastoin2mo ago
Ok cool checking please try running
yarn command:prod workspace:sync-metadata
yarn command:prod workspace:sync-metadata
Ferdi
FerdiOP2mo ago
No description
Ferdi
FerdiOP2mo ago
Does this error tell you anything? Gotta bounce now, will get back here later today. Thanks a lot for your support already!
Prastoin
Prastoin2mo 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
FerdiOP2mo ago
Didn't help, unfortunately.
Prastoin
Prastoin2mo ago
Ok I will reach back with further information Hey @Ferdi, nothing new on your side ? I can take some time tomorrow to dig if still an issue
Ferdi
FerdiOP2mo ago
Hi @prastoin, yes, unfortunately I did not manage to resolve the issue in the mean while. Neither of the command you sent seem to have helped. Would be super thankful if you could have another look into it!
Prastoin
Prastoin2mo ago
Hey could you please share the context around the QueryFailedError: column viewFilter.subFieldName does not exist
Ferdi
FerdiOP2mo ago
Sorry for the late reply, have been busy 😐 Here you go: https://paste.dismail.de/?a0da3f8abb77de24#7o7sDFCUtFVUkESmSBtsXG4icSvNLEsTcxX6r5bfooCL Hope that helps! Does it? 🙂
Prastoin
Prastoin2mo ago
Unfortunately there's still not the logger name in the shared log Can't if it comes from the upgrade command or classic api usage Though manual sync metadata and migrations run should be enough here
Ferdi
FerdiOP2mo ago
The error occurs when I open my Twenty instance in the browser. Running sync-metadata or upgrade commands both yield this error: https://paste.dismail.de/?90163cf5dd05dea8#FzBMTRrL4MEag6ywRyWn881zbFD8JwjFysp1UJF8SSYP.
Prastoin
Prastoin2mo ago
Hey @Ferdi I think the easiest would be to setup a call so we can sync our schedule and handle the migration together I'm free tomorrow CEST 4pm for 45 mins
Ferdi
FerdiOP2mo ago
Sorry, didn't check Discord recently. I'd be available tomorrow between 9 am and 2 pm CEST
Prastoin
Prastoin2mo ago
Hey, would you be available on next monday 2pm CEST ?
Ferdi
FerdiOP2mo ago
Unfortunately no. Are you available on Friday somewhere between 9 am and 2.30 pm?
Prastoin
Prastoin2mo ago
yep lets book friday 11am CEST Is that ok for you ?
Ferdi
FerdiOP2mo ago
Sure, please send me a calendar invite to ferdinand@muetsch.io Hey man, are you there?
Prastoin
Prastoin2mo ago
Hey so sorry @Ferdi I was in a tunnel wasn't aware of time I can definitly create a timebox for you during the afternoon please let me know Sent a friend request please feel free to dm me, will receive notification

Did you find this page helpful?