Reputation: 3
I've been getting this error as of recent for a couple cookbooks I'm trying to test with "chef exec rspec":
An error occurred in a `before(:suite)` hook.
Failure/Error: raise ArgumentError, "#{str.inspect} is not an octal string"
ArgumentError:
"\x80\x00\x00\x00\e\xC4dx" is not an octal string
# /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_header.rb:128:in `strict_oct'
# /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_header.rb:108:in `from'
# /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_reader.rb:59:in `each'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:27:in `block in extract'
# /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_reader.rb:29:in `new'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:118:in `reader'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:25:in `extract'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive.rb:33:in `extract'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/community_rest.rb:16:in `unpack'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/community_rest.rb:102:in `download'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:70:in `try_download'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:40:in `block in download'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:39:in `each'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:39:in `download'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/installer.rb:108:in `install'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/installer.rb:181:in `block (2 levels) in install_from_universe'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/ivar.rb:170:in `safe_execute'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/future.rb:52:in `block in execute'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
# /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
Finished in 1.36 seconds (files took 7.16 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
This also prevents it from recognizing any unit tests written (as you can see it recognizes 0 examples). When I run chef exec rspec on any other cookbooks I have done in the past, I don't have this issue. I noticed it's tracing the issue back to chefdk on my Mac, but I've researched everywhere for this issue and can't find anything on it and am not sure what this error is trying to tell me. I'm a novice to Chef, so if anyone can guide me in the right direction or tell me what this error may mean, it would be a good start.
One pattern I noticed is that the 2 cookbooks I have this issue with, were cloned over https rather than ssh. I have no idea if this has anything to do with it or just purely coincidental.
I also noticed whenever I comment out "require spec helper" in the spec files for the cookbooks, this error goes away and starts recognizing unit tests written in the spec file. But doing so, is not a long-term solution and am not sure if it's properly testing the examples.
I've also updated ruby on my Mac to 2.4.1
Upvotes: 0
Views: 868
Reputation: 3974
This has nothing to do with rspec, or even chefspec, but with a patch in rubygems 2.7.6 which broke berkshelf and has been addressed in mixlib-archive:
https://github.com/berkshelf/berkshelf/issues/1744
Upvotes: 1
Reputation: 3
Update: I was running ChefDK 2.5.3 and updated to 3.0.36 and the issue went away. I don't know if there was a compatibility issue or if the files were messed up and a fresh install solved the issue.
Upvotes: 0