intridea/multi_json

Issue while PUTing json

Utopism opened this issue · 9 comments

We trigger this with a recent version of Redmine,
But this error has been reported with capistrano, or others applications.

The request :
Started PUT "/issues/194497.json" for 10.5.3.36 at 2013-12-12 15:01:41 +0100

Error occurred while parsing request parameters.
Contents:
{"issue":{ "id":194497, "subject":"woot--Late delagate ne marche plus pour les super RH", "description":"woot foobar", "done_ratio":66, "spent_hours":666.0}}
ArgumentError (Did not recognize your adapter specification.):

Error started with V1.7.9

rwz commented

Can you fire up the console and try typing MultiJson.adapter and MultiJson.load('{"foo":"bar"}') there?
What gems are used? Do you manually override default adapter?

[1] pry(main)> MultiJson.adapter
=> MultiJson::Adapters::JsonGem
[2] pry(main)> MultiJson.load('{"foo":"bar"}')
=> {"foo"=>"bar"}

I don't know if Redmine 2.3.2 overrides default adapter, but suppose not, because it works with gem V1.7.8

Gems :
actionmailer (3.2.13)
Installed at: /var/lib/gems/1.9.1
actionpack (3.2.13)
Installed at: /var/lib/gems/1.9.1
activemodel (3.2.13)
Installed at: /var/lib/gems/1.9.1
activerecord (3.2.13)
Installed at: /var/lib/gems/1.9.1
activeresource (3.2.13)
Installed at: /var/lib/gems/1.9.1
activesupport (3.2.13)
Installed at: /var/lib/gems/1.9.1
arel (3.0.2)
Installed at: /var/lib/gems/1.9.1
atomic (1.1.14)
Installed at: /var/lib/gems/1.9.1
builder (3.0.0)
Installed at: /var/lib/gems/1.9.1
bundler (1.3.5)
Installed at: /var/lib/gems/1.9.1
capybara (2.0.3)
Installed at: /var/lib/gems/1.9.1
childprocess (0.3.9)
Installed at: /var/lib/gems/1.9.1
choice (0.1.6)
Installed at: /var/lib/gems/1.9.1
coderay (1.0.9)
Installed at: /var/lib/gems/1.9.1
colorize (0.5.8)
Installed at: /var/lib/gems/1.9.1
coveralls (0.7.0)
Installed at: /var/lib/gems/1.9.1
docile (1.1.0)
Installed at: /var/lib/gems/1.9.1
erubis (2.7.0)
Installed at: /var/lib/gems/1.9.1
ffi (1.9.3)
Installed at: /var/lib/gems/1.9.1
hike (1.2.3)
Installed at: /var/lib/gems/1.9.1
hoe (3.7.1)
Installed at: /var/lib/gems/1.9.1
i18n (0.6.1)
Installed at: /var/lib/gems/1.9.1
journey (1.0.4)
Installed at: /var/lib/gems/1.9.1
jquery-rails (2.0.3)
Installed at: /var/lib/gems/1.9.1
json (1.8.1)
Installed at: /var/lib/gems/1.9.1
lockfile (2.1.0)
Installed at: /var/lib/gems/1.9.1
mail (2.5.4)
Installed at: /var/lib/gems/1.9.1
metaclass (0.0.1)
Installed at: /var/lib/gems/1.9.1
method_source (0.8.2)
Installed at: /var/lib/gems/1.9.1
mime-types (1.25)
Installed at: /var/lib/gems/1.9.1
minitest (4.7.5)
Installed at: /var/lib/gems/1.9.1
mocha (0.13.3)
Installed at: /var/lib/gems/1.9.1
multi_json (1.8.2)
Installed at: /var/lib/gems/1.9.1
mysql2 (0.3.14)
Installed at: /var/lib/gems/1.9.1
net-ldap (0.3.1)
Installed at: /var/lib/gems/1.9.1
nokogiri (1.5.10)
Installed at: /var/lib/gems/1.9.1
plist (3.1.0)
Installed at: /var/lib/gems/1.9.1
polyglot (0.3.3)
Installed at: /var/lib/gems/1.9.1
pry (0.9.12.3)
Installed at: /var/lib/gems/1.9.1
rack (1.4.5)
Installed at: /var/lib/gems/1.9.1
rack-cache (1.2)
Installed at: /var/lib/gems/1.9.1
rack-openid (1.4.1)
Installed at: /var/lib/gems/1.9.1
rack-ssl (1.3.3)
Installed at: /var/lib/gems/1.9.1
rack-test (0.6.2)
Installed at: /var/lib/gems/1.9.1
railroady (1.1.1)
Installed at: /var/lib/gems/1.9.1
rails (3.2.13)
Installed at: /var/lib/gems/1.9.1
rails-footnotes (3.7.9)
Installed at: /var/lib/gems/1.9.1
railties (3.2.13)
Installed at: /var/lib/gems/1.9.1
rake (10.1.0)
Installed at: /var/lib/gems/1.9.1
rdoc (3.12.2)
Installed at: /var/lib/gems/1.9.1
rest-client (1.6.7)
Installed at: /var/lib/gems/1.9.1
rmagick (2.13.2)
Installed at: /var/lib/gems/1.9.1
ruby-graphviz (1.0.9)
Installed at: /var/lib/gems/1.9.1
ruby-openid (2.2.3)
Installed at: /var/lib/gems/1.9.1
rubyzip (1.0.0)
Installed at: /var/lib/gems/1.9.1
selenium-webdriver (2.37.0)
Installed at: /var/lib/gems/1.9.1
shoulda (3.3.2)
Installed at: /var/lib/gems/1.9.1
shoulda-context (1.0.2)
Installed at: /var/lib/gems/1.9.1
shoulda-matchers (1.4.1)
Installed at: /var/lib/gems/1.9.1
simplecov (0.8.1)
Installed at: /var/lib/gems/1.9.1
simplecov-html (0.8.0)
Installed at: /var/lib/gems/1.9.1
slop (3.4.6)
Installed at: /var/lib/gems/1.9.1
spox-plist (3.0.1)
Installed at: /var/lib/gems/1.9.1
spox-textpow (0.10.3)
Installed at: /var/lib/gems/1.9.1
sprockets (2.2.2)
Installed at: /var/lib/gems/1.9.1
sprockets-rails (2.0.1)
Installed at: /var/lib/gems/1.9.1
term-ansicolor (1.2.2)
Installed at: /var/lib/gems/1.9.1
textpow (1.3.1)
Installed at: /var/lib/gems/1.9.1
thor (0.18.1)
Installed at: /var/lib/gems/1.9.1
thread_safe (0.1.3)
Installed at: /var/lib/gems/1.9.1
tilt (1.4.1)
Installed at: /var/lib/gems/1.9.1
tins (0.13.1)
Installed at: /var/lib/gems/1.9.1
treetop (1.4.15)
Installed at: /var/lib/gems/1.9.1
tzinfo (0.3.38)
Installed at: /var/lib/gems/1.9.1
ultraviolet (1.0.1)
Installed at: /var/lib/gems/1.9.1
uv (0.0.7.5)
Installed at: /var/lib/gems/1.9.1
websocket (1.0.7)
Installed at: /var/lib/gems/1.9.1
xpath (1.0.0)
Installed at: /var/lib/gems/1.9.1
yard (0.8.7.3)
Installed at: /var/lib/gems/1.9.1

rwz commented

What version of ruby are you using? Does the problem goes away if you explicitly add gem 'json', '~> 1.8.1' to your Gemfile?

What is your current Gemfile.lock looks like?

ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Gemfile.lock :
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.13)
actionpack (= 3.2.13)
mail (> 2.5.3)
actionpack (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
builder (
> 3.0.0)
erubis (> 2.7.0)
journey (
> 1.0.4)
rack (> 1.4.5)
rack-cache (
> 1.2)
rack-test (> 0.6.1)
sprockets (
> 2.2.1)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (> 3.0.0)
activerecord (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
arel (
> 3.0.2)
tzinfo (> 0.3.29)
activeresource (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (
> 1.0)
arel (3.0.2)
builder (3.0.0)
capybara (2.0.3)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (> 2.0)
xpath (
> 1.0.0)
childprocess (0.3.9)
ffi (> 1.0, >= 1.0.11)
coderay (1.0.9)
coveralls (0.7.0)
multi_json (
> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
docile (1.1.0)
erubis (2.7.0)
fastercsv (1.5.5)
ffi (1.9.3)
hike (1.2.3)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.3)
railties (>= 3.1.0, < 5.0)
thor (> 0.14)
json (1.8.1)
lockfile (2.1.0)
mail (2.5.4)
mime-types (
> 1.16)
treetop (> 1.4.8)
metaclass (0.0.1)
method_source (0.8.2)
mime-types (1.25)
mocha (0.13.3)
metaclass (
> 0.0.1)
multi_json (1.8.2)
mysql2 (0.3.14)
net-ldap (0.3.1)
nokogiri (1.5.10)
plist (3.1.0)
polyglot (0.3.3)
pry (0.9.12.3)
coderay (> 1.0)
method_source (
> 0.8)
slop (> 3.4)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-openid (1.4.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
railroady (1.1.1)
rails (3.2.13)
actionmailer (= 3.2.13)
actionpack (= 3.2.13)
activerecord (= 3.2.13)
activeresource (= 3.2.13)
activesupport (= 3.2.13)
bundler (
> 1.0)
railties (= 3.2.13)
rails-footnotes (3.7.9)
rails (>= 3.0.0)
railties (3.2.13)
actionpack (= 3.2.13)
activesupport (= 3.2.13)
rack-ssl (> 1.3.2)
rake (>= 0.8.7)
rdoc (
> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.1.0)
rdoc (3.12.2)
json (> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rmagick (2.13.2)
ruby-openid (2.2.3)
rubyzip (1.0.0)
selenium-webdriver (2.37.0)
childprocess (>= 0.2.5)
multi_json (
> 1.0)
rubyzip (> 1.0.0)
websocket (
> 1.0.4)
shoulda (3.3.2)
shoulda-context (> 1.0.1)
shoulda-matchers (
> 1.4.1)
shoulda-context (1.0.2)
shoulda-matchers (1.4.1)
activesupport (>= 3.0.0)
simplecov (0.8.1)
docile (> 1.1.0)
lockfile (>= 2.1.0)
multi_json
simplecov-html (
> 0.8.0)
simplecov-html (0.8.0)
slop (3.4.6)
sprockets (2.2.2)
hike (> 1.2)
multi_json (
> 1.0)
rack (> 1.0)
tilt (
> 1.1, != 1.3.0)
term-ansicolor (1.2.2)
tins (> 0.8)
textpow (1.3.1)
plist (>= 3.0.1)
thor (0.18.1)
tilt (1.4.1)
tins (0.13.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.38)
ultraviolet (1.0.1)
textpow (>= 1.3.0)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (
> 1.3)
yard (0.8.7.3)

PLATFORMS
ruby

DEPENDENCIES
activerecord-jdbc-adapter (= 1.2.5)
activerecord-jdbcmysql-adapter
builder (= 3.0.0)
capybara (> 2.0.0)
coderay (
> 1.0.9)
coveralls
fastercsv (> 1.5.0)
i18n (
> 0.6.0)
jquery-rails (> 2.0.2)
mocha (
> 0.13.3)
mysql2 (> 0.3.11)
net-ldap (
> 0.3.1)
nokogiri (< 1.6.0)
pry
rack-openid
railroady
rails (= 3.2.13)
rails-footnotes
rdoc (>= 2.4.2)
rmagick (>= 2.0.0)
ruby-openid (> 2.2.3)
shoulda (
> 3.3.2)
simplecov
ultraviolet (~> 1.0.0)
yard

If I explicitly add gem 'json', '~> 1.8.1' I will be the same as when not working, using V1.8.2

rwz commented

Can you provide a showcase app here on github with step-by-step instructions of how to reproduce the error?

rwz commented

Closing this issue for now. Will reopen if/when more info is available.

Seems to work well with multi_json V1.10.1