Skip to content

Instantly share code, notes, and snippets.

@hh
Created June 20, 2012 13:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hh/2959823 to your computer and use it in GitHub Desktop.
Save hh/2959823 to your computer and use it in GitHub Desktop.
Error using application cookbook to deploy hello.war
# chef-client
[Wed, 20 Jun 2012 13:06:33 +0000] INFO: *** Chef 10.12.0 ***
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List is [role[my_app]]
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List expands to [chef-client::config, chef-client::service, myplace::my_app]
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Starting Chef Run for 20929809
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Running start handlers
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Start handlers complete.
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Loading cookbooks [apache2, application, application_java, myplace, build-essential, chef-client, chef_handler, gunicorn, iptables, java, mysql, openssl, passenger_apache2, php, python, runit, tomcat, unicorn, windows, xml, yum]
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Missing gem 'mysql'
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Application light-weight resource already initialized -- overriding!
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:598: warning: already initialized constant Application
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/run/chef] action create (chef-client::config line 31)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/cache/chef] action create (chef-client::config line 31)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/lib/chef] action create (chef-client::config line 31)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/log/chef] action create (chef-client::config line 31)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing template[/etc/chef/client.rb] action create (chef-client::config line 44)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing ruby_block[reload_client_config] action nothing (chef-client::config line 53)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/run/chef] action create (chef-client::service line 42)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/cache/chef] action create (chef-client::service line 42)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/lib/chef] action create (chef-client::service line 42)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing directory[/var/log/chef] action create (chef-client::service line 42)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing template[/etc/init.d/chef-client] action create (chef-client::service line 61)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing template[/etc/sysconfig/chef-client] action create (chef-client::service line 70)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing service[chef-client] action enable (chef-client::service line 76)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing application_java_java_webapp[helloworld] action nothing (myplace::my_app line 100)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing application_java_tomcat[helloworld] action nothing (myplace::my_app line 100)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing application[helloworld] action deploy (myplace::my_app line 1)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing application_java_java_webapp[helloworld] action before_compile (myplace::my_app line 100)
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Processing application_java_tomcat[helloworld] action before_compile (myplace::my_app line 100)
[Wed, 20 Jun 2012 13:06:36 +0000] ERROR: application[helloworld] (myplace::my_app line 1) has had an error
[Wed, 20 Jun 2012 13:06:36 +0000] ERROR: application[helloworld] (/var/cache/chef/cookbooks/myplace/recipes/my_app.rb:1:in `from_file') had an error:
application[helloworld] (myplace::my_app line 1) had an error: Chef::Exceptions::ValidationFailed: Option action must be equal to one of: nothing, create, delete, touch, create_if_missing! You passed :deploy.
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:126:in `_pv_equal_to'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:69:in `block (2 levels) in validate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:66:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:66:in `block in validate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:56:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/params_validate.rb:56:in `validate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:196:in `block in action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:192:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:192:in `action'
/var/cache/chef/cookbooks/application/providers/default.rb:122:in `block in run_deploy'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/recipe_definition_dsl_core.rb:74:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/mixin/recipe_definition_dsl_core.rb:74:in `method_missing'
/var/cache/chef/cookbooks/application/providers/default.rb:121:in `run_deploy'
/var/cache/chef/cookbooks/application/providers/default.rb:29:in `block in class_from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider.rb:106:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider.rb:106:in `block in action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:454:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/client.rb:330:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/client.rb:163:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/application/client.rb:254:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/application/client.rb:241:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/application/client.rb:241:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/application.rb:70:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19:in `<main>'
[Wed, 20 Jun 2012 13:06:36 +0000] ERROR: Running exception handlers
[Wed, 20 Jun 2012 13:06:36 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[Wed, 20 Jun 2012 13:06:36 +0000] ERROR: Exception handlers complete
[Wed, 20 Jun 2012 13:06:36 +0000] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
[Wed, 20 Jun 2012 13:06:36 +0000] FATAL: Chef::Exceptions::ValidationFailed: application[helloworld] (myplace::my_app line 1) had an error: Chef::Exceptions::ValidationFailed: Option action must be equal to one of: nothing, create, delete, touch, create_if_missing! You passed :deploy.
application "helloworld" do
path "/usr/local/helloworld"
owner node["tomcat"]["user"]
group node["tomcat"]["group"]
repository "http://web-actions.googlecode.com/files/helloworld.war"
revision "does this mater"
java_webapp do
context_template "hello-context.xml.erb"
end
tomcat
end
<Context docBase="<%= @war %>" path="/"
debug="5" reloadable="true" crossContext="true" allowLinking="true">
<Environment name="appEnvironment" value="<%= node.chef_environment %>"
type="java.lang.String" override="false"/>
</Context>
@hh
Copy link
Author

hh commented Jun 20, 2012

This is basically the straightforward use described in https://github.com/opscode-cookbooks/application_java/blob/master/README.md

Specifically the jenkins example.

@rashisha
Copy link

Though its way too late to answer,but anyone who face the problem can make sure that the below requirements meets.
Requirements

Chef 0.11.0 or higher required (for Chef environment use).

The following Opscode cookbooks are dependencies:

application
java
tomcat

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