Error in RT after a rebuild

Several months ago we had an issue in which the host running our RT
instance got corrupt. I was able to restore the majority of our data
with two exceptions: the ObjectCustomFieldValues table and the
CustomFieldValues table. Bringing the CustomFieldValues table back to
normal was easy. The ObjectCustomFieldValues table has not been so
easy.

A little more information… During the recovery I also took the
opportunity to upgrade from 3.6.7 to 4.0.5. I still have the 3.6.7
database that was fully restored and repaired prior to the upgrade.

Once I upgraded to 4.0.5 I ran rt-validator. It fixed a ton of stuff
(as expected).

My plan to fix the missing ObjectCustomFieldValues was to run some SQL
to first find the missing records, then lookup the transactions for
the custom field and pull the last edit value and insert a new value
into the table. But I can now see I’m missing about 28K transactions
with links to the table.

I’m also getting the following error on the ticket display page with
any ticket that has transactions in which the ObjectCustomFieldValues
table is missing data:

Can’t call method “new” on an undefined value at
/opt/rt4/sbin/…/lib/RT/ObjectCustomFieldValue.pm line 304

Any ideas on how I can proceed?

Mike

I’m also getting the following error on the ticket display page with
any ticket that has transactions in which the ObjectCustomFieldValues
table is missing data:

Can’t call method “new” on an undefined value at
/opt/rt4/sbin/…/lib/RT/ObjectCustomFieldValue.pm line 304

Any ideas on how I can proceed?

Is your goal to backfill those OCFV records or to stop RT from
throwing errors when your database has bad references?

If you turn on LogStackTraces in the config, you should get stacktraces
of the code patch that got to this error which will show where you can
insert some extra checks to guard against the missing chunks of the
database.

-kevin