Error on profile edit for single user. "NoMethodError (undefined method `<<' for {}:Hash"


#1

Running master branch fork from the 7th of December.
We have not done any edits other than homepage, about, more, upload size etc.

Got a user who goes to url/settings/profile

Logs spits out this.

Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] method=GET path=/settings/profile format=html controller=Settings::ProfilesController action=show status=500 error='NoMethodError: undefined method `<<' for {}:Hash
Dec 26 03:04:50 www3 bundle[19900]: Did you mean?  <' duration=14.28 view=0.00 db=4.99
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683]
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] NoMethodError (undefined method `<<' for {}:Hash
Dec 26 03:04:50 www3 bundle[19900]: Did you mean?  <):
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683]
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] app/models/account.rb:210:in `block in build_fields'
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] app/models/account.rb:209:in `times'
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] app/models/account.rb:209:in `build_fields'
Dec 26 03:04:50 www3 bundle[19900]: [744601ac-d9ff-4d36-b28f-e540395a5683] app/controllers/settings/profiles_controller.rb:16:in `show'

Only happens to this one user (as far as we know). Presuming data in the SQL is causing this if it is just a single user?


#2

Good question. It seems that we have there a JSONB (which probably is fetched as a Hash) but we always initialize it to an Array.

I am not sure how serialization is done here but maybe @Gargron can track a potential bug?