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
private-chef cookbook crashing with common-name attribute #108
Comments
I was able to repo this too. [2015-09-23T16:46:46+00:00] WARN: common_name nil currently does not overwrite the value of common_name. This will change in Chef 13, and the value will be set to nil instead. Please change your code to explicitly accept nil using "property :common_name, [MyType, nil]", or stop setting this value to nil.
================================================================================
Recipe Compile Error in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb
================================================================================
Chef::Exceptions::ValidationFailed
----------------------------------
common_name is required
Cookbook Trace:
---------------
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:58:in `block in from_file'
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:57:in `from_file'
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:208:in `block in from_file'
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `each'
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `from_file'
Relevant File Content:
----------------------
/opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:
51:
52: ssl_keyfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.key")
53: ssl_crtfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.crt")
54: ssl_dhparam = File.join(nginx_ca_dir, 'dhparams.pem')
55:
56: # Generate self-signed SSL certificate
57: openssl_x509 ssl_crtfile do
58>> common_name node['private_chef']['nginx']['server_name']
59: org node['private_chef']['nginx']['ssl_company_name']
60: org_unit node['private_chef']['nginx']['ssl_organizational_unit_name']
61: country node['private_chef']['nginx']['ssl_country_name']
62: key_length node['private_chef']['nginx']['ssl_key_length']
63: expire node['private_chef']['nginx']['ssl_duration']
64: owner 'root'
65: group 'root'
66: mode '0644'
67: end
Running handlers:
[2015-09-23T16:46:46+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-09-23T16:46:46+00:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated in 10.379691033 seconds
[2015-09-23T16:46:46+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
[2015-09-23T16:46:47+00:00] FATAL: Chef::Exceptions::ValidationFailed: common_name is required /cc @ryancragun |
Hello jjasghar. I figured out that this problem is related to a known bug with the Nginx cookbook (that Chef-server cookbook uses, also). The bug is a cookbook crash, when the machine to be configured, don't have a resolvable hostname and a VALID hostname (at least), and don't have a hostname set within OHAI. At least here, I solved this setting a valid and correct hostname for my instance. I don't know if this is related to your problem, as my issue here (besides the both problem are the same), but it's a good way to look for the solution. |
Ah yep! I just |
Facing this as well when installing on EC2. |
Confirmed on ec2 default ubuntu 14.04 |
This just bit me today also. I too am attempting to use the 'official' ubuntu image on EC2. |
Make an entry in /etc/hosts using the name provided by executing the 'hostname' command. 127.0.0.1 ip-172-28-0-156.ec2.internal |
Any suggestions on how to work around this if you want to host the chef-server on a different sub-domain? I've changed the following, for example: default['private_chef']['nginx']['server_name'] = "chef.#{node['fqdn']}" That appears to work for the hosting, but the cert generated is based on the hostname only - I want the common_name for the server cert to be chef.hostname |
Confirmed on ec2 default ubuntu 14.04 hostname `curl http://169.254.169.254/latest/meta-data/public-hostname` |
This should largely be resolved by setting the |
just updating that this is still relevant as of today, fixing using |
I used this command to avoid looking up for hostname:
|
i got the same error and tried to install/ un-install the chef. no luck then, i tried the above step. and then "reconfigured" it is working. thanks. echo "127.0.0.1 chef_server chef_server.com">> /etc/hosts |
Good afternoon,
I'm trying to run the chef-server cookbook using chef-provisioning (and chef-solo from Vagrant), and it returning the following error:
These errors started suddenly, and the chef-client cannot run the recipe due this. Note: I've used the wrapper that manages this cookbook (chef-server) before, without problems
The only one attribute passed by wrapper, is:
node.override['chef-server']['api-fqdn'] = node['ipaddress']
The text was updated successfully, but these errors were encountered: