Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling old-style registration results in error 500 #139

Open
ghost opened this issue Apr 6, 2015 · 2 comments
Open

Disabling old-style registration results in error 500 #139

ghost opened this issue Apr 6, 2015 · 2 comments
Labels
Status: Good First Issue An issue ready for a new contributor. Status: To be prioritized Indicates that product needs to prioritize this issue. Triage: Confirmed Indicates and issue has been confirmed as described. Triage: Try Reproducing Indicates that this issue needs to be reproduced. Type: Bug Does not work as expected.

Comments

@ghost
Copy link

ghost commented Apr 6, 2015

When I want to bootstrap a new node after disabling old-style registration, I get a 500:

knife bootstrap <new-node> -r "role[base]" 
Creating new client for 
ERROR: Server returned error 500 for https://*******.dock42.com/clients, retrying 1/5 in 4s
ERROR: Server returned error 500 for https://*******.dock42.com/clients, retrying 2/5 in 7s
ERROR: Server returned error 500 for https://*******.dock42.com/clients, retrying 3/5 in 16s
==> /var/log/opscode/opscode-erchef/erchef.log <==
2015-04-06 12:51:14.716 [error] {<<"method=POST; path=/clients; status=500; ">>,{error,badarg,[{re,run,[null,{re_pattern,0,0,<<69,82,67,80,91,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,0,39,25,77,0,0,0,0,0,96,255,3,254,255,255,135,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,71,26,84,0,39,0>>}],[]},{chef_client,valid_name,1,[{file,"src/chef_client.erl"},{line,293}]},{chef_client,parse_binary_json,3,[{file,"src/chef_client.erl"},{line,232}]},{chef_wm_clients,validate_request,3,[{file,"src/chef_wm_clients.erl"},{line,89}]},{oc_chef_wm_base,malformed_request,2,[{file,"src/oc_chef_wm_base.erl"},{line,753}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,186}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,142}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]}]}}

==> /var/log/opscode/opscode-erchef/crash.log <==
2015-04-06 12:51:14 =ERROR REPORT====
{<<"method=POST; path=/clients; status=500; ">>,{error,badarg,[{re,run,[null,{re_pattern,0,0,<<69,82,67,80,91,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,0,39,25,77,0,0,0,0,0,96,255,3,254,255,255,135,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,71,26,84,0,39,0>>}],[]},{chef_client,valid_name,1,[{file,"src/chef_client.erl"},{line,293}]},{chef_client,parse_binary_json,3,[{file,"src/chef_client.erl"},{line,232}]},{chef_wm_clients,validate_request,3,[{file,"src/chef_wm_clients.erl"},{line,89}]},{oc_chef_wm_base,malformed_request,2,[{file,"src/oc_chef_wm_base.erl"},{line,753}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,186}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,142}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]}]}}

==> /var/log/opscode/opscode-erchef/current <==
2015-04-06_10:51:14.72501 [error] {<<"method=POST; path=/clients; status=500; ">>,{error,badarg,[{re,run,[null,{re_pattern,0,0,<<69,82,67,80,91,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,0,39,25,77,0,0,0,0,0,96,255,3,254,255,255,135,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,71,26,84,0,39,0>>}],[]},{chef_client,valid_name,1,[{file,"src/chef_client.erl"},{line,293}]},{chef_client,parse_binary_json,3,[{file,"src/chef_client.erl"},{line,232}]},{chef_wm_clients,validate_request,3,[{file,"src/chef_wm_clients.erl"},{line,89}]},{oc_chef_wm_base,malformed_request,2,[{file,"src/oc_chef_wm_base.erl"},{line,753}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,186}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,142}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]}]}}

==> /var/log/opscode/nginx/access.log <==
******* - - [06/Apr/2015:12:51:14 +0200]  "POST /clients HTTP/1.1" 500 "0.027" 36 "-" "Chef Knife/12.2.1 (ruby-2.1.5-p273; ohai-8.2.0; x86_64-darwin14.0; +http://opscode.com)" "127.0.0.1:8000" "500" "0.007" "12.2.1" "algorithm=sha1;version=1.0;" "vogl" "2015-04-06T10:46:39Z" "X9qKxCeT7YDiMqp3ajKF+ajFw6s=" 1548
@stevendanna
Copy link
Contributor

@yves-vogl Like the other bug you reported, is this solved by using the -N NODE_NAME argument? My hunch is that this is both a client and server bug. On the client-side, we are sending a null/empty name in the body of the request, on the server-side we are throwing a 500 when we should be returning a 400 with a sensible error message.

@ghost
Copy link
Author

ghost commented Apr 14, 2015

Hi, using the -N NODE_NAME solves the issue.

Can you confirm that deleting validation_key and validation_client_name from knife.rb should work?
I cannot find any information in the current documentation that those values may being omitted.

@stevendanna stevendanna added this to the accepted-minor milestone Jul 9, 2015
@stevendanna stevendanna added the bug label Jul 9, 2015
@tas50 tas50 added Type: Bug Does not work as expected. and removed bug labels Jan 4, 2019
@PrajaktaPurohit PrajaktaPurohit added Status: Good First Issue An issue ready for a new contributor. Status: To be prioritized Indicates that product needs to prioritize this issue. Triage: Confirmed Indicates and issue has been confirmed as described. labels Jul 17, 2020
@stevendanna stevendanna removed this from the accepted-minor milestone Sep 29, 2020
@PrajaktaPurohit PrajaktaPurohit added the Triage: Try Reproducing Indicates that this issue needs to be reproduced. label Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Good First Issue An issue ready for a new contributor. Status: To be prioritized Indicates that product needs to prioritize this issue. Triage: Confirmed Indicates and issue has been confirmed as described. Triage: Try Reproducing Indicates that this issue needs to be reproduced. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

3 participants