poise / application_java

Development repository for Opscode Cookbook application_java
http://community.opscode.com/cookbooks/application_java
Apache License 2.0
21 stars 64 forks source link

[COOK-3631] scm_provider Chef::Provider::RemoteFile::Deploy broken #9

Open billmoritz opened 10 years ago

billmoritz commented 10 years ago

I was unable to get the RemoteFile cookbook working with my web hosted war files. I decided to try the cookbook's example which also failed the same way.

application 'jenkins' do
  path         '/usr/local/jenkins'
  owner        node['tomcat']['user']
  group        node['tomcat']['group']
  repository   'http://mirrors.jenkins-ci.org/war/latest/jenkins.war'
  revision     '6facd94e958ecf68ffd28be371b5efcb5584c885b5f32a906e477f5f62bdb518-1'
    scm_provider Chef::Provider::RemoteFile::Deploy

  java_webapp do
    context_template 'jenkins-context.xml.erb'
  end

  tomcat
end

NoMethodError

undefined method `create' for nil:NilClass

Cookbook Trace:

/var/chef/cache/cookbooks/application_java/libraries/provider_remote_file_deploy.rb:53:in `action_sync'

Compiled Resource:

Declared in /var/chef/cache/cookbooks/application/providers/default.rb:122:in `run_deploy'

deploy_revision("jenkins") do provider Chef::Provider::Deploy::Revision action [:deploy] retries 0 retry_delay 2 deploy_to "/usr/local/jenkins" repository_cache "cached-copy" revision "6facd94e958ecf68ffd28be371b5efcb5584c885b5f32a906e477f5f62bdb518-1" rollback_on_error true remote "origin" shallow_clone true scm_provider Chef::Provider::RemoteFile::Deploy keep_releases 5 cookbook_name "app_billingagent" repo "http://mirrors.jenkins-ci.org/war/latest/jenkins.war" user "tomcat7" group "tomcat7" restart_command #Proc:0x000000031c7b10@/var/chef/cache/cookbooks/application/providers/default.rb:139 before_migrate #Proc:0x000000028eda30@/var/chef/cache/cookbooks/application/providers/default.rb:166 before_symlink #Proc:0x0000000290fab8@/var/chef/cache/cookbooks/application/providers/default.rb:169 before_restart #Proc:0x00000002a57240@/var/chef/cache/cookbooks/application/providers/default.rb:172 after_restart #Proc:0x00000002bc5d98@/var/chef/cache/cookbooks/application/providers/default.rb:175 shared_path "/usr/local/jenkins/shared" destination "/usr/local/jenkins/shared/cached-copy" current_path "/usr/local/jenkins/current" end

willfiguex commented 10 years ago

I get the same error. Do you know how to fix it?

billmoritz commented 10 years ago

https://tickets.opscode.com/browse/COOK-3631?focusedCommentId=40664&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-40664

moreandres commented 10 years ago

I'm having the same issue, also a similar one in application_nodejs. Is the fix provided by omkarashish/application_java not good enough to be pulled?

bcg62 commented 10 years ago

anyone have a fix for this?

kevinmeredith commented 10 years ago

Hi @bcg62 and @billmoritz , any update please?

I'm seeing a similar error with this cookbook's 3.0.0 version:

Note that my recipe is using the Chef::Provider::File::Deploy scm_provider:

include_recipe "java::default"

application node['my_app']['app-name'] do
  path         node['my_app']['deploy_path']
  repository   node['my_app']['war_url']
  scm_provider Chef::Provider::File::Deploy
  revision     node['my_app']['revision'] 

  java_webapp
  tomcat
end

And the error:

Error executing action `deploy` on resource 'deploy_revision[rem-ui]

ERROR: deploy_revision[my-app] (/tmp/kitchen/cache/cookbooks/application/providers/default.rb
 line 122) had an error: NoMethodError: undefined method `create' for nil:NilClass
billmoritz commented 10 years ago

I chatted with @coderanger on usenet and he said that this cookbook required a complete refactor and that he wouldn't be looking in to it until after chefconf.

http://community.opscode.com/chat/chef/2014-04-02#id-543312

kevinmeredith commented 10 years ago

Thanks, @billmoritz.

As a workaround to this issue, I used this cookbook.

Looking at COOK-3631, another forked application_java looks like a possible solution.

Bumping what @moreandres said, do you know why omkarashish's pull request (assuming there is one) hasn't been merged?

billmoritz commented 10 years ago

Is this the road we want to go down? I would rather we didn't fork and wind up in a place where we have separate cookbook stacks competing.

sjernigan commented 10 years ago

Thanks all. +1 to a permanent fix and second that the jamiely/application_java.git worked for me at least temporarily.

kgutwin commented 10 years ago

+1 for me as well. I first tried jamiely/application_java but received a RuntimeError "chef-client is confused, trying to deploy a file that has no path or does not exist..." Instead, omkarashish/application_java seems to have worked better.

kgutwin commented 10 years ago

Never mind, omkarashish/application_java had the same error...

Are there any other alternative cookbook recommendations for deploying Java apps on Tomcat?

tibraga commented 9 years ago

+1 I get the same error...

As @kgutwin asked, are there other alternative while don't fix this issue?

yeonki-choi commented 9 years ago

I encountered problem with the same error. In my case, cookbook https://github.com/jamiely/application_java worked

jejohns commented 8 years ago

+1 Just noticed this while upgrading chef-client from 11.4.4 to latest 12.4. :(

zfredrickson commented 8 years ago

+1 Just ran into this today with version 3.0.0