0
votes



While attempting to upload my cookbook to the server, I'm getting the following error statement.

"Uploading first_cb [0.1.0]
ERROR: ArgumentError: too short control escape"

And the command was:
$ knife cookbook upload first_cb

The default.rb contains the foolowing code:

package "httpd" do
    action :install
end

service "httpd" do
    action [:enable, :start]
end

template "/var/www/html/index.html" do
    source "index.html"
    mode "0644"
end

knife.rb

current_dir = File.dirname(__FILE__) 
log_level :info 
log_location STDOUT 
node_name "ktgirish" 
client_key "#{current_dir}/ktgirish.pem" 
chef_server_url "https://api.chef.io/organizations/girish123" 
cookbook_path ["#{current_dir}/../cookbooks"]

Thanks in advance...!!!

1
Maybe an unescaped character in your paths or knife.rb? stackoverflow.com/questions/36111835/… - Harichandan Pulagam
Sorry, I don't get it.. I'm very new to Chef.. Could you please tell me what do you mean by unescaped character? - ktgirish
Can you paste your knife.rb here? Are you using Windows? - Harichandan Pulagam
Yes I'm using Windows machine as workstation and ubuntu as node. Here is the knife.rb :<br> current_dir = File.dirname(__FILE__) log_level :info log_location STDOUT node_name "ktgirish" client_key "#{current_dir}/ktgirish.pem" chef_server_url "https://api.chef.io/organizations/girish123" cookbook_path ["#{current_dir}/../cookbooks"] - ktgirish

1 Answers

0
votes

I think you need to pass source 'index.html.erb' instead of index.html. you need to create and index.html.erb file in the template folder.