rundeck-plugins / rundeck-ec2-nodes-plugin

Get resource node data from Amazon EC2
86 stars 45 forks source link

Log4j problems with Rundeck 1.6 #9

Closed solounaletra closed 10 years ago

solounaletra commented 11 years ago

Hi. After an upgrade to 1.6 the plugin is no longer working and everytime I try to list nodes I get this error

Class org.apache.commons.logging.impl.Log4JLogger does not implement Log

After doing some research it seems to be related to https://github.com/dtolabs/rundeck/issues/419. Rollbacking to Rundeck 1.5 fixes the problem

gschueler commented 11 years ago

I think we can either add a Rundeck-Plugin-Libs-Load-First: false to the jar manifest, or perhaps change the bundled deps

solounaletra commented 11 years ago

I added Rundeck-Plugin-Libs-Load-First: false to the jar manifest and it worked! Thanks for taking the time to answer this :+1:

gschueler commented 11 years ago

Reopening, need to update that in the build for the jar..

guidograzioli commented 11 years ago

On my system (1.6.1-1) it works actually setting Rundeck-Plugin-Libs-Load-First: false in manifest.mf, not true

dlcampbell888 commented 11 years ago

We think this is still a problem. Plugin v.1.3 and Rundeck 1.6.2-1 .DEB package install exhibit this issue. If you set Rundeck-Plugin-Libs-Load-First: false, the plugin just doesn't run. Seems like some type of library mismatch. We are not sure how to update the gradle build to use the same libraries as the .DEB package but we think that might fix it.

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "server-logger".
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "server-logger".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "jobchanges".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "options".
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "server-logger".
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "server-logger".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "audit".
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader@1b34cd7b] whereas object of type 
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [sun.misc.Launcher$AppClassLoader@b92d342].
log4j:ERROR Could not instantiate appender named "server-logger".
ERROR GrailsExceptionResolver: Exception occurred when processing request: [POST] /resources/nodesFragment
Stacktrace follows:
org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:412)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:246)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
    at com.amazonaws.util.VersionInfoUtils.<clinit>(VersionInfoUtils.java:38)
    at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:27)
    at com.amazonaws.services.ec2.AmazonEC2Client.<init>(AmazonEC2Client.java:105)
    at com.dtolabs.rundeck.plugin.resources.ec2.InstanceToNodeMapper.performQuery(InstanceToNodeMapper.java:73)
    at com.dtolabs.rundeck.plugin.resources.ec2.EC2ResourceModelSource.getNodes(EC2ResourceModelSource.java:178)
    at com.dtolabs.rundeck.core.common.FrameworkProject.getNodeSet(FrameworkProject.java:440)
    at com.dtolabs.rundeck.core.common.FrameworkProject$getNodeSet.call(Unknown Source)
    at rundeck.controllers.FrameworkController.nodesdata(FrameworkController.groovy:203)
    at rundeck.controllers.FrameworkController$_closure5.doCall(FrameworkController.groovy:401)
    at rundeck.controllers.FrameworkController$_closure5.call(FrameworkController.groovy)

Subsequent page loads fire this error, due to the plugin being disabled after the previous error.

ERROR GrailsExceptionResolver: Exception occurred when processing request: [POST] /resources/nodesFragment
Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [nodesFragment] of controller [rundeck.controllers.FrameworkController]  caused exception: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:238)
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:190)
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:129)
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:73)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:292)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
    at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
    at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:298)
    at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:264)
    at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:255)
    at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:183)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:245)
    at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:134)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:65)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:97)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:930)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
    at groovy.lang.Closure.call(Closure.java:282)
    at groovy.lang.Closure.call(Closure.java:277)
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:368)
    at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:232)
    ... 59 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration
    at com.amazonaws.services.ec2.AmazonEC2Client.<init>(AmazonEC2Client.java:105)
    at com.dtolabs.rundeck.plugin.resources.ec2.InstanceToNodeMapper.performQuery(InstanceToNodeMapper.java:73)
    at com.dtolabs.rundeck.plugin.resources.ec2.EC2ResourceModelSource.getNodes(EC2ResourceModelSource.java:178)
    at com.dtolabs.rundeck.core.common.FrameworkProject.getNodeSet(FrameworkProject.java:440)
    at com.dtolabs.rundeck.core.common.FrameworkProject$getNodeSet.call(Unknown Source)
    at rundeck.controllers.FrameworkController.nodesdata(FrameworkController.groovy:203)
    at rundeck.controllers.FrameworkController$_closure5.doCall(FrameworkController.groovy:401)
    at rundeck.controllers.FrameworkController$_closure5.call(FrameworkController.groovy)
richid commented 11 years ago

I was also experiencing the same problem as @dlcampbell888 but setting Rundeck-Plugin-Libs-Load-First to 'false' fixed the issue for me. Running RunDeck 1.6.2 from the .deb (rundeck-1.6.2-1-GA.deb) and built rundeck-ec2-nodes-plugin 1.3 from source via ./gradlew.

Java info in case it helps:

root@precise64:~# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
mdeeks commented 10 years ago

Any update on this? It appears still broken in rundeck 1.6

pbreton commented 10 years ago

Having the issue with rundeck 2.0 beta 1 (debian package).

Building rundeck-ec2-nodes-plugin with Rundeck-Plugin-Libs-Load-First=false fix it.

ghost commented 10 years ago

This issue seems to be back in 2.1.1-1 that was installed via the release yum repo "http://dl.bintray.com/rundeck/rundeck-rpm" . I had to do the following to have it run the EC2 plugin without changing the manifest:

zip /var/lib/rundeck/libext/rundeck-ec2-nodes-plugin-1.3.jar -d lib/xml-apis-1.0.b2.jar lib/stax-1.2.0.jar lib/stax-api-1.0.1.jar lib/commons-logging-1.0.3.jar rm -rf /var/lib/rundeck/libext/cache/rundeck-ec2-nodes-plugin-1.3 service rundeckd restart

cheeseprocedure commented 10 years ago

I encountered the same bug after installing the latest Rundeck .deb via dpkg -i rundeck-2.2.0-1-GA.deb and installing rundeck-ec2-nodes-plugin-1.3.jar - the above fix from @ibentley worked (thanks!).