Chef Server return 404 for all knife and chef-client request

元气小坏坏 提交于 2020-01-06 13:12:06

问题


I am trying to setup chef-server and chef-client for automatic deployment of packages on virtual machines run on Openstack.

I am following the instructions on https://docs.chef.io/install_server.html. The version of the package is chef-server 12.0.8, on ubuntu 14.04 server (chef-server-core_12.0.8-1_amd64.deb). Several attempts have been made, always with a clean machine, and always with the same result, even with a slightly older chef-server version (12.0.3, I believe). User gets created, organization gets created. I've also pulled chef client directly from chef site, via the install.sh script provided (12.3.something).

Symptoms:

knife ssl check returns success, however:

knife client list returns HTTP error 404:

ERROR: The object you are looking for could not be found ...

404 - Not Found

Sorry, I can't find what you are looking for.

Doesn't matter if I run it from server directly, or from another machine (knife bootstrap also fails, so I install manually). The server (FQDN: chef.cluster.internal) is resolvable from all machines, and that is the server_url used for client.rb/knife.rb. Self-signed certificate is pulled everywhere where needed.

Nginx access logs from chef-server machine:

192.168.10.85 - - [15/May/2015:12:16:56 +0000]  "GET /clients HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T12:16:56Z" "2jmj7l5rSw0yVb/vlWAYkK/YBwk=" 995
192.168.10.85 - - [15/May/2015:11:38:50 +0000]  "POST /nodes HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:38:50Z" "5FBeTmym0Tm05estESshBGJrumI=" 1047
192.168.10.86 - - [15/May/2015:11:37:36 +0000]  "POST /nodes HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:37:36Z" "5FBeTmym0Tm05estESshBGJrumI=" 1047
192.168.10.85 - - [15/May/2015:11:38:50 +0000]  "PUT /nodes/dns-server HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:38:50Z" "5FBeTmym0Tm05estESshBGJrumI=" 1057

... and so on. So, the server does get the request, and the suggestion from chef-client that my chef_server_url might be invalid is not true.

All other settings have been left as default. The strange thing is that I have an older chef setup, from two or three months ago, that works without problems.

I'm out of ideas. Any help would be most welcome and highly appreciated.

Edit 1: I've just imported the created user certificate, and the chef nginx certificate to the mentioned knife older installation, and I am successfully able to run knife client list. So, it seems that the local version includes /organizations/orgname/nodes into request. Why is that missing on the blank client?


回答1:


Ok, so I was able to make progress by reconfiguring knife and chef-client on server with the full chef_server_url as generated on the older machine.



来源:https://stackoverflow.com/questions/30259567/chef-server-return-404-for-all-knife-and-chef-client-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!