Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue after upgrading to the latest version of Inspec. #122

Closed
ihorkanivets opened this issue Sep 13, 2019 · 5 comments
Closed

Issue after upgrading to the latest version of Inspec. #122

ihorkanivets opened this issue Sep 13, 2019 · 5 comments

Comments

@ihorkanivets
Copy link

Describe the bug
Issue with uploading inspec profile to Chef Automate after Inspec upgrade from 3.5.0 to 4.16.0

Expected behavior
It should work at the same way like 3.5.0

Actual behavior

d/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	22: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	21: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb:161:in `upload'
	20: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:421:in `check'
	19: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:451:in `controls_count'
	18: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:195:in `params'
	17: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:597:in `load_params'
	16: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:604:in `load_checks_params'
	15: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:202:in `collect_tests'
	14: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:63:in `each'
	13: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:63:in `each'
	12: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:64:in `block in each'
	11: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:202:in `collect_tests'
	10: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:63:in `each'
	 9: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:63:in `each'
	 8: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dependencies/dependency_set.rb:64:in `block in each'
	 7: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:204:in `collect_tests'
	 6: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:204:in `each'
	 5: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile.rb:208:in `block in collect_tests'
	 4: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile_context.rb:145:in `load_control_file'
	 3: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile_context.rb:161:in `load_with_context'
	 2: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/profile_context.rb:161:in `instance_eval'
	 1: from /root/.inspec/cache/74df8a2d5a90a0a85d649450f2aaf36d06e91eb4/controls/os_spec.rb:29:in `load_with_context'
/opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.16.0/lib/inspec/dsl.rb:47:in `method_missing': undefined local variable or method `virtualization' for #<#<Class:0x00000000067e7e48>:0x00000000067e7538> (NameError)

Example code

inspec compliance upload linux-profile --overwrite

OS / Environment

MacOS, Centos7

Inspec Version

[root@default-centos7 inspec-4.16.0]# inspec --version
4.16.0

Baseline Version


Additional context
It works properly wit 3.5.0 version. I've tested it with 4.7.3 and 4.16.0 - the same issue.
If additional information required - please let me know.

@chris-rock
Copy link
Member

Can you execute the baseline with InSpec 4 directly? Any PR to fix it is welcome. Keep in mind that we need to keep the baseline compatible with InSpec 3.

@ihorkanivets
Copy link
Author

Can you execute the baseline with InSpec 4 directly? Any PR to fix it is welcome. Keep in mind that we need to keep the baseline compatible with InSpec 3.

Hello Chris! Thanks for replay - it works Ok if I run inspec exec https://github.com/dev-sec/linux-baselinedirectly from machine with inspec v 4.16.0.

So I think it isn't problem on your side, I 'll dig deeper into Inspec. Sorry for disturbing,

Have a grate day!

@chris-rock
Copy link
Member

Thank you for testing @ihorkanivets Maybe that is an issue with Automate?

@ihorkanivets
Copy link
Author

Thank you for testing @ihorkanivets Maybe that is an issue with Automate?

I've already installed new one Chef-Automate server - the same issue with Inspec 4.16.0 and it works Ok with Inspec 3.5.0.

I've also found a bit similar issue with inspec/inspec#3841 with 3.6.6 version, so I created issue directly in Inspec repo, will see, may be something wrong from their side.

Regards,
Ihor

@chris-rock
Copy link
Member

Awesome. Then lets close this issue here for now. Feel free to re-open if you think this is an issue with this profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants