Hello,
I’m having an issue with the admin_detailed_user_serializer that is causing 500 Errors when an administrator tries to view a user from the user search. The 500 Error is also happening when making GET api calls to https://mycommunity/admin/users/2000020409.json. Below is the exception from the logs. About 50% of the users are having this error. I tried comparing working verses non working users in the database but I can’t figure out what the issue could be. I suspect that something I did during a user migration from another system caused this problem.
Below were my data migration steps:
- Manually inserted data in the users, user_profiles, user_emails and user_stats tables.
- Initially all users had an ‘someid@example.com’ email.
- I then update the user_email table for the user to have the correct email.
- After this point, I noticed that 50% of these users can’t be viewed from the admin user list. However, if you right click on their name in the profile list, to get the profile card to come up, you can click in there and get to the profile fine. You can make updates on the profile but if you try to make someone and admin you will get the same 500 error that I listed below.
Does someone know what this code is checking for? I’m guessing some users must be missing a critical piece of data that is causing this 500 exception. Does anyone have any guesses? I’m new to Discourse and any advice would be greatly appreciated.
Thank You!
app/serializers/admin_user_list_serializer.rb:95:in `time_read'
(eval):27:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:89:in `block in _serializable_array'
activerecord (7.0.4.3) lib/active_record/relation/delegation.rb:88:in `each'
activerecord (7.0.4.3) lib/active_record/relation/delegation.rb:88:in `each'
active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:79:in `map'
active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:79:in `_serializable_array'
active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:73:in `serializable_array'
active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:53:in `as_json'
app/serializers/admin_detailed_user_serializer.rb:166:in `similar_users'
(eval):72:in `_fast_attributes'
active_model_serializers (0.8.4