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

Can't upload inherited profile #789

Closed
anniehedgpeth opened this issue Jun 13, 2016 · 3 comments
Closed

Can't upload inherited profile #789

anniehedgpeth opened this issue Jun 13, 2016 · 3 comments

Comments

@anniehedgpeth
Copy link
Contributor

Description

When I tried to upload a new inherited profile (for use on a tutorial) via the UI, it wouldn't work.

InSpec and Platform Version

Chef Compliance 1.3.1

Replication Case

Upload the attached profile.
inspec-inheritance.zip

Possible Solutions

??

Stacktrace

From /var/log/chef-compliance/nginx/current

2016-06-13_23:30:55.91043 23:30:55.910 ERR => DB error: sql: no rows in result set
2016-06-13_23:30:55.91093 23:30:55.910 DEB => ID of user annie-hedgpeth changed: 01494173-cb07-42a9-6588-672fd1aa4a2d -> 4f972903-340e-4b04-a020-03fccac26e16 (resetting)
2016-06-13_23:30:55.91099 23:30:55.910 DEB => Authenticated user: &{PasswordHash: Login:annie-hedgpeth Name:annie-hedgpeth IsOrg:false Source:{String: Valid:false} UUID:{ID:01494173-cb07-42a9-6588-672fd1aa4a2d}}
2016-06-13_23:30:55.91142 23:30:55.911 ERR => DB error: sql: no rows in result set
2016-06-13_23:30:55.92353 23:30:55.923 DEB => Extracted upload to /var/opt/chef-compliance/core/runtime/compliance-profiles/upload_387722489
2016-06-13_23:30:55.92371 23:30:55.923 DEB => Found compliance root folder in /var/opt/chef-compliance/core/runtime/compliance-profiles/upload_387722489/inspec-inheritance
2016-06-13_23:30:55.92378 23:30:55.923 DEB => Run: cd /var/opt/chef-compliance/core/runtime/compliance-profiles/upload_387722489/inspec-inheritance && inspec [check . --format json --profiles-path /var/opt/chef-compliance/core/runtime/$
2016-06-13_23:30:57.55070 /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile_context.rb:39:in `instance_eval': ./controls/interitance.rb:15: syntax error, unexpected end-of-input, expecting keyword_en$
2016-06-13_23:30:57.55079       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile_context.rb:39:in `load'
2016-06-13_23:30:57.55080       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/runner.rb:130:in `add_test_to_context'
2016-06-13_23:30:57.55081       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/runner.rb:114:in `block in add_content'
2016-06-13_23:30:57.55082       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/runner.rb:114:in `each'
2016-06-13_23:30:57.55083       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/runner.rb:114:in `add_content'
2016-06-13_23:30:57.55086       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/runner.rb:87:in `add_profile'
2016-06-13_23:30:57.55087       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile.rb:246:in `load_checks_params'
2016-06-13_23:30:57.55089       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile.rb:227:in `load_params'
2016-06-13_23:30:57.55090       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile.rb:55:in `params'
2016-06-13_23:30:57.55091       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile.rb:162:in `controls_count'
2016-06-13_23:30:57.55092       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/profile.rb:134:in `check'
2016-06-13_23:30:57.55093       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/lib/inspec/cli.rb:54:in `check'
2016-06-13_23:30:57.55094       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
2016-06-13_23:30:57.55096       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
2016-06-13_23:30:57.55098       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
2016-06-13_23:30:57.55100       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
2016-06-13_23:30:57.55103       from /opt/chef-compliance/embedded/lib/ruby/gems/2.2.0/gems/inspec-0.23/bin/inspec:9:in `<top (required)>'
2016-06-13_23:30:57.55104       from /opt/chef-compliance/embedded/bin/inspec:22:in `load'
2016-06-13_23:30:57.55105       from /opt/chef-compliance/embedded/bin/inspec:22:in `<main>'
2016-06-13_23:30:57.58069 23:30:57.580 ERR => Failed to upload compliance profile; exit status 1
2016-06-13_23:30:57.58073 [GIN] 2016/06/13 - 23:30:57 | 500 |  1.671474312s | 72.190.108.137 |   POST    /owners/01494173-cb07-42a9-6588-672fd1aa4a2d/compliance
2016-06-13_23:30:57.58074 Error #01: exit status 1
@anniehedgpeth
Copy link
Contributor Author

I was missing an end, so I thought that may be a problem.
And I had the owner of the profile included in the control name, so I took that out.
Here's the updated profile. I tried uploading again, and it didn't work again.
inspec-inheritance.zip

@chris-rock
Copy link
Contributor

@anniehedgpeth This could not be parsed, because the end was missing. The following test works on my Chef Compliance:

include_controls 'cis/cis-ubuntu14.04lts-level1' do
  skip_control 'xccdf_org.cisecurity.benchmarks_rule_10.1.1_Set_Password_Expiration_Days'

  control "xccdf_org.cisecurity.benchmarks_rule_10.1.1_Set_Password_Expiration_Days_To_30" do
    title "Set Password Expiration Days"
    desc  "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 30 days."
    impact 1.0
    describe file("/etc/login.defs") do
      its(:content) { should match /^\s*PASS_MAX_DAYS\s+30/ }
    end
  end
end

inspec-inheritance.zip

@anniehedgpeth
Copy link
Contributor Author

Yep, you're right, @chris-rock. I think I just broke it again when I took out the profile owner name. I should have tested it after I fixed the end. Thanks!

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