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

Deserialization issue #125

@HuckyDucky

Description

@HuckyDucky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions