[ResourceModelSource: 2.source (com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory), project: AnsibleJobs]
java.lang.NullPointerException: null
[2024-10-15T03:10:41,549] ERROR resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 2.source (com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory), project: AnsibleJobs]
java.lang.NullPointerException: null
at com.rundeck.plugins.ansible.plugin.AnsibleResourceModelSource.ansibleInventoryList(AnsibleResourceModelSource.java:717) ~[?:?]
at com.rundeck.plugins.ansible.plugin.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:403) ~[?:?]
at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:58) ~[rundeck-core-5.6.1-20241014.jar!/:?]
at com.dtolabs.rundeck.core.resources.DelegateResourceModelSource.getNodes(DelegateResourceModelSource.java:35) ~[rundeck-core-5.6.1-20241014.jar!/:?]
at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:137) ~[rundeck-core-5.6.1-20241014.jar!/:?]
at com.dtolabs.rundeck.core.common.ProjectNodeSupport$ProjectNodesSource.getNodes(ProjectNodeSupport.java:358) ~[rundeck-core-5.6.1-20241014.jar!/:?]
at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:58) ~[rundeck-core-5.6.1-20241014.jar!/:?]
at com.dtolabs.rundeck.core.resources.ResourceModelSource$getNodes.call(Unknown Source) ~[?:?]
at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:44) ~[classes!/:?]
at rundeck.services.nodes.CachedProjectNodes$reloadNodeSet.call(Unknown Source) ~[?:?]
at rundeck.services.NodeService$_loadNodes_closure4.doCall(NodeService.groovy:295) ~[classes!/:?]
at rundeck.services.NodeService$_loadNodes_closure4.doCall(NodeService.groovy) ~[classes!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.Closure.call(Closure.java:427) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.Closure.call(Closure.java:406) ~[groovy-3.0.19.jar!/:3.0.19]
at com.codahale.metrics.Timer.time(Timer.java:118) ~[metrics-core-4.2.22.jar!/:4.2.22]
at org.grails.plugins.metricsweb.MetricService.withTimer(MetricService.groovy:61) ~[grails-metricsweb-5.6.1-20241014-plain.jar!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:48) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:178) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:69) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:112) ~[groovy-3.0.19.jar!/:3.0.19]
at rundeck.services.NodeService$_loadNodes_closure5.doCall(NodeService.groovy:302) ~[classes!/:?]
at rundeck.services.NodeService$_loadNodes_closure5.doCall(NodeService.groovy) ~[classes!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) ~[groovy-3.0.19.jar!/:3.0.19]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.Closure.call(Closure.java:427) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.Closure.call(Closure.java:406) ~[groovy-3.0.19.jar!/:3.0.19]
at groovy.lang.Closure.run(Closure.java:498) ~[groovy-3.0.19.jar!/:3.0.19]
at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:284) ~[spring-core-5.3.34.jar!/:5.3.34]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
[2024-10-15T03:10:41,556] WARN resources.LoggingResourceModelSourceCache - [ResourceModelSource: 2.source (com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory), project: AnsibleJobs] Returning cached model data


Hi,
I couldn’t reproduce your issue but I found a way to accomplish your goal; it seems that the default model source cache is applied over the Refresh Project node step. So, let me share what worked for me on my end:
1- Go to the Ansible Model Source, click on the Configuration tab, and disable the “Use Asynchronous Cache” (I also decreased the “Cache Delay” time, I’ve tested with 2 instead of 30).
2- Redesing your workflow in the following way:
a. Create a child job with the action you want to dispatch to your Inventory.
- defaultTab: nodes description: '' executionEnabled: true id: 5a781bf8-08af-4f27-8590-7ffe4205bd48 loglevel: INFO name: ExecuteAction nodeFilterEditable: false nodefilters: dispatch: excludePrecedence: true keepgoing: false rankOrder: ascending successOnEmptyNodeFilter: false threadcount: '1' filter: .* nodesSelectedByDefault: true plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - autoSecureInput: 'false' fileExtension: .sh interpreterArgsQuoted: false passSecureInput: 'false' script: |- sleep 2 whoami scriptInterpreter: /bin/bash keepgoing: false strategy: node-first uuid: 5a781bf8-08af-4f27-8590-7ffe4205bd48b. Create a parent job with three steps (this job must be configured to execute locally). The first one generates/copies the Ansible Inventory (I tested with a simple YAML inventory). The third step is a Job Reference Step to the first job.
- defaultTab: nodes description: '' executionEnabled: true id: 1e99c753-7149-4067-b06a-1a5f202d2ad9 loglevel: INFO name: ParentJob nodeFilterEditable: false plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - autoSecureInput: 'false' fileExtension: .sh interpreterArgsQuoted: false passSecureInput: 'false' script: |- cp /home/user/Downloads/ansible/config/hosts.yaml /home/user/Downloads/ echo "done" scriptInterpreter: /bin/bash - configuration: sleep: '6' description: refreshing project nodes.... nodeStep: false type: source-refresh-plugin - jobref: group: '' name: ExecuteAction nodeStep: 'true' uuid: 5a781bf8-08af-4f27-8590-7ffe4205bd48 keepgoing: false strategy: node-first uuid: 1e99c753-7149-4067-b06a-1a5f202d2ad93- Save and execute the Parent Job (and observe the service log behavior).
4- Check the output.
Some tips:
Regards.

ansible 2.9.27
config file = /home/rundeck/ansible.cfg
configured module search path = [u'/home/rundeck/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Nov 14 2023, 16:14:06) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Rundeck version 5.61 on Rocky Linux 8, VMware VM, 16 vCPU's + 16 GB memory
openjdk 11.0.23 2024-04-16 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.23.0.9-2.el7_9) (build 11.0.23+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.23.0.9-2.el7_9) (build 11.0.23+9-LTS, mixed mode, sharing)
Hi Jim,
let me clarify again, this 100% for sure has nothing to do with a specific “job”
I know :) However, when I check the source code, the error occurs when the plugin validates the inventory (weird). I want to see if we have a problem with the Inventory’s format or the amount of data, like this issue.
So, could you try to publish an Inventory example to test?
Thank you for your feedback!