Peter Loron | 19 Apr 01:39 2014

Ohai error when running knife configure

I have an Ubuntu 13.10 x64 machine on which I have installed the 
chef_11.12.2-1_amd64.deb package. I have a user created in the Chef 
server, which is an admin. I grabbed that pem file and the validator 
pem. When I run "knife configure -i" on the client, I get this:

ERROR: Ohai::Exceptions::DependencyNotFound: Can not find a plugin for 
dependency os

I can run ohai by itself and get a pile of data back.

Any clues?



Fabien Delpierre | 18 Apr 21:28 2014

Data bags and 'users' community cookbook

Hi there,
I need to start managing user accounts for a number of Linux VMs, so I set up a data bag with just one user (me), to start. I'm new to data bags, just started messing around with them earlier today, but I think I get the hang of it as it's pretty simple.

I'm also trying to use this community cookbook:

I got it working fine and it created the user from my data bag, with but one problem: in the JSON file containing my user's data, I said that my user should be a member of the wheel group, but the user was not added to the wheel group. There's no warning or error that I can see when I run chef-client, it just doesn't do anything with the groups I listed in the JSON file.

Here's my JSON file:
"id": "fd1",
"password": "<snip>",
"ssh_keys": [ "<snip>" ],
"groups": [ "sysadmin", "wheel", "test" ],
"shell": "/bin/bash",
"comment": "Fabien Delpierre",
"email": "<snip>",
"uid": "2001",
"home": "/home/fdelpierre"

As you can see I tried adding the user to a "test" group but nothing happened either, although I can imagine that's because there is no group called "test" on the system. Of course the wheel group does exist.

Looking at the README for the cookbook, there are bits that seem relevant to what I'm trying to do but I just don't understand what I'm supposed to do. Here's the excerpt from the docs that I'm struggling with:
If you have different requirements, for example:
  • You want to search a different data bag specific to a role such as mail. You may change the data_bag searched.
    • data_bag mail
  • You want to search for a different group attribute named postmaster. You may change the search_group attribute. This attribute defaults to the LWRP resource name.
    • search_group postmaster
  • You want to add the users to a security group other than the lightweight resource name. You may change the group_name attribute. This attribute also defaults to the LWRP resource name.
    • group_name wheel

Putting these requirements together our recipe might look like this:

ruby users_manage "postmaster" do data_bag "mail" group_name "wheel" group_id 10 end


So looking at the default recipe of the users cookbook, it looks like it's saying it's the place to add this sort of stuff -- so I added the following bits to it:

users_manage "sysadmin" do
data_bag "users"
group_name "wheel"
group_id 10

But of course that also did nothing.

It's probably something dumb but I've been messing around with this all afternoon today and I can't figure it out. Every time I get what I think is a bright idea, I make my tweak, re-run chef-client and nothing happens, it's rather frustrating.

Eric Herot | 17 Apr 23:20 2014

Still having a problem with Ohai plugins after upgrading to 7.0.2

Hey Chefs,

I’m posting this here hoping to find out if it’s just me. I noticed that upgrading to Chef 11.12.0 caused this problem to crop up:

Ohai::Exceptions::AttributeNotFound ----------------------------------- No such attribute: ‘passwd' Resource Declaration: --------------------- # In /tmp/kitchen/cache/cookbooks/et_users/recipes/reloadohai.rb 1: ohai 'reload' do 2: action :nothing 3: plugin 'passwd' 4: end

This was supposedly fixed in Chef 11.12.2/Ohai 7.0.2 (in response to OHAI–562) however I am still encountering this issue in the new version with this particular plugin, and constraining my test environment to Chef 11.10.4 seems to make the issue go away.

Can anyone tell me if this is the same issue discussed in OHAI–562 or if they are also still having this issue on the latest version of Chef?

– Eric

PS. #ChefConf2014 ftw!

Steve Hummingbird | 16 Apr 19:40 2014

How to configure opscode nginx properly

I have been running into some issues when configuring nginx using the opscode cookbook.
I have created a wrapper cookbook, which replaces the default config by putting my config into /etc/nginx/sites-available/default
However, the opscode cookbook always replaces that config with the default sample config. So, on every
chef run the nginx cookbook notices that the default config is no longer there and replaces my config, then
my wrapper cookbook notices that the config is not correct and replaces that file with my config again.
I was having the same issues when installing from source as well as using the ubuntu package installation.
So, in the end I am getting the feeling that I might be missing something fundamentally or a lot of other
people must have been running into the same issue. How do I configure nginx the right way using the opscode cookbook?


Brian Hatfield | 16 Apr 18:55 2014

Service Resource broken on OSX as of 11.12


I upgraded to 11.12 due to the heartbleed vulnerability and omnibus's embedded openssl - unfortunately, 11.12 has some service changes on OSX that break Chef (specifically, any time a service resource is re-opened, the chef run blows up).

I realize that many people are at Chef-Conf, but this is a major regression that has made Chef unusable on OSX. I'm hoping to get help/attention on this?

I'd be happy to submit a PR that reverts the service resource change, but I'm not sure if that's the right choice here.


S Ahmed | 16 Apr 17:09 2014

RE: rails, nginx, unicorn


Is there a rails,nginx, unicorn cookbook out there in chef land that is maintained by a web 3.0 company out there? :)

For some reason I see most people are still stuck with apache.

I know I can build my own (that's the beauty of chef hehe) but just curious if there any any cookbooks that are rails/ruby specific that are maintained by a company that just so happens to open source their devops.

Thanks for your guidance.
Christian Fröstl | 16 Apr 13:16 2014

Logging and references questions

Hi there,

I have problems with understanding the logging procedure with chef. 

I can log some information by using the following syntax:
         log „foo" do
        level :debug

Now I find in some cookbooks the following spelling:
Chef::Log.debug("Node has Chef Server Recipe? #{node.recipe?("chef-server")}“)

What does Chef::Log.debug exactly do?
I do not get any output if i run the chef-client in normal or in debug mode. What is the STDOUT from Chef::Log?

By the way, I am not really sure what Chef:: represents. Where can I find the class or module Chef?
In some scripts I the other references like Chef::Client::SANE_PATHS. Where can I find the content of such references?

Sorry if the questions are a litte bit stupid, but I am right new in writing Code.

Thank you very much,


Stewart, Curtis | 15 Apr 18:56 2014

Strainer vs Rake

We’re currently working with a chef-repo and I’m wondering what the better solution is, using a Rake or Strainer for testing.

I’m aware that cookbook-repo’s are preferred, but we’re unable to go that route at this time.

Possible options:
  • Repo-level Rakefile
  • Individual Rakefiles per cookbook directory
  • Both repo-level (global testing) and cookbook-level (single cookbook tests) Rakefiles
  • Repo-level Strainerfile
  • Individual Strainerfiles per cookbook directory

I can see advantages for each, wondering what other’s thoughts/preferences/experiences are.

Additional comments/thoughts:
  • Strainer provides complete isolation by copying a cookbook to a $SANDBOX directory.
  • Repo-level Rakefile would run all tests (including running specs in parallel with parallel_specs)

Tomasz Chmielewski | 15 Apr 15:51 2014

Fatal error: Uncaught exception 'Phalcon\Mvc\Dispatcher\Exception'with message 'Action 'route404' was not found on handler

I'm getting an error when trying to run bootstrap:

$ knife bootstrap --run-list "role[haproxy]" --json-attributes "{\"haproxy\": {\"server_name\":
\"\"}}" --ssh-user root

The command fails, because all cookbook files on the client are 544 byte files with the following content
(below, for /var/chef/cache/cookbooks/build-essential/libraries/matchers.rb):

Fatal error: Uncaught exception 'Phalcon\Mvc\Dispatcher\Exception' with message 'Action 'route404'
was not found on handler 'index'' in /var/www/cysoco/public/index.php:127
Stack trace:
#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('Action 'route40...', 5)
#1 [internal function]: Phalcon\Dispatcher->dispatch()
#2 /var/www/cysoco/public/index.php(127): Phalcon\Mvc\Application->handle()
#3 /var/www/cysoco/public/index.php(134): Application->main()
#4 {main}
  thrown in /var/www/cysoco/public/index.php on line 127

Knife bootstrap doesn't complain when uploading it, but of course breaks when trying to compile a broken file:

(...) Starting Chef Client, version 11.12.2 resolving cookbooks for run list: ["haproxy"] Synchronizing Cookbooks:   - build-essential   - cpu   - haproxy Compiling Cookbooks... ================================================================================ Recipe Compile Error in /var/chef/cache/cookbooks/build-essential/libraries/matchers.rb ================================================================================ SyntaxError ----------- /var/chef/cache/cookbooks/build-essential/libraries/matchers.rb:2:
syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('

On my worstation side, the file looks fine:

$ cat cookbooks/build-essential/libraries/matchers.rb
if defined?(ChefSpec)
  def install_xcode_command_line_tools(resource_name), :install, resource_name)

Any ideas why this breaks?

I'm using this on workstation and client:

$ dpkg -l|grep chef
ii  chef                                                  11.12.2-1                                           amd64        The full stack of chef

Server has this installed:

# dpkg -l|grep chef
ii  chef-server                      11.0.12-1.ubuntu.12.04            The full stack of chef-server


Tomasz Chmielewski

Vishal Totare | 15 Apr 15:44 2014

Installation of maven on windows machine


Can anyone help to install maven plugin on windows machine using chef.
Since while installing it first am getting "ark" installation error for ark have downloaded it from opscode site.
Now while executing the chef-client on windows machine getting libtool error.
For that i am trying to install libtool then getting the attached error.

If anyone have other steps to install maven on windows machine then please assist

Thanks in advance.
Lamont Granquist | 14 Apr 22:38 2014

omnitruck/ deployment

omnitruck and just got a minor version release that should 
not affect anyone:

- added endpoints and a -P chefdk option to for upcoming chefdk

   (there are no artifacts yet to download so -P chefdk should 404 -- 
don't send us tickets, we're aware its not live yet)

- MacOSX .dmg support

   (again, no .dmg artifacts have been published, so .pkgs will still be 
downloaded and installed for chef-client on Mac)

- support for -n nightly releases

   (i don't think we have any of these published yet, so again this will 
probably just 404 if you try to use it -- at best you'll find some
    ancient nightly-stamped version of chef that someone uploaded a long 
time ago...)

- smartos detection in

   (and we have no built smartos artifacts, this is only the 
platform detection bit, so again it'll 404 if you try to use it)

so...  mostly this is pretty useless to you all today and just sets the 
foundation for future goodness, and hopefully this incremental change
does not break anyone...