T
Twenty5w ago
Rob

v0.33.3: TypeError: Cannot read properties of undefined (reading 'fieldMetadataId')

Congratulations on the 0.33 release. I am excited to use the multi select filter! I upgraded with no issues, following the insturctions at https://github.com/twentyhq/twenty/blob/main/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx#v0320-to-v0330 there were no errors in my update log. After upgrading the API interface works. However, in the web interface I am geting the error TypeError: Cannot read properties of undefined (reading 'fieldMetadataId') Has anyone else experienced this (@ɃØĦɆᵾS )? Does anyone know what might have gone wrong and how i can fix it? Thanks!
GitHub
twenty/packages/twenty-website/src/content/developers/self-hosting/...
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty
No description
24 Replies
ɃØĦɆᵾS
ɃØĦɆᵾS5w ago
Oh, I experienced that one I resolved this by simply restarting database since I don't have any important data
Rob
RobOP5w ago
Thanks. Unfortunately I have a years worth of data to protect 🙂 I launced an issue, thanks. https://github.com/twentyhq/twenty/issues/8693
GitHub
fieldMetadataId error after upgrading to v0.33.3 · Issue #8693 · tw...
Bug Description Congratulations on the 0.33 release. I am excited to use the multi select filter! I upgraded with no issues, following the insturctions at https://github.com/twentyhq/twenty/blob/ma...
ɃØĦɆᵾS
ɃØĦɆᵾS5w ago
That's understandable
Rob
RobOP5w ago
thanks for confirming mate
ɃØĦɆᵾS
ɃØĦɆᵾS5w ago
I'll try to reproduce it somehow, tbh didn't bother with reporting it as I thought it's something on my side No problem
Weiko
Weiko5w ago
Hi @Rob something went wrong with the upgrade command most likely. Do you have access to the DB? Can you check if you have any viewField rows that have a viewId as null?
Rob
RobOP5w ago
will look now! should i look in any table in particular?
Weiko
Weiko5w ago
you should look at your workspace schema (the one starting with workspace_*) and the viewField table
Rob
RobOP5w ago
thanks. And for your records/debugging, here the update log
Rob
RobOP5w ago
@Weiko you were correct, many rows have viewid as null
No description
Rob
RobOP5w ago
any suggestions how to fix this?
Weiko
Weiko5w ago
Ok. This is from legacy code and we clearly missed that, viewFields should always be linked to views by now and should have been for a while. Because of this, the "EnforceUniqueConstraints" step in the 0.33 upgrade messed up your table. As you can see, the command interpreted all your viewFields as duplicates and soft deleted them (deletedAt is not NULL). I'd suggest you restore those by updating the "deletedAt" colomn to NULL for all those records and your page should load again
Rob
RobOP5w ago
thanks for the insight! how can i set all the deletedAt column to NULL? Do we need to fill in the viewID column with data and not Nulls?
Weiko
Weiko5w ago
UPDATE "YOUR_SCHEMA"."viewField" SET "deletedAt"=NULL;
UPDATE "YOUR_SCHEMA"."viewField" SET "deletedAt"=NULL;
should be good
Rob
RobOP5w ago
and YOURSCHEMA would be "workspace_6irr16qioalagnvc5ffeneuhx" in this situtaion?
ɃØĦɆᵾS
ɃØĦɆᵾS5w ago
Yes
Weiko
Weiko5w ago
Yes 🙂 No actually that's the issue, they shouldn't be there in the first place, I suggest you delete them. I guess you won't be the only one affected, we need to land a patch with a command that should sanitize the table before the EnforceUniqueConstraints step
Rob
RobOP5w ago
So i should delete the column somehow?
ɃØĦɆᵾS
ɃØĦɆᵾS5w ago
Just null all records
Rob
RobOP5w ago
null the viewwID records too?
Weiko
Weiko5w ago
Let's not delete anything for now, just update the deletedAt row and see how it goes 🙂 (with the SQL query above)
Rob
RobOP5w ago
it seems to be working!! I will investigate more and report back in a few hours thanks for the help!!!
Weiko
Weiko5w ago
Great 👍
Rob
RobOP5w ago
I have been using the setup for a while and haven't hit this error again. Thanks @Weiko
Want results from more Discord servers?
Add your server