Open kplimack opened 9 years ago
I have received a similar error when using a Grafana cookbook
Vendoring grafana (1.5.1) to /var/chef/cookbooks/grafana
/opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError) from /opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in
generate'
from /opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in fast_generate' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook/metadata.rb:433:in
to_json'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook.rb:123:in block in compile_metadata' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook.rb:122:in
open'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook.rb:122:in compile_metadata' from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:607:in
block in vendor'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:594:in each' from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:594:in
vendor'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:387:in vendor' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:52:in dispatch' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in
start'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/cli.rb:27:in execute!' from /opt/chefdk/embedded/apps/berkshelf/bin/berks:5:in
<top (required)>'
from /opt/chefdk/bin/berks:37:in load' from /opt/chefdk/bin/berks:37:in
@kplimack this looks issueful: does this directory in fact exist?
mario: The cookbook path '/Users/jakeplimack/.berkshelf/mario/vagrant/berkshelf-20141009-47885-1fy02ek-mario' doesn't exist. Ignoring...
I ran into the same problem with berks vendor for vagrant for one of our cookbooks.
Stack trace:
stderr: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cpu_counter.rb:28: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in `encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)
from /opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in `generate'
from /opt/chefdk/embedded/lib/ruby/2.1.0/json/common.rb:254:in `fast_generate'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/chef/cookbook/metadata.rb:433:in `to_json'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/chef/cookbook.rb:123:in `block in compile_metadata'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/chef/cookbook.rb:122:in `open'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.1.0/lib/ridley/chef/cookbook.rb:122:in `compile_metadata'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:596:in `block (2 levels) in vendor'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:583:in `each'
from /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb:583:in `block in vendor'
Found a workaround from https://github.com/cucumber/gherkin/issues/192 - setting this environment variable prior to vagrant up
resolved it for me.
export LANG=en_US.UTF-8
(previously had LANG=C
set as a workaround for a different problem)
+1
export LANG=en_US.UTF-8
works for me
Digging deeper, it looks like Berkshelf has this problem in more than one place: https://github.com/berkshelf/berkshelf-api/issues/112
I'll try and track that down, but I suspect users are going to need to ensure their systems are set to LANG=en_US.UTF-8 (or SOMETHING.UTF-8) until we know what's going on. I don't think this will make chef-provisioning 1.0 (though I could be wrong).