Runtime exception (encode': "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)) when requesting json format output
nandeshguru opened this issue · 2 comments
inspec exec https://github.com/dev-sec/cis-kubernetes-benchmark/archive/master.zip --format json WARN: Unresolved specs during Gem::Specification.reset: rake (>= 0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/formatters/json_formatter.rb:56:in
encode': "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/formatters/json_formatter.rb:56:in to_json' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/formatters/json_formatter.rb:56:in
close'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:206:in block in notify' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:205:in
each'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:205:in notify' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:238:in
close'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:193:in close_after' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:171:in
finish'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:81:in report' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:112:in
run_specs'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/lib/inspec/runner_rspec.rb:77:in run' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/lib/inspec/runner.rb:116:in
run_tests'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/lib/inspec/runner.rb:100:in run' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/lib/inspec/base_cli.rb:83:in
run_tests'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/lib/inspec/cli.rb:158:in exec' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.45.13/bin/inspec:12:in
<top (required)>'
from /usr/bin/inspec:23:in load' from /usr/bin/inspec:23:in
This is happening only if you use github url. I you execute it directly from the folder, it's working
Found some unneeded Unicode quotes that were messing with the report output here. PR should be up in a few minutes to fix this.