samedi 5 septembre 2015

Unable to unmarshal value: undefined class/module error Rails

I see the following error in my application after starting to use Dalli & Memcached:

Cache read: account_statuses_for_environment_6
DalliError: Unable to unmarshal value: undefined class/module Status
Cache generate: account_statuses_for_environment_6
  Status Load (0.3ms)  SELECT "statuses".* FROM "statuses" WHERE "statuses"."merchant_id" = 6
Cache write: account_statuses_for_environment_6

Weirdly, this will just sometimes work (aka marshal the value, whatever that really means).

Does anyone know of a solution? My model is called:

class Status < ActiveRecord::Base

The table is 'statuses' - it works very well to retrieve records. I don't know why the caching situation doesn't work for this model. There are a few other models that don't work with the cache either, but most just work.

Aucun commentaire:

Enregistrer un commentaire