Bug#596351: ohai fails with: to_json: source sequence is illegal/malformed
Hi everybody, AFAICT ohai works fine nowadays: $ getent passwd 1000 alexander:x:1000:1000:Alexander' Kurtz£:/home/alexander:/bin/bash $ ohai { [...] platform: debian } $ Chris Butler suggested[1] that this commit to ruby-json might be a fix: https://github.com/flori/json/commit/dd06e48aa414674f52e81f9cdc7836b6456c04f8 This commit seems to be included in the latest version of ruby-json: $ grep --recursive --context=3 'def benchmark_generator_ascii' ruby-json-1.5.3/ ruby-json-1.5.3/benchmarks/generator2_benchmark.rb- ruby-json-1.5.3/benchmarks/generator2_benchmark.rb- alias reset_benchmark_generator_pretty generic_reset_method ruby-json-1.5.3/benchmarks/generator2_benchmark.rb- ruby-json-1.5.3/benchmarks/generator2_benchmark.rb: def benchmark_generator_ascii ruby-json-1.5.3/benchmarks/generator2_benchmark.rb-@result = JSON.generate(@big, :ascii_only = true) ruby-json-1.5.3/benchmarks/generator2_benchmark.rb- end ruby-json-1.5.3/benchmarks/generator2_benchmark.rb- -- ruby-json-1.5.3/benchmarks/generator_benchmark.rb- ruby-json-1.5.3/benchmarks/generator_benchmark.rb- alias reset_benchmark_generator_pretty generic_reset_method ruby-json-1.5.3/benchmarks/generator_benchmark.rb- ruby-json-1.5.3/benchmarks/generator_benchmark.rb: def benchmark_generator_ascii ruby-json-1.5.3/benchmarks/generator_benchmark.rb-@result = JSON.generate(@big, :ascii_only = true) ruby-json-1.5.3/benchmarks/generator_benchmark.rb- end ruby-json-1.5.3/benchmarks/generator_benchmark.rb- $ Unless somebody tells me otherwise, I'm going to reassign this bug to ruby-json and close it with the appropriate version in a few days. Best regards Alexander Kurtz [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596351#50 signature.asc Description: This is a digitally signed message part
Bug#596351: ohai fails with: to_json: source sequence is illegal/malformed
On Sat, Sep 18, 2010 at 04:10:11PM +0200, Michael Schutte wrote: /usr/lib/ruby/1.8/json/common.rb:232:in `to_json': source sequence is illegal/malformed (JSON::GeneratorError) from /usr/lib/ruby/1.8/json/common.rb:232:in `pretty_generate' from /usr/lib/ruby/1.8/ohai/system.rb:222:in `json_pretty_print' from /usr/lib/ruby/1.8/ohai/application.rb:104:in `run_application' from /usr/lib/ruby/1.8/ohai/application.rb:75:in `run' from /usr/bin/ohai:47 I notice you are using an 8-bit charset; perhaps there is some non-UTF-8 data that might upset the JSON library. May I ask you the problem is still present when you run “LANG=C LC_ALL=C ohai”? I guess the results of “ohai -ldebug” could also be useful to diagnose the issue. Good catch, it is indeed the case. you can reproduce this bug by editing /etc/passwd, adding some accented letter to some user's full name, :set fileencoding=latin1 and save. Then ohai will indeed fail like that. It will also fail with LANG=C LC_ALL=C. $ LANG=C LC_ALL=C ohai /usr/lib/ruby/1.8/json/common.rb:232:in `to_json': source sequence is illegal/malformed (JSON::GeneratorError) from /usr/lib/ruby/1.8/json/common.rb:232:in `pretty_generate' from /usr/lib/ruby/1.8/ohai/system.rb:222:in `json_pretty_print' from /usr/lib/ruby/1.8/ohai/application.rb:104:in `run_application' from /usr/lib/ruby/1.8/ohai/application.rb:75:in `run' from /usr/bin/ohai:47 Ciao, Enrico -- GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini enr...@enricozini.org signature.asc Description: Digital signature
Bug#596351: ohai fails with: to_json: source sequence is illegal/malformed
Hi Christopher, On Fri, Sep 10, 2010 at 06:00:35PM +0200, Christopher Huhn, GSI wrote: Simply running ohai fails on my box with the following error: /usr/lib/ruby/1.8/json/common.rb:232:in `to_json': source sequence is illegal/malformed (JSON::GeneratorError) from /usr/lib/ruby/1.8/json/common.rb:232:in `pretty_generate' from /usr/lib/ruby/1.8/ohai/system.rb:222:in `json_pretty_print' from /usr/lib/ruby/1.8/ohai/application.rb:104:in `run_application' from /usr/lib/ruby/1.8/ohai/application.rb:75:in `run' from /usr/bin/ohai:47 I notice you are using an 8-bit charset; perhaps there is some non-UTF-8 data that might upset the JSON library. May I ask you the problem is still present when you run “LANG=C LC_ALL=C ohai”? I guess the results of “ohai -ldebug” could also be useful to diagnose the issue. Cheers, -- Michael Schutte mi...@uiae.at signature.asc Description: Digital signature
Bug#596351: ohai fails with: to_json: source sequence is illegal/malformed
Hi there, I just installed ohai (0.5.6-1, libohai-ruby 0.5.6-1, ruby 4.5 -- like you), and running ohai has no problems... -- Marcos Marado -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#596351: ohai fails with: to_json: source sequence is illegal/malformed
Package: ohai Version: 0.5.6-1 Severity: grave Justification: renders package unusable Simply running ohai fails on my box with the following error: /usr/lib/ruby/1.8/json/common.rb:232:in `to_json': source sequence is illegal/malformed (JSON::GeneratorError) from /usr/lib/ruby/1.8/json/common.rb:232:in `pretty_generate' from /usr/lib/ruby/1.8/ohai/system.rb:222:in `json_pretty_print' from /usr/lib/ruby/1.8/ohai/application.rb:104:in `run_application' from /usr/lib/ruby/1.8/ohai/application.rb:75:in `run' from /usr/bin/ohai:47 A quick search on Google gives the hint that libjson-ruby might be too old. Regards, Christopher -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: lang=de...@euro, lc_ctype=de...@euro (charmap=ISO-8859-15) Shell: /bin/sh linked to /bin/dash Versions of packages ohai depends on: ii libohai-ruby 0.5.6-1Library to collect data about your ii ruby 4.5An interpreter of object-oriented ohai recommends no packages. Versions of packages ohai suggests: pn ohai-doc none (no description available) -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org