Closed kbrock closed 2 years ago
Interesting, so options is able to be yaml loaded but when you walk the attributes, that's when it blows up? Weird.
Never trust a ActiveRecord::LazyAttributeHash.
I'm curious if it is a problem with CloudVolumes, or the specific error type. There are 4 cloud volume errors in the notifications table, the 4th one being that the cloud volume was removed.
Personal reference errors: 468,469,470 ok: 467
I think the solution may be as simple as:
UPDATE notifications
SET options = REPLACE(options, 'ActiveRecord::Attribute', 'ActiveModel::Attribute')
WHERE (options LIKE '%ActiveR%');
Notification.where("options LIKE '%ActiveRecord%'") \
.update_all("options = REPLACE(options, 'ActiveRecord::Attribute', 'ActiveModel::Attribute')"
Interesting, so options is able to be yaml loaded but when you walk the attributes, that's when it blows up? Weird. -- @jrafanie
No, I can not access options
, I got this data from sql
Never trust a ActiveRecord::LazyAttributeHash.
agreed
Oleg came up with the conclusion that these records are not useful across versions. And we should not do heroics to keep the records alive.
This has been deemed a low priority and the notifications can be cleared out between upgrades so a fix is present. We are a number of miq versions past this problem so I am closing.
@chessbyte please open if you feel we still may want to address in the future
We just upgraded rails and the ActiveRecord::Attribute model moved over to
ActiveModel::Attribute
.We are storing some of these records in the database and this is causing issues.
Notification#options for the field contains:
Our previous fix was: https://github.com/ManageIQ/manageiq-schema/pull/390
We need to create a similar schema migration to remove or fix these records