Cannot knife client list


#1

Hi, Folks,

I can no longer use “knife client list” to list my clients on my chef
server.
I used to be able to do this earlier today using knife and using server API.
Other commands such as "knife client show " works fine.

Here is my stack trace in server.log:

[Tue, 08 May 2012 23:15:36 -0700] INFO: Authenticating client
knife-sjang0-sde
merb : chef-server (api) : worker (port 4000) ~ Started request handling:
Tue May 08 23:15:36 -0700 2012
merb : chef-server (api) : worker (port 4000) ~ Params: {“action”=>“index”,
“controller”=>“clients”}
merb : chef-server (api) : worker (port 4000) ~ Option name’s value does
not match regular expression /^[-[:alnum:]_.]+$/ -
(Chef::Exceptions::ValidationFailed)
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:196:in
_pv_regex' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:69:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:69:in
validate' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:66:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:66:in
validate' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:56:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:56:in
validate' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/mixin/params_validate.rb:88:inset_or_return’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/api_client.rb:88:in name' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/api_client.rb:166:injson_create’
/usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in parse' /usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:inparse’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/json_compat.rb:40:in
from_json' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:223:inapi_request’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:288:in
retriable_rest_request' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:218:inapi_request’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:114:in get_rest' /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/couchdb.rb:181:inlist’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/lib/chef/api_client.rb:178:in
cdb_list' /usr/lib/ruby/gems/1.8/gems/chef-server-api-0.10.4/app/controllers/clients.rb:32:inindex’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:321:in
send' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:321:in_call_action’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:289:in
_dispatch' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:284:incatch’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:284:in
_dispatch' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/merb_controller.rb:285:in_dispatch’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/merb_controller.rb:262:in
_call' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/merb_controller.rb:252:incall’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/dispatch/dispatcher.rb:91:in
dispatch_action' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/dispatch/dispatcher.rb:69:inhandle’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/dispatch/dispatcher.rb:29:in
handle' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/rack/application.rb:17:incall’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/rack/middleware/static.rb:28:in
call' /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/content_length.rb:14:incall’
/usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:80:in
pre_process' /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:78:incatch’
/usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:78:in
pre_process' /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:53:inprocess’
/usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/connection.rb:38:in
receive_data' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun_machine’
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run' /usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/backends/base.rb:61:instart’
/usr/lib/ruby/gems/1.8/gems/thin-1.3.1/lib/thin/server.rb:159:in start' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/rack/adapter/thin.rb:30:instart_server’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/rack/adapter/abstract.rb:305:in
start_at_port' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/rack/adapter/abstract.rb:138:instart’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:174:in
bootup' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:159:indaemonize’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:143:in
fork' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:143:indaemonize’
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:35:in
start' /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core.rb:165:instart’
/usr/lib/ruby/gems/1.8/gems/chef-server-api-0.10.4/bin/chef-server:84
/usr/bin/chef-server:19:in `load’
/usr/bin/chef-server:19
merb : chef-server (api) : worker (port 4000) ~ Params: {“action”=>“index”,
“controller”=>“clients”}
merb : chef-server (api) : worker (port 4000) ~ {:action_time=>0.000509,
:after_filters_time=>1.7e-05, :before_filters_time=>6.3e-05,
:dispatch_time=>0.066583}
merb : chef-server (api) : worker (port 4000) ~

Has anyone seen this? Any suggestions?

-Steve


#2

On Wed, May 9, 2012 at 2:17 AM, Steve Jang estebanjang@gmail.com wrote:

I can no longer use “knife client list” to list my clients on my chef
server.
I used to be able to do this earlier today using knife and using server API.
Other commands such as "knife client show " works fine.

It looks like you somehow created a client with an empty name.

“Option name’s value does not match regular expression”

Notice the double space between ‘value’ and ‘does’? That should be the
name of the client object.

If I try to create client with an empty name by running ‘knife client
create foo’ and then changing the name to “” in the editor, I get the
same error:

knife client create foo ERROR: Chef::Exceptions::ValidationFailed: Option name's value does not match regular expression /^[\-[:alnum:]_\.]+/

I’m still thinking about the easiest way to find and remove this client.

Bryan


#3

Ah. That’s brilliant. I will try to fix this and see if I can get it to
work again.

-Steve

On Thu, May 10, 2012 at 1:04 PM, Bryan McLellan btm@loftninjas.org wrote:

On Wed, May 9, 2012 at 2:17 AM, Steve Jang estebanjang@gmail.com wrote:

I can no longer use “knife client list” to list my clients on my chef
server.
I used to be able to do this earlier today using knife and using server
API.
Other commands such as "knife client show " works fine.

It looks like you somehow created a client with an empty name.

“Option name’s value does not match regular expression”

Notice the double space between ‘value’ and ‘does’? That should be the
name of the client object.

If I try to create client with an empty name by running ‘knife client
create foo’ and then changing the name to “” in the editor, I get the
same error:

knife client create foo ERROR: Chef::Exceptions::ValidationFailed: Option name's value does not match regular expression /^[\-[:alnum:]_\.]+/

I’m still thinking about the easiest way to find and remove this client.

Bryan