1

我正在尝试更新我的食谱并将其上传到我的厨师服务器。我正面临这个问题:

sudo knife cookbook upload demo -VV
INFO: Using configuration from /home/centos/chef-repo/.chef/knife.rb
ERROR: Could not find cookbook demo in your cookbook path, skipping it
DEBUG: Cannot find a cookbook named demo; did you forget to add metadata to a cookbook? (https://docs.chef.io/config_rb_metadata.html) (Chef::Exceptions::CookbookNotFoundInRepo)
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/cookbook_loader.rb:127:in `[]'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife/cookbook_upload.rb:173:in `block in cookbooks_to_upload'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife/cookbook_upload.rb:170:in `each'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife/cookbook_upload.rb:170:in `cookbooks_to_upload'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife/cookbook_upload.rb:208:in `warn_about_cookbook_shadowing'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife/cookbook_upload.rb:96:in `run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:443:in `block in run_with_pretty_exceptions'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:442:in `run_with_pretty_exceptions'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:219:in `run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/application/knife.rb:156:in `run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/bin/knife:25:in `<top (required)>'
/bin/knife:58:in `load'
/bin/knife:58:in `<main>'
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#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 devops
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to https://serveraddress/organizations/us-int-core/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-Server-API-Version: 1
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.1;
DEBUG: X-OPS-USERID: devops
DEBUG: X-OPS-TIMESTAMP: 2017-01-25T13:53:38Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb...........=
DEBUG: X-OPS-AUTHORIZATION-1: j1fkjmn1FAS...........
DEBUG: X-OPS-AUTHORIZATION-2: g2TCxj1fkjm...........
DEBUG: X-OPS-AUTHORIZATION-3: PLbt7DY9LbFJ..........
DEBUG: X-OPS-AUTHORIZATION-4: RHIvVfQD6qve..........
DEBUG: X-OPS-AUTHORIZATION-5: Hvn50AjLwasd1Z........
DEBUG: X-OPS-AUTHORIZATION-6: murM3EwGJWic..........==
DEBUG: HOST: ip-172-20-88-20:443
DEBUG: X-REMOTE-REQUEST-ID: 33cf1aa9-31f3-43b0-89b9-........
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.11.2.1
DEBUG: date: Wed, 25 Jan 2017 13:54:12 GMT
DEBUG: content-type: application/json
DEBUG: content-length: 2
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.11.1+20161118001025
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: Content-Length validated correctly.
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: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Uploaded 0 cookbook.

查看带有 INFO 标记的第一行

INFO: Using configuration from /home/centos/chef-repo/.chef/knife.rb

上面的行使用的是刀配置:

cat /home/centos/chef-repo/.chef/knife.rb

log_level                :info
log_location             STDOUT
node_name                'devops'
client_key               '/home/centos/chef-repo/.chef/devops.pem'
validation_client_name   'us-int-core-validator'
validation_key           '/home/centos/chef-repo/us-int-core-validator.pem'
chef_server_url          'https://serveripaddress:443/organizations/us-int-core'
syntax_check_cache_path  '/home/centos/chef-repo/.chef/syntax_check_cache'
cookbook_path            [ '~/chef-repo/cookbooks/' ]

进入该路径的是我的食谱以及我要上传的演示食谱。

我不知道路径有什么问题。一切看起来都很好,但我错过了一些东西。有什么建议么?

检查食谱清单

ll /home/centos/chef-repo/cookbooks/
total 28
drwxr-xr-x. 10 root root 4096 Jan 19 21:41 apache
-rwxr-xr-x.  1 root root  588 Jan 19 21:09 chefignore
drwxr-xr-x.  8 root root 4096 Jan 24 20:42 demo
drwxr-xr-x.  9 root root 4096 Jan 19 21:41 docker
drwxr-xr-x.  9 root root 4096 Jan 19 21:41 ntp

上面的列表显示了路径中的所有说明书,演示就在那里。

4

1 回答 1

0
cookbook_path  

在您的 knife.rb 中可能会导致相同的错误。

于 2022-02-16T03:19:22.897 回答