Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CHEF - Attempt to use relative path 'foo when current directory is outside the repository path

When I try and run knife upload roles or knife upload /roles it gives the following error

cd ~/my-chef-repo
knife upload roles -n -V
INFO: Using configuration from /Users/sowen/.chef/knife.rb
ERROR: Attempt to use relative path 'roles' when current directory is outside the repository path

My knife.rb file

cookbook_path            "/Users/me/my-chef-repo"
like image 727
spuder Avatar asked Jul 23 '15 02:07

spuder


1 Answers

This can happen when the cookbook_path is not properly set in your knife.rb

Do the following:

Make sure you have a trailing slash in your knife.rb

cookbook_path            "/Users/me/my-chef-repo/"

Or pass in the repo path from the commandline

knife upload roles -n -VV --chef-repo-path /Users/me/my-chef-repo/
like image 109
spuder Avatar answered Sep 30 '22 08:09

spuder