chef-solo error Errno::ENOENT: No such file or directory - solo.rb chef-solo error Errno::ENOENT: No such file or directory - solo.rb nginx nginx

chef-solo error Errno::ENOENT: No such file or directory - solo.rb


This is due to the way chef works. It changes directory to / to avoid any kind of permissions issues, but this means plugins that need access to command line arguments won't know how to get to your relative paths any more.

There is a bug filed with the chef code to address the issue.

For now, using full paths for your chef-solo arguments fixes the problems. E.g.

$ chef-solo -c /full/path/to/solo.rb -j /full/path/to/node.json -l debug

Or as someone else pointed out, removing the /etc/chef/ohai_plugins/README file will also "fix" the problem. Although not in a real way, since all that is doing is triggering a modification time update on the ohai_plugins folder, triggering chef to reload everything. That functionality is not guaranteed and may break before the aforementioned bug is fixed.


This appears to be a bug with chef-solo and chef-client, I did some digging and opened a bug here: http://tickets.opscode.com/browse/COOK-1490?focusedCommentId=25572#comment-25572

Like has already been suggested the workaround is to use the absolute path to the config, any relative path has the same problem. This also happens whenever the ohai recipe is run without changing any plugins, it's not specific to the nginx cookbook.


The problem most likely is "/etc/chef/ohai_plugins/README" which get recreated with each run. You just need to delete it before running chef-solo.