chef-boneyard / chef-dk

DEPRECATED: A streamlined development and deployment workflow for Chef Infra platform.
Apache License 2.0
380 stars 170 forks source link

inspec bug in chefdk 4.4.14 #2243

Open zmaupin opened 5 years ago

zmaupin commented 5 years ago

Description

Unable to use inspec in chefdk 4.4.14

ChefDK Version

root@5c322673c874:~/🌊# chef --version
ChefDK version: 4.4.14
Chef Infra Client version: 15.2.20
Chef InSpec version: ERROR
Test Kitchen version: 2.3.1
Foodcritic version: 16.1.1
Cookstyle version: 5.4.13

Platform Version

chefdk docker container:

FROM chef/chefdk:4.4.14
root@5c322673c874:~/🌊# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

Replication Case

Startup container. Run chef --version Or Run inspec --version Or With inspec verified in kitchen.yml use: kitchen with almost any command:

Stacktrace

root@5c322673c874:~/🌊# kitchen verify
-----> Starting Kitchen (v2.3.1)
Traceback (most recent call last):
    41: from /opt/chefdk/bin/kitchen:351:in `<main>'
    40: from /opt/chefdk/bin/kitchen:351:in `load'
    39: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.3.1/bin/kitchen:13:in `<top (required)>'
    38: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.3.1/lib/kitchen/errors.rb:171:in `with_friendly_errors'
    37: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.3.1/bin/kitchen:13:in `block in <top (required)>'
    36: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
    35: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    34: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
     ... 29 levels...
     4: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     3: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     2: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/plugin/v2.rb:30:in `<top (required)>'
     1: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': stack level too deep (SystemStackError)
root@5c322673c874:~/🌊# inspec --version
Traceback (most recent call last):
    10: from /opt/chefdk/bin/inspec:351:in `<main>'
     9: from /opt/chefdk/bin/inspec:351:in `load'
     8: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/inspec-bin-4.16.0/bin/inspec:10:in `<top (required)>'
     7: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     6: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     5: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/cli.rb:428:in `<top (required)>'
     4: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     3: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     2: from /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/plugin/v2.rb:30:in `<top (required)>'
     1: from /opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/chefdk/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': stack level too deep (SystemStackError)

NOTE: CHEFDK BUGS ONLY

This issue tracker is for the code contained within this repo -- chefdk.

zmaupin commented 5 years ago

Not a bug. This was a problem with an invalid name in the directory (the emoji).

nnappe commented 5 years ago

@zmaupin I'd open it back. Nevermind the emojis, the problem probably stems from poor UTF-8 character handling and there might be proper use cases for UTF-8 path names. :) Cheers

zmaupin commented 5 years ago

Reopening... https://github.com/chef/chef-dk/issues/2243#issuecomment-537678461

tas50 commented 5 years ago

@zmaupin are you seeing this with the released version of DK 4.4?

zmaupin commented 5 years ago

Downloaded the latest Ubuntu Bionic release from https://downloads.chef.io/chefdk#ubuntu

root@7eff9d503821:~/🌊# dpkg -i chefdk_4.4.27-1_amd64.deb
(Reading database ... 54714 files and directories currently installed.)
Preparing to unpack chefdk_4.4.27-1_amd64.deb ...
Unpacking chefdk (4.4.27-1) over (4.3.13-1) ...
chef --version
Setting up chefdk (4.4.27-1) ...
Thank you for installing ChefDK!
You can find some tips on getting started at https://learn.chef.io
root@7eff9d503821:~/🌊# chef --version
ChefDK version: 4.4.27
Chef Infra Client version: 15.3.14
Chef InSpec version: ERROR
Test Kitchen version: 2.3.3
Foodcritic version: 16.1.1
Cookstyle version: 5.6.2
tyler-ball commented 5 years ago

This is very interesting that InSpec is the only one having an issue getting its version. Thanks for the report @zmaupin - getting this issue triaged

zenspider commented 5 years ago

@tyler-ball but are the other values coming in from shelling out, or from using constants already loaded?

zenspider commented 5 years ago

I do not have a repro on my side. That could be environment (I'm running inspec directly trying from a directory with an emoji name and with a PS1 that includes pwd) or ... I dunno. ruby versions? I highly highly doubt that's an issue.

tas50 commented 5 years ago

@zmaupin Can you try to update to ChefDK 4.5.0 and see if this still happens on that new release? It has an updated InSpec along with a bunch of other updates.

zmaupin commented 5 years ago

Same with ChefDK 4.5.0

$ docker run -i -t --workdir /home/🌊 chef/chefdk /bin/bash
root@9c3026042631:/home/🌊# chef --version
ChefDK version: 4.5.0
Chef Infra Client version: 15.4.45
Chef InSpec version: ERROR
Test Kitchen version: 2.3.3
Foodcritic version: 16.1.1
Cookstyle version: 5.9.3