Skip to content

Instantly share code, notes, and snippets.

@pikesley
Last active December 14, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pikesley/5152648 to your computer and use it in GitHub Desktop.
Save pikesley/5152648 to your computer and use it in GitHub Desktop.
Weird weird Chef behaviour
162.13.1.27 Recipe: odi-nginx::default
162.13.1.27
162.13.1.27 * directory[/etc/nginx/sites-available] action create
162.13.1.27 (up to date)
162.13.1.27
162.13.1.27 * directory[/etc/nginx/sites-enabled] action create
162.13.1.27 (up to date)
162.13.1.27
162.13.1.27 * template[/etc/nginx/sites-available/members.theodi.org] action create
162.13.1.27
162.13.1.27
162.13.1.27 ================================================================================
162.13.1.27
162.13.1.27 Error executing action `create` on resource 'template[/etc/nginx/sites-available/members.theodi.org]'
162.13.1.27
162.13.1.27 ================================================================================
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27 Net::HTTPServerException
162.13.1.27
162.13.1.27 ------------------------
162.13.1.27
162.13.1.27 403 "Forbidden"
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27 Resource Declaration:
162.13.1.27
162.13.1.27 ---------------------
162.13.1.27
162.13.1.27 # In /var/chef/cache/cookbooks/odi-nginx/recipes/default.rb
162.13.1.27
162.13.1.27 41: ] do
162.13.1.27 42: source "vhost.erb"
162.13.1.27 43: variables(
162.13.1.27 44: :fqdn => node["project_fqdn"],
162.13.1.27 45: :project_name => node["git_project"]
162.13.1.27 46: )
162.13.1.27 47: action :create
162.13.1.27 48: end
162.13.1.27 49:
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27 Compiled Resource:
162.13.1.27
162.13.1.27 ------------------
162.13.1.27
162.13.1.27 # Declared in /var/chef/cache/cookbooks/odi-nginx/recipes/default.rb:41:in `from_file'
162.13.1.27
162.13.1.27 template("/etc/nginx/sites-available/members.theodi.org") do
162.13.1.27 provider Chef::Provider::Template
162.13.1.27 action [:create]
162.13.1.27 retries 0
162.13.1.27 retry_delay 2
162.13.1.27 path "/etc/nginx/sites-available/members.theodi.org"
162.13.1.27 backup 5
162.13.1.27 source "vhost.erb"
162.13.1.27 variables {:fqdn=>"members.theodi.org", :project_name=>"member-directory"}
162.13.1.27 cookbook_name "odi-nginx"
162.13.1.27 recipe_name "default"
162.13.1.27 end
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27 Recipe: chef-client::service
162.13.1.27
162.13.1.27 * service[chef-client] action restart
162.13.1.27
162.13.1.27 - restart service service[chef-client]
162.13.1.27
162.13.1.27
162.13.1.27
162.13.1.27 Recipe: nginx::default
162.13.1.27
162.13.1.27 * service[nginx] action reload
162.13.1.27
162.13.1.27 - reload service service[nginx]
162.13.1.27
162.13.1.27 [2013-03-13T14:27:39+00:00] ERROR: Running exception handlers
162.13.1.27 [2013-03-13T14:27:39+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
162.13.1.27 [2013-03-13T14:27:39+00:00] ERROR: Exception handlers complete
162.13.1.27 Chef Client failed. 75 resources updated
162.13.1.27
162.13.1.27 [2013-03-13T14:27:39+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
162.13.1.27 [2013-03-13T14:27:39+00:00] FATAL: Net::HTTPServerException: template[/etc/nginx/sites-available/members.theodi.org] (odi-nginx::default line 41) had an error: Net::HTTPServerException: 403 "Forbidden"
For one of my cookbooks, when I bootstrap a new node (on Rackspace, against my Chef 11 server), the templates do not make it to the node and the chef-client run craps out (see below). However if I then jump on the node and run chef-client by hand, the templates *do* make it and the run completes without a hitch.
Does this sound familiar to anybody? It feels like I must be doing something dumb...
It might be worth noting that this all works correctly on my cucumber-chef setup (which is Chef 10).
@vmadman
Copy link

vmadman commented Jul 24, 2013

Yup, I found this gist while trying to tackle an identical problem. Did you ever get this fixed?

@vmadman
Copy link

vmadman commented Jul 24, 2013

Just in case someone else stumbles in here, here's a potential solution:
from: http://tickets.opscode.com/browse/CHEF-4253

create a file /etc/chef-server/chef-server.rb that contains "erchef['s3_url_ttl'] = 3600"
run chef-server-ctl reconfigure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment