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

Chef 12 Incompatibility? Undefined method `process_hosts' for Chef::Resource::Template #20

Open
SimonKaluza opened this issue Jan 10, 2015 · 1 comment

Comments

@SimonKaluza
Copy link

Using Chef 12 with applicaiton_nginx's LWRP throws a NoMethodError for the process_hosts method call in before_deploy.

It works great in 11.18.0, so I assume Chef 12 introduced some breaking changes?

    ==> default: ================================================================================
    ==> default: Error executing action `before_deploy` on resource 'application_nginx_nginx_load_balancer[my_app]'
    ==> default: ================================================================================
    ==> default: 
    ==> default: 
    ==> default: NoMethodError
    ==> default: -------------
    ==> default: undefined method `process_hosts' for Chef::Resource::Template
    ==> default: 
    ==> default: 
    ==> default: Cookbook Trace:
    ==> default: ---------------
    ==> default: /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application_nginx/providers/nginx_load_balancer.rb:46:in `block (2 levels) in class_from_file'
    ==> default: 
    ==> default: /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application_nginx/providers/nginx_load_balancer.rb:39:in `block in class_from_file'
    ==> default: 
    ==> default: /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application/providers/default.rb:110:in `block (3 levels) in before_deploy'
    ==> default: 
    ==> default: /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application/providers/default.rb:109:in `each'
    ==> default: 
    ==> default: /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application/providers/default.rb:109:in `block (2 levels) in before_deploy'
    ==> default: 
    ==> default: 
    ==> default: Resource Declaration:
    ==> default: ---------------------
    ==> default: # In /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application/resources/default.rb
    ==> default: 
    ==> default: 115:       resource = super(resource_name.to_sym, self.name, &block)
    ==> default: 116:       break
    ==> default: 
    ==> default: Compiled Resource:
    ==> default: ------------------
    ==> default: # Declared in /tmp/vagrant-chef/c857f9f10998e00e365c7defdc4838d4/cookbooks/application/resources/default.rb:115:in `block in method_missing'
    ==> default: 
    ==> default: application_nginx_nginx_load_balancer("my_app") do
    ==> default:   action [:nothing]
    ==> default:   retries 0
    ==> default:   retry_delay 2
    ==> default:   default_guard_interpreter :default
    ==> default:   declared_type :application_nginx_nginx_load_balancer
    ==> default:   cookbook_name :"my_cookbook"
    ==> default:   recipe_name "app_server"
    ==> default:   hosts ["localhost"]
    ==> default:   application_port 8080
    ==> default:   ssl true
    ==> default:   ssl_certificate "/etc/nginx/ssl/ssl.pem"
    ==> default:   ssl_certificate_key "/etc/nginx/ssl/ssl.key"
    ==> default:   template "load_balancer.conf.erb"
    ==> default:   static_files {"/images"=>"/home/deployer/myapp/current/public/assets", "/stylesheets"=>"/home/deployer/my_app/current/public/assets", "/javascripts"=>"/home/deployer/my_app/current/public/assets"}
    ==> default:   type :nginx_load_balancer
    ==> default:   application_server_role "imy_app_application_server"
    ==> default: end
Azrael808 added a commit to Azrael808/chef-tiddlywiki5 that referenced this issue Feb 16, 2015
@rberger
Copy link

rberger commented Mar 4, 2015

Looks like if def process_host(nodes) at line 73 in nginx_load_balancer.rb is not protected the error goes away.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants