Knife cookbook update is not working


#1

I am keep getting below error while uploading cookbook.

ERROR: TypeError: can’t convert nil into String

C:\Users\XXXXXXl\chef-repo\chef-repo\branches\chef-200>knife cookbook
upload weblogic -VV
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as dpatel
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to
https://lpchef01.lifelock.ad/organizations/lifelock/cookbooks?num_versions=all
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: dpatel
DEBUG: X-OPS-TIMESTAMP: 2015-01-02T23:22:39Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1:
zK2O4E+dv2gdjxbk/itTjp3vxpF/ztkp1so51tZz/UF8IJJ+B5hzi95v+OIk
DEBUG: X-OPS-AUTHORIZATION-2:
oANEO9azwNXO3EGXH4KgIVJJgyUxBsK+AdwIZxmGEUTC1RJ3p7xJ6zl2SkWd
DEBUG: X-OPS-AUTHORIZATION-3:
ioAwinBH+/GFBoMvW1A0taMk6IeVpmoykXVSO2dJEzrQGJ7dTBMGrwNIm4Vb
DEBUG: X-OPS-AUTHORIZATION-4:
ZsvKnpnLZELI8WoF/wYDX6xqSmXW1XKs9rthQLbyAMNNdftmeoTcx9Q1RPVZ
DEBUG: X-OPS-AUTHORIZATION-5:
9zC4Vl7KFFyr2VUgwRHq9x94G3A8ilfD8UB7OGE9aOUwN/xAUMazwyb5ExH2
DEBUG: X-OPS-AUTHORIZATION-6: lBopem5zyRrk8+UABclje/5I2l0vjFYMPvQTb1H5sQ==
DEBUG: HOST: lpchef01.lifelock.ad:443
DEBUG: X-REMOTE-REQUEST-ID: 9cdce2c7-52db-4aff-9e32-b19ac2970dbb
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: nginx/1.0.12
DEBUG: date: Fri, 02 Jan 2015 23:22:42 GMT
DEBUG: content-type: application/json; charset=utf-8
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: status: 200 OK
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response,
cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Uploading weblogic [0.5.7]
INFO: Validating ruby files
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:58:in
join': can't convert nil into String (TypeErro from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:58:ininclude?‘
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:143:in
validated?' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:118:inblock in untested_ruby_files’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:117:in
reject' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:117:inuntested_ruby_files’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook/syntax_check.rb:151:in
validate_ruby_files' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook_uploader.rb:152:inblock in validate_cookbooks’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook_uploader.rb:149:in
each' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook_uploader.rb:149:invalidate_cookbooks’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook_uploader.rb:48:in
upload_cookbooks' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife/cookbook_upload.rb:243:inupload’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife/cookbook_upload.rb:129:in
block in run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife/cookbook_upload.rb:126:ineach’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife/cookbook_upload.rb:126:in
run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife.rb:493:inrun_with_pretty_exceptions’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/knife.rb:174:in
run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application/knife.rb:139:inrun’
from
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/bin/knife:25:in
<top (required)>' from C:/opscode/chef/bin/knife:23:inload’
from C:/opscode/chef/bin/knife:23:in `’


Thanks & Regards

Dharmesh Patel


#2

On Fri, 2 Jan 2015, dharmesh patel wrote:

I am keep getting below error while uploading cookbook.

ERROR: TypeError: can’t convert nil into String

Post your knife.rb? What do you have set as syntax_check_cache_path and/or
the legacy cache_options setting?

  • Julian

[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#3

Julian,

Here is the info

require ‘yaml’

config = YAML::load(File.open(ENV[“CHEF_CONFIG”]))
provider = ENV[‘CHEF_PROVIDER’] || "internal"
environment = ENV[‘CHEF_ENVIRONMENT’] || “development”

log_level :info
log_location STDOUT
node_name config[environment][“user”]
client_key config[environment][“user_key”]
validation_client_name config[environment][“validation_key_name”]
validation_key config[environment][“validation_key”]
chef_server_url config[environment][“url”]
cache_type 'BasicFile’
cache_options(:path => config[environment][“cache_path”])
cookbook_path ["#{Dir.pwd}/cookbooks"]
cookbook_copyright "Lifelock"
cookbook_email "automation@lifelock.com"
cookbook_license "apachev2"
encrypted_data_bag_secret “#{Dir.pwd}/data_bags/encrypted_data_bag_secret”

knife[:ssh_user] = config[environment][“ssh_user”]

knife[:vsphere_host] = config[“vsphere_host”]
knife[:vsphere_user] = config[“vsphere_user”]
knife[:vsphere_pass] = config[“vsphere_pass”]
knife[:vsphere_dc] = config[“vsphere_dc”]
knife[:vsphere_insecure] = config[“vsphere_insecure”]

case provider
when "amazon"
knife[:aws_access_key_id] = config[“aws_access_key_id”]
knife[:aws_secret_access_key] = config[“aws_secret_access_key”]
end

On Fri, Jan 2, 2015 at 6:02 PM, Julian C. Dunn jdunn@aquezada.com wrote:

On Fri, 2 Jan 2015, dharmesh patel wrote:

I am keep getting below error while uploading cookbook.

ERROR: TypeError: can’t convert nil into String

Post your knife.rb? What do you have set as syntax_check_cache_path and/or
the legacy cache_options setting?

  • Julian

[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


Thanks & Regards

Dharmesh Patel (B.E.I.T)


#4

I’m unsure how you would derive config[environment][‘cache_path’] from
this configuration file?

  • Julian

On Fri, Jan 2, 2015 at 9:22 PM, dharmesh patel
dharmeshradadiya@gmail.com wrote:

Julian,

Here is the info

require ‘yaml’

config = YAML::load(File.open(ENV[“CHEF_CONFIG”]))
provider = ENV[‘CHEF_PROVIDER’] || "internal"
environment = ENV[‘CHEF_ENVIRONMENT’] || “development”

log_level :info
log_location STDOUT
node_name config[environment][“user”]
client_key config[environment][“user_key”]
validation_client_name config[environment][“validation_key_name”]
validation_key config[environment][“validation_key”]
chef_server_url config[environment][“url”]
cache_type 'BasicFile’
cache_options(:path => config[environment][“cache_path”])
cookbook_path ["#{Dir.pwd}/cookbooks"]
cookbook_copyright "Lifelock"
cookbook_email "automation@lifelock.com"
cookbook_license "apachev2"
encrypted_data_bag_secret “#{Dir.pwd}/data_bags/encrypted_data_bag_secret”

knife[:ssh_user] = config[environment][“ssh_user”]

knife[:vsphere_host] = config[“vsphere_host”]
knife[:vsphere_user] = config[“vsphere_user”]
knife[:vsphere_pass] = config[“vsphere_pass”]
knife[:vsphere_dc] = config[“vsphere_dc”]
knife[:vsphere_insecure] = config[“vsphere_insecure”]

case provider
when "amazon"
knife[:aws_access_key_id] = config[“aws_access_key_id”]
knife[:aws_secret_access_key] = config[“aws_secret_access_key”]
end

On Fri, Jan 2, 2015 at 6:02 PM, Julian C. Dunn jdunn@aquezada.com wrote:

On Fri, 2 Jan 2015, dharmesh patel wrote:

I am keep getting below error while uploading cookbook.

ERROR: TypeError: can’t convert nil into String

Post your knife.rb? What do you have set as syntax_check_cache_path and/or
the legacy cache_options setting?

  • Julian

[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


Thanks & Regards

Dharmesh Patel (B.E.I.T)


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]