Giter VIP home page Giter VIP logo

rundeck-jdbc-executor-plugin's People

Contributors

babs avatar hgzapata avatar phillipjohnson avatar strdn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rundeck-jdbc-executor-plugin's Issues

JDBC class not found when running JDBC Step in rundeck

I'm encountering error when trying to execute JDBC Step via rundeck "Failed: ConfigurationFailure: com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException: jdbc driver class not
foundoracle.jdbc.driver.OracleDriver."
I already have ojdbc8-full folder which contains jar file of JDBC in rundeck/lib and configure Rundeck Project resourses.xml. Did I miss any step.?

Thanks in advance.!

java.lang.ClassNotFoundException: org.apache.log4j.Logger

Describe the bug
The plugin is not working, in the log print exception

My Rundeck detail

Rundeck version: 3.3.6
install type: war
OS Name/version: Red Hat Linux 8
DB Type/version: [choose: mysql, postgres, mssql, oracle, ... ]
To Reproduce
Steps to reproduce the behavior:

copy rundeck-jdbc-executor-plugin-0.1.jar in libext
start rundeck

The error is: in the log write

com.dtolabs.rundeck.core.plugins.PluginException: Error loading class: com.github.strdn.rundeck.plugin.jdbcexecutor.GroovySQLCommandPlugin
at com.dtolabs.rundeck.core.plugins.JarPluginProviderLoader.loadClass(JarPluginProviderLoader.java:440)
at com.dtolabs.rundeck.core.plugins.JarPluginProviderLoader.listProviders(JarPluginProviderLoader.java:594)
at com.dtolabs.rundeck.core.plugins.DirPluginScanner.listProviders(DirPluginScanner.java:225)
at com.dtolabs.rundeck.core.plugins.DirPluginScanner.listProviders(DirPluginScanner.java:150)
at com.dtolabs.rundeck.core.plugins.FilePluginCache.listProviders(FilePluginCache.java:125)
at com.dtolabs.rundeck.core.plugins.PluginManagerService.listProviders(PluginManagerService.java:112)
at com.dtolabs.rundeck.core.plugins.PluggableProviderRegistryService.listProviders(PluggableProviderRegistryService.java:100)
at com.dtolabs.rundeck.core.plugins.configuration.DescribableServiceUtil.listDescriptions(DescribableServiceUtil.java:49)
at com.dtolabs.rundeck.core.execution.service.NodeExecutorService.listDescriptions(NodeExecutorService.java:117)
at com.dtolabs.rundeck.core.plugins.configuration.DescribableService$listDescriptions.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at rundeck.services.PluginApiService$_listPluginsDetailed_closure1.doCall(PluginApiService.groovy:69)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
at groovy.lang.Closure.call(Closure.java:405)
at groovy.lang.Closure.call(Closure.java:421)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:4103)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:4010)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:4035)
at org.codehaus.groovy.runtime.dgm$96.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at rundeck.services.PluginApiService.listPluginsDetailed(PluginApiService.groovy:67)
at rundeck.services.PluginApiService$listPluginsDetailed.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at rundeckapp.init.PluginCachePreloader.boostrap(PluginCachePreloader.groovy:32)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:266)
at grails.events.subscriber.MethodSubscriber.call(MethodSubscriber.groovy:47)
at org.grails.events.EventSubscriberTrigger.proceed(EventSubscriberTrigger.groovy:34)
at org.grails.events.bus.ExecutorEventBus$_buildNotificationCallable_closure1$_closure3.doCall(ExecutorEventBus.groovy:36)
at org.grails.events.bus.ExecutorEventBus$_buildNotificationCallable_closure1$_closure3.call(ExecutorEventBus.groovy)
at groovy.lang.Closure.run(Closure.java:486)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at com.github.strdn.rundeck.plugin.jdbcexecutor.GroovySQLCommandPlugin.(GroovySQLCommandPlugin.java:33)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.dtolabs.rundeck.core.plugins.JarPluginProviderLoader.loadClass(JarPluginProviderLoader.java:435)
... 54 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader.loadClass(LocalFirstClassLoader.java:58)
at com.dtolabs.rundeck.core.plugins.LocalFirstClassLoader.loadClass(LocalFirstClassLoader.java:44)
... 58 more

Compatibility with Rundeck 3.4.0

Note: When I upgraded to Rundeck 3.4.0, I had to remove the custom groovy-sql jar files for this plugin as I ran into error:

service.log:Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-sql is loaded in version 2.5.6 and you are trying to load version 3.0.8

jdbc driver class not foundoracle.jdbc.driver.OracleDriver

Hello,

it looks like I have a configuration problem.

My Rundeck Details:
Rundeck version: 3.4.0
Install type: WAR with Tomcat 9.0.39 with AdoptOpenJDK 11.0.10+9
OS Name/version: Red Hat Linux 7.8
DB Type/version: postgresql

I've downloaded the plugin and put it to $RDECK_BASE/libext.
I've also created a folder $RDECK_BASE/lib an put the following files into this folder:

  • groovy-jsr223-3.0.8.jar
  • groovy-sql-3.0.8.jar
  • ojdbc8.jar (tested also ojdbc10.jar)

My Node Configuration:
<?xml version="1.0" encoding="UTF-8"?> <project> <node name="SERVERNAME" node-executor="jdbc-command" db-type="oracle" jdbc-connect="jdbc:oracle:thin:@ SERVERNAME:1521:ORACLESID" jdbc-username="system" jdbc-password="password" description="" tags="" hostname="SERVERNAME" osArch="amd64" osFamily="unix" osName="Linux" osVersion="" username="root"/> </project>

Rundeck Job Log Output:
[workflow] beginExecuteNodeStep(cg1-mstrdb-t301): NodeDispatch: StepExecutionItem{type='NodeDispatch', keepgoingOnSuccess=false, hasFailureHandler=false} Failed: ConfigurationFailure: com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException: jdbc driver class not foundoracle.jdbc.driver.OracleDriver [workflow] finishExecuteNodeStep(cg1-mstrdb-t301): NodeDispatch: ConfigurationFailure: com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException: jdbc driver class not foundoracle.jdbc.driver.OracleDriver

Feature request: Parameterize connection parameters (allow use of secrets or job options)

Node information are publicly available to one who has access to rundeck interface or api, therefore, db, user and password are available.

It would be nice if informations like password, username or database coule also be sourced from the job argument mechanism or maybe step arguments like script args that, if empty fall back to the actual mechanism.
This would allow the use of key storage mechanism and thus parameterize DSN and protect secret.

Another option would be less user friendly but to pass DSN as argument (maybe w/ the driver class name ?) and initialize connection inside the groovy script ?

Possible security issue

Hello,

I believe there might be a security-related issue with the plugin as it currently stands but do not want to disclose details in public until I can confirm with you if it is indeed an issue and have a plan to address it.

You can either e-mail me or tomorrow I will have time to test the issue in detail and submit a PR to address it.

Plugin not loading

I'm certain I'm doing something wrong, but I copied the plugin jar to libext, a copy of groovy-sql-2.4.11.jar to bootstrap, and a copy of mssql-jdbc-6.2.2.jre8.jar also to bootstrap. The plugin does not show up in my plugins page even after a restart of the service or a restart of the whole machine. Other plugins seem to be loading just fine. I'm not seeing any errors in any logs. (CentOS 7, Rundeck 2.10.3) Any ideas?

Problems with Rundeck 4.8.0

I tested the plugin on Rundeck 4.7.0 and it runs without issues. No need for the groovy-jsr223.xxx jar, just copied the built jar file to libext/.
On 4.8.0 however it throws a NullPointerException:
Failed executing node plugin [com.github.strdn.rundeck.plugin.jdbcexecutor.GroovySQLScriptNodeStepPlugin] on node mirdb: java.lang.NullPointerException at com.github.strdn.rundeck.plugin.jdbcexecutor.GroovySQLStatementExecutor.executeStatement(GroovySQLStatementExecutor.java:24) at com.github.strdn.rundeck.plugin.jdbcexecutor.GroovySQLScriptNodeStepPlugin.executeNodeStep(GroovySQLScriptNodeStepPlugin.java:83) at com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter.executeNodeStep(NodeStepPluginAdapter.java:167) at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeNodeStep(ExecutionServiceImpl.java:206) at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:130) at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:61) at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodesWith(ExecutionServiceImpl.java:262) at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodes(ExecutionServiceImpl.java:233) at com.dtolabs.rundeck.core.execution.workflow.steps.NodeDispatchStepExecutor.executeWorkflowStep(NodeDispatchStepExecutor.java:66) at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:111) at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWFItem(BaseWorkflowExecutor.java:285) at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWorkflowStep(BaseWorkflowExecutor.java:681) at com.dtolabs.rundeck.core.execution.workflow.engine.StepCallable.apply(StepCallable.java:71) at com.dtolabs.rundeck.core.execution.workflow.engine.StepOperation.apply(StepOperation.java:76) at com.dtolabs.rundeck.core.execution.workflow.engine.StepOperation.apply(StepOperation.java:32) at com.dtolabs.rundeck.core.rules.WorkflowEngineOperationsProcessor.lambda$beginOperation$1(WorkflowEngineOperationsProcessor.java:323) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

Wrong DBType for MySQL database

你好,我在使用过程中,发现你有一个bug,在/src/main/java/com/github/strdn/rundeck/plugin/jdbcexecutor/DBTypes.java里面,传入oracle和mysql都是返回oracle
public static DBTypes getDBType(String databaseName) {
if (oracleDatabase.equalsIgnoreCase(databaseName))
return ORACLE;
if (mysqlDatabase.equalsIgnoreCase(databaseName))
return ORACLE;
if (postgresDatabase.equalsIgnoreCase(databaseName))
return POSTGRES;
return UNKNOWN;
}

where is the boostrap location?

Hi, I got trouble in installing the plugin, I did't find the boostrap directory in rundeck, can you tell me boostrap location please , thanks very much ~

image

Here is my rundeck directory

[18:40:48 /usr/local/rundeck]
$ ls
etc                 libext    repository                  rundeck-jdbc-executor-plugin  server  user-assets
hs_err_pid3140.log  projects  rundeck-3.1.3-20191204.war  run.log

Error Unknown database type:null

Describe the bug
I create job with rundeck-jdbc-executor-plugin but not working

My Rundeck detail

Rundeck version: 3.2.8
install type: jar
OS Name/version: Red Hat Linux 6
DB Type/version: [choose: mysql, postgres, mssql, oracle, ... ]
To Reproduce
Steps to reproduce the behavior:

Install Plugin
Copy ojdbc6.jar and groovy-sql-2.4.11.jar in tools/lib
Create Job with step "Groovy sql script executor"
Execute the job

The error is Failed: ConfigurationFailure: com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException: Unknown database type:null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.