Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux chef 12配置错误-运行knife cli时未找到对象_Linux_Chef Infra_Knife - Fatal编程技术网

Linux chef 12配置错误-运行knife cli时未找到对象

Linux chef 12配置错误-运行knife cli时未找到对象,linux,chef-infra,knife,Linux,Chef Infra,Knife,在Ubuntu 14.1上运行chef 12。使用自签名证书来设置服务器,当我尝试从我的客户端运行刀子命令时,它失败,并出现以下错误。任何操作都有相同的错误。在查询过程中,chef服务器日志没有任何错误或信息 刀形 [root@ip-10-233-2-40 ~]# cat ~/.chef/knife.rb log_level :debug log_location STDOUT node_name 'admin

在Ubuntu 14.1上运行chef 12。使用自签名证书来设置服务器,当我尝试从我的客户端运行刀子命令时,它失败,并出现以下错误。任何操作都有相同的错误。在查询过程中,chef服务器日志没有任何错误或信息

刀形

[root@ip-10-233-2-40 ~]# cat ~/.chef/knife.rb 
log_level                :debug
log_location             STDOUT
node_name                'admin'
client_key               '/root/.chef/admin.pem'
validation_client_name   'dev'
validation_key           '/root/.chef/dev-validator.pem'
chef_server_url          'https://chef.example.com/organizations/dev'
syntax_check_cache_path  '/root/.chef/syntax_check_cache'

root@ip-10-233-2-177:~/ssl-certs# chef-server-ctl status
run: bookshelf: (pid 1092) 1998s; run: log: (pid 1064) 1998s
run: nginx: (pid 6140) 723s; run: log: (pid 1063) 1998s
run: oc_bifrost: (pid 1077) 1998s; run: log: (pid 1058) 1998s
run: oc_id: (pid 1091) 1998s; run: log: (pid 1061) 1998s
run: opscode-erchef: (pid 1090) 1998s; run: log: (pid 1066) 1998s
run: opscode-expander: (pid 1076) 1998s; run: log: (pid 1060) 1998s
run: opscode-expander-reindexer: (pid 1096) 1998s; run: log: (pid 1059) 1998s
run: opscode-solr4: (pid 1075) 1998s; run: log: (pid 1057) 1998s
run: postgresql: (pid 1085) 1998s; run: log: (pid 1056) 1998s
run: rabbitmq: (pid 1062) 1998s; run: log: (pid 1046) 1998s
run: redis_lb: (pid 6124) 723s; run: log: (pid 1065) 1998s


 [root@ip-10-233-2-40 ~]# knife environment create staging
    ERROR: The object you are looking for could not be found
    /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError)
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body'
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:499:in `rescue in format_rest_error'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:497:in `format_rest_error'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:459:in `humanize_http_exception'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:418:in `humanize_exception'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:409:in `rescue in run_with_pretty_exceptions'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:400:in `run_with_pretty_exceptions'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:203:in `run'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/knife.rb:142:in `run'
        from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/knife:25:in `<top (required)>'
        from /usr/bin/knife:54:in `load'
        from /usr/bin/knife:54:in `<main>'`enter code here`
[root@ip-10-233-2-40~]#cat~/.chef/know.rb
日志级别:调试
日志位置标准输出
节点\名称“admin”
client_key'/root/.chef/admin.pem'
验证\客户端\名称“dev”
验证密钥'/root/.chef/dev validator.pem'
厨师长\u服务器\u url'https://chef.example.com/organizations/dev'
语法检查缓存路径'/root/.chef/syntax检查缓存'
root@ip-10-233-2-177:~/ssl证书#厨师长服务器ctl状态
运行:书架:(pid 1092)1998s;运行:日志:(pid 1064)1998s
运行:nginx:(pid 6140)723s;运行:日志:(pid 1063)1998s
运行:oc_bifrost:(pid 1077)1998s;运行:日志:(pid 1058)1998s
运行:oc_id:(pid 1091)1998s;运行:日志:(pid 1061)1998s
运行:opscode erchef:(pid 1090)1998s;运行:日志:(pid 1066)1998s
运行:opscode扩展器:(pid 1076)1998s;运行:日志:(pid 1060)1998s
运行:opscode扩展器重新索引器:(pid 1096)1998s;运行:日志:(pid 1059)1998s
运行:opscode-solr4:(pid 1075)1998s;运行:日志:(pid 1057)1998s
运行:postgresql:(pid 1085)1998s;运行:日志:(pid 1056)1998s
运行:rabbitmq:(pid 1062)1998s;运行:日志:(pid 1046)1998s
运行:redis_lb:(pid 6124)723s;运行:日志:(pid 1065)1998s
[root@ip-10-233-2-40~]#刀环境创建暂存
错误:找不到您正在查找的对象
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in'stream_check':nil:NilClass(NoMethodError)的未定义方法“closed”
from/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in'read_body'
from/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in'body'
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:499:“格式中的救援\u rest\u错误”
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:497:格式错误
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:459:in“人性化”http\u例外
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:418:in“人性化”例外
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:409:in“运行中的救援,带漂亮的例外”
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:400:在“运行时有漂亮的例外”
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:203:in'run'
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/knife.rb:142:在“运行”中
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/knife:25:in`'
from/usr/bin/knife:54:装入
from/usr/bin/knife:54:in``在此处输入代码`
更新

[root@ip-10-233-2-40 ~]# knife client list -VV
INFO: Using configuration from /root/.chef/knife.rb
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 admin
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Using 10.233.0.182:3128 for proxy
DEBUG: Initiating GET to https://chef.example.com/organizations/dev/clients
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: admin
DEBUG: X-OPS-TIMESTAMP: 2015-10-21T17:40:17Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: m/vlWcZBPE7XUN7qhX6t/T9hXTT+2x/JehpOYq6My1ffEID6n+U+Xc+lHWto
DEBUG: X-OPS-AUTHORIZATION-2: Lq4ZEfNT1ltZkkYZ9Ii8EoF3eajUQmb2buwKMWae3yvxrZ5rgllJPf5q4gy3
DEBUG: X-OPS-AUTHORIZATION-3: IEqUUst+KzmoRHCiC1LeYxKXy+oeo45F4Vw4xHlOWgS0piqXfrmXnkrxs8Um
DEBUG: X-OPS-AUTHORIZATION-4: ZDqdLvcQ10WjoW9Wz4F2+fRh/BdRHjwMF80LVPwrtylf+GbdIhmCU3xxVvOq
DEBUG: X-OPS-AUTHORIZATION-5: w1Z2p03UcpRfMZy1pQV59A0Y3yv57Db5n3PJdjD9TlitNK++/HXcqO3IfO2U
DEBUG: X-OPS-AUTHORIZATION-6: 0QbZYZaeGSkJw0ArQDeffnjbpzAhSXhUfbs+in9tRg==
DEBUG: HOST: chef.example.com:443
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-REMOTE-REQUEST-ID: 6a00a52a-7eeb-43d6-920d-fffc685c1b2a
DEBUG: ---- End HTTP Request Header Data ----
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!': 404 "Not Found" (Net::HTTPServerException)
    from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:128:in `value'
    from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:915:in `connect'
    from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
    from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:852:in `start'
    from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:1375:in `request'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http/basic_client.rb:65:in `request'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:266:in `block in send_http_request'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:298:in `block in retrying_http_errors'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:296:in `loop'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:296:in `retrying_http_errors'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:260:in `send_http_request'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:143:in `request'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:110:in `get'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/api_client_v1.rb:198:in `list'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/client_list.rb:38:in `run'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:405:in `block in run_with_pretty_exceptions'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/local_mode.rb:44:in `with_server_connectivity'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:404:in `run_with_pretty_exceptions'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:203:in `run'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/knife.rb:142:in `run'
    from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/knife:25:in `<top (required)>'
    from /usr/bin/knife:54:in `load'
    from /usr/bin/knife:54:in `<main>'


[root@ip-10-233-2-40 ~]# telnet chef.example.com 443
Trying 10.233.2.177...
Connected to chef.example.com.
Escape character is '^]'.
[root@ip-10-233-2-40~]#刀具客户列表-VV
信息:使用/root/.chef/knife.rb中的配置
调试:Chef::HTTP调用Chef::HTTP::JSONInput#handle#u请求
调试:Chef::HTTP调用Chef::HTTP::JSONOutput#handle#U请求
调试:Chef::HTTP调用Chef::HTTP::CookieManager#处理请求
调试:Chef::HTTP调用Chef::HTTP::解压缩程序#处理#请求
调试:Chef::HTTP调用Chef::HTTP::Authenticator#handle_请求
调试:以管理员身份对请求进行签名
调试:Chef::HTTP调用Chef::HTTP::RemoteRequestID#处理#请求
调试:对代理使用10.233.0.182:3128
调试:启动GET tohttps://chef.example.com/organizations/dev/clients
调试:---HTTP请求头数据:----
调试:接受:应用程序/json
调试:接受编码:gzip;q=1.0,放气;q=0.6,同一性;q=0.3
调试:X-OPS-SIGN:algorithm=sha1;版本=1.0;
调试:X-OPS-USERID:admin
调试:X-OPS-TIMESTAMP:2015-10-21T17:40:17Z
调试:X-OPS-CONTENT-HASH:2jmj7l5rSw0yVb/vlWAYkK/YBwk=
调试:X-OPS-AUTHORIZATION-1:m/vlWcZBPE7XUN7qhX6t/T9hXTT+2x/JehpOYq6My1ffEID6n+U+Xc+lHWto
调试:X-OPS-AUTHORIZATION-2:LQ4ZEFNT1LTZKYZ9II8EOF3EAJUQMB2BUWKMWAE3YVXRZ5RGLLJPF5Q4GY3
调试:X-OPS-AUTHORITION-3:IEqUUst+KZMORCIC1LEYXKXY+OEO45F4VW4HLOWGS0PIQXFRMXNKRXS8UM
调试:X-OPS-AUTHORIZATION-4:ZDqdLvcQ10WjoW9Wz4F2+fRh/BdRHjwMF80LVPwrtylf+GbdIhmCU3xxVvOq
调试:X-OPS-AUTHORIZATION-5:w1Z2p03UcpRfMZy1pQV59A0Y3yv57Db5n3PJdjD9TlitNK++/HXcqO3IfO2U
调试:X-OPS-AUTHORIZATION-6:0QbZYZaeGSkJw0ArQDeffnjbpzAhSXhUfbs+in9tRg==
调试:主机:chef.example.com:443
调试:X-Ops-Server-API-Version:1
调试:X-REMOTE-REQUEST-ID:6a00a52a-7eeb-43d6-920d-fffc685c1b2a
调试:-----结束HTTP请求头数据----
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in'error!':404“未找到”(Net::HTTPServerException)
from/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:128:in'value'
from/opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:915:in'connect'
from/opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:863:in'do_start'
from/opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:852:in'start'
from/opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:1375:in'request'
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http/basic_-client.rb:65:in“请求”
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:266:'block in send_http_request'
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:298:“阻止重试\u http\u错误”
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:296:in'loop'
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:296:在“重试http\u错误”中
from/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/http.rb:260:“发送http请求”中的
来自/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5。