Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke "org.rundeck.storage.api.Path.getPath()" because "path" is null #357

Open
len-ro opened this issue Mar 31, 2024 · 0 comments

Comments

@len-ro
Copy link

len-ro commented Mar 31, 2024

Hello,

In the process of migrating rundeck 4.17 -> 5.1.2 I noticed none of the jobs ran due to:

[quartzScheduler_Worker-1] - Execution failed: 394004 in project symphony: [Workflow result: , step failures: {2=PluginFailed: Cannot invoke "org.rundeck.storage.api.Path.getPath()" because "path" is null}, Node failures: {devops.diapason-treasury.com=[]}, status: failed]

After investigation I found the stackTrace to be, related to tag v3.2.9:

Failed executing step plugin [com.batix.rundeck.plugins.AnsiblePlaybookWorkflowStep]: java.lang.NullPointerException: Cannot invoke "org.rundeck.storage.api.Path.getPath()" because "path" is null
	at com.dtolabs.rundeck.core.storage.ProjectKeyStorageContextProvider.environmentForPath(ProjectKeyStorageContextProvider.java:40)
	at com.dtolabs.rundeck.core.storage.AuthRundeckStorageTree.authorizedPath(AuthRundeckStorageTree.java:62)
	at com.dtolabs.rundeck.core.storage.AuthRundeckStorageTree.getResource(AuthRundeckStorageTree.java:125)
	at com.dtolabs.rundeck.core.storage.AuthRundeckStorageTree.getResource(AuthRundeckStorageTree.java:32)
	at com.dtolabs.rundeck.core.storage.ResolvedExtTree.getResource(ResolvedExtTree.java:68)
	at org.rundeck.storage.impl.DelegateTree.getResource(DelegateTree.java:56)
	at com.rundeck.plugins.ansible.ansible.AnsibleRunnerBuilder.getPassphraseStorageData(AnsibleRunnerBuilder.java:930)
	at com.rundeck.plugins.ansible.ansible.AnsibleRunnerBuilder.getPassphrase(AnsibleRunnerBuilder.java:898)
	at com.rundeck.plugins.ansible.ansible.AnsibleRunnerBuilder.buildAnsibleRunner(AnsibleRunnerBuilder.java:729)
	at com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorkflowStep.executeStep(AnsiblePlaybookWorkflowStep.java:88)
	at com.dtolabs.rundeck.core.execution.workflow.steps.StepPluginAdapter.executeWorkflowStep(StepPluginAdapter.java:120)
	at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:111)
	at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWFItem(BaseWorkflowExecutor.java:285)

I managed to fix this by modifying AnsibleRunnerBuilder.java:

public String getPassphraseStorageData(String storagePath) throws ConfigurationException {
        if(storagePath == null) {
            return null;
        }
        Path path = PathUtil.asPath(storagePath);

to return null if storagePath is null.

I am providing the fix if someone needs it also.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant