Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Deserialization issue #125

Open
HuckyDucky opened this issue Aug 14, 2014 · 1 comment
Open

Deserialization issue #125

HuckyDucky opened this issue Aug 14, 2014 · 1 comment

Comments

@HuckyDucky
Copy link

This is Rails 3.2.

I'm getting the following error, but only when the method is executed via Sidekiq:

2014-08-14T15:14:25.255Z 23335 TID-ovtw9n32c WARN: undefined method `scan' for {}:Hash
2014-08-14T15:14:25.255Z 23335 TID-ovtw9n32c WARN: /Users/me/myapp/code/myfitment/.gems/ruby/1.9.1/gems/pg-hstore-1.2.0/lib/pg_hstore.rb:24:in `load`

It's triggered two ways:

  1. By referencing the HStore field on the model instance
  2. By calling "save" on the model instance

The error does not occur in the console. This tells me it is some kind of deserialization issue coming from Sidekiq. I can't decide whether Sidekiq is doing the serialization of the HStore field wrong, or if activerecord-postgres-hstore is doing the deserialization wrong.

The workaround is to call "self.reload" in the model instance method that is executed via Sidekiq's "delay" method.

@gingerlime
Copy link

Looks like this was cross-posted and answered on sidekiq/sidekiq#1899

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants