Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

chef push got 400 "Bad Request" from Enterprise Chef 12.0.0.rc5 and 11.1.3 #208

Closed
d-higuchi opened this issue Oct 29, 2014 · 5 comments · Fixed by #216
Closed

chef push got 400 "Bad Request" from Enterprise Chef 12.0.0.rc5 and 11.1.3 #208

d-higuchi opened this issue Oct 29, 2014 · 5 comments · Fixed by #216
Labels
Type: Bug Doesn't work as expected.

Comments

@d-higuchi
Copy link

I read ChefDK 0.3.0 Released! Introducing Policyfiles
and tested chef Policyfiles feature at Chef DK 0.3.0.
I ran "chef generate app policyfile_demo" and used example Policyfile.rb.
But chef push got 400 "Bad Request" from Enterprise Chef 12.0.0.rc5 and 11.1.3.

ubuntu@ws:~/chef-repo$ chef push demo
WARN: Uploading policy to policy group demo in compatibility mode
WARN: Uploading cookbooks using semver compat mode
Error: Failed to upload policy to policy group demo
Reason: Net::HTTPServerException

400 "Bad Request"
ubuntu@ws:~/chef-repo

There are clean installed Chef Servers and Chef Workstation at Ubuntu 12.04 LTS.
BTW, Chef Zero's Policyfile testing works fine.

@sersut sersut added the Bug label Oct 29, 2014
@danielsdeleo
Copy link
Contributor

Can you run with the -D flag to get more debug info?

@d-higuchi
Copy link
Author

ChefDK 0.3.0:

WARN: Uploading policy to policy group demo in compatibility mode
WARN: Uploading cookbooks using semver compat mode
Error: Failed to upload policy to policy group demo
Reason: Net::HTTPServerException

400 "Bad Request"
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:145:in `request'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:118:in `put'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:97:in `block in upload_cookbooks'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in `each'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in `upload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:122:in `upload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:49:in `upload'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:97:in `upload_policy'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:86:in `run'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/push.rb:72:in `run'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/base.rb:57:in `run_with_default_options'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/cli.rb:70:in `run'
/opt/chefdk/embedded/apps/chef-dk/bin/chef:25:in `<top (required)>'
/opt/chefdk/bin/chef:42:in `load'
/opt/chefdk/bin/chef:42:in `<main>'

ChefDK 0.3.2:

WARN: Uploading policy to policy group demo in compatibility mode
WARN: Uploading cookbooks using semver compat mode
Error: Failed to upload policy to policy group demo
Reason: Net::HTTPServerException

400 "Bad Request"
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:145:in `request'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:118:in `put'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:97:in `block in upload_cookbooks'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in `each'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in `upload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:122:in `upload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:49:in `upload'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:83:in `upload_policy'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:72:in `run'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/push.rb:72:in `run'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/base.rb:57:in `run_with_default_options'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/cli.rb:70:in `run'
/opt/chefdk/embedded/apps/chef-dk/bin/chef:25:in `<top (required)>'
/opt/chefdk/bin/chef:42:in `load'
/opt/chefdk/bin/chef:42:in `<main>'

@danielsdeleo
Copy link
Contributor

Yep, I've repro'd the error. Right now I'm working on improving the debug messages because the current ones don't give enough info to pinpoint the problem. Next I'll try to track down the actual bug.

On Oct 29, 2014, at 6:05 PM, dai notifications@github.com wrote:

ChefDK 0.3.0:

WARN: Uploading policy to policy group demo in compatibility mode
WARN: Uploading cookbooks using semver compat mode
Error: Failed to upload policy to policy group demo
Reason: Net::HTTPServerException

400 "Bad Request"
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in error!' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:145:inrequest'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:118:in put' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:97:inblock in upload_cookbooks'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in each' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:inupload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:122:in upload_cookbooks' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:49:inupload'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:97:in upload_policy' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:86:inrun'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/push.rb:72:in run' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/base.rb:57:inrun_with_default_options'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/cli.rb:70:in run' /opt/chefdk/embedded/apps/chef-dk/bin/chef:25:in<top (required)>'
/opt/chefdk/bin/chef:42:in load' /opt/chefdk/bin/chef:42:in

'
ChefDK 0.3.2:

WARN: Uploading policy to policy group demo in compatibility mode
WARN: Uploading cookbooks using semver compat mode
Error: Failed to upload policy to policy group demo
Reason: Net::HTTPServerException

400 "Bad Request"
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in error!' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:145:inrequest'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/http.rb:118:in put' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:97:inblock in upload_cookbooks'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:in each' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.0.0.alpha.2/lib/chef/cookbook_uploader.rb:94:inupload_cookbooks'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:122:in upload_cookbooks' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile/uploader.rb:49:inupload'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:83:in upload_policy' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/policyfile_services/push.rb:72:inrun'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/push.rb:72:in run' /opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/base.rb:57:inrun_with_default_options'
/opt/chefdk/embedded/apps/chef-dk/lib/chef-dk/cli.rb:70:in run' /opt/chefdk/embedded/apps/chef-dk/bin/chef:25:in<top (required)>'
/opt/chefdk/bin/chef:42:in load' /opt/chefdk/bin/chef:42:in

'

Reply to this email directly or view it on GitHub.

@danielsdeleo
Copy link
Contributor

#216

@d-higuchi
Copy link
Author

works fine. thank you.

@thommay thommay added Type: Bug Doesn't work as expected. and removed Bug labels Feb 1, 2017
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Doesn't work as expected.
Development

Successfully merging a pull request may close this issue.

4 participants