WINDOWS NODE COMMAND EXECUTION FAILED

50 views
Skip to first unread message

Diogène Mutombo

unread,
Jun 13, 2024, 5:26:49 PMJun 13
to rundeck-discuss
Hello,

I am getting error while executing command on windows node.
Here is commands I am executing

net stop "ISI-Com ICS :  Kernel"
net start "ISI-Com ICS :  Kernel"

here is the error 

net.schmizz.sshj.xfer.scp.SCPRemoteException: Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/285-5746-SVP-dispatch-script.tmp.bat': No such file or directory
at net.schmizz.sshj.xfer.scp.SCPEngine.check(SCPEngine.java:73)
at net.schmizz.sshj.xfer.scp.SCPEngine.sendMessage(SCPEngine.java:133)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.sendFile(SCPUploadClient.java:105)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.process(SCPUploadClient.java:84)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.startCopy(SCPUploadClient.java:76)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:54)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:47)
at net.schmizz.sshj.xfer.scp.SCPUploadClient.copy(SCPUploadClient.java:43)
at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:98)
at net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload(SCPFileTransfer.java:91)
at com.plugin.sshjplugin.model.SSHJScp.execute(SSHJScp.java:76)
at com.plugin.sshjplugin.SSHJFileCopierPlugin.copyFile(SSHJFileCopierPlugin.java:173)
at com.plugin.sshjplugin.SSHJFileCopierPlugin.copyFile(SSHJFileCopierPlugin.java:103)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.fileCopyFile(ExecutionServiceImpl.java:320)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.impl.DefaultScriptFileNodeStepUtils.executeScriptFile(DefaultScriptFileNodeStepUtils.java:119)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.impl.ScriptFileNodeStepUtils$executeScriptFile.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.impl.ScriptFileNodeStepUtils$executeScriptFile.call(Unknown Source)
at org.rundeck.plugin.scriptnodestep.ScriptFileNodeStepExecutor.executeScriptFile(ScriptFileNodeStepExecutor.groovy:85)
at org.rundeck.plugin.scriptnodestep.ScriptFileNodeStepExecutor$executeScriptFile.call(Unknown Source)
at org.rundeck.plugin.scriptnodestep.ScriptNodeStepPlugin.executeNodeStep(ScriptNodeStepPlugin.groovy:85)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter.executeNodeStep(NodeStepPluginAdapter.java:169)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeNodeStep(ExecutionServiceImpl.java:207)
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:263)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodes(ExecutionServiceImpl.java:234)
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:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:75)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
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)
Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/285-5746-SVP-dispatch-script.tmp.bat': No such file or directory
Failed: ConfigurationFailure: Configuration error: net.schmizz.sshj.xfer.scp.SCPRemoteException: Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/285-5746-SVP-dispatch-script.tmp.bat': No such file or directory
Execution failed: 5746 in project Operations: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [SVP: ConfigurationFailure: Configuration error: net.schmizz.sshj.xfer.scp.SCPRemoteException: Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/285-5746-SVP-dispatch-script.tmp.bat': No such file or directory + {dataContext=MultiDataContextImpl(map={}, base=null)} ]}, Node failures: {SVP=[ConfigurationFailure: Configuration error: net.schmizz.sshj.xfer.scp.SCPRemoteException: Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/285-5746-SVP-dispatch-script.tmp.bat': No such file or directory + {dataContext=MultiDataContextImpl(map={}, base=null)} ]}, status: failed]


What can i do ?

Best regards,

rac...@rundeck.com

unread,
Jun 14, 2024, 9:38:31 AMJun 14
to rundeck-discuss

Hi Diogène,

Is your project configured to use the pywinrm node executor/file copier? Can you share that config?

Alternatively, you can set the node-executor and file-copier attributes in your Windows remote node model source entry.

Example:

<node name="Hostname" description="Windows Server" tags="windows" hostname="192.168.10.10" osArch="amd64" osFamily="windows" osName="Windows Server 2022" osVersion="2022" username="Administrator" winrm-password-storage-path="keys/winpasswd" winrm-authtype="basic" node-executor="WinRMPython" file-copier="WinRMcpPython" />

I’ve included more info here.

Regards.

Diogène Mutombo

unread,
Jun 17, 2024, 3:29:38 AMJun 17
to rundeck-discuss
For the project I am using sshj-scp for both scp and nodexecutor as I have in the same project some jobs for Linux servers.

Here is my config
project.description=Service
project.disable.executions=false
project.disable.schedule=false
project.execution.history.cleanup.batch=500
project.execution.history.cleanup.enabled=true
project.execution.history.cleanup.retention.days=60
project.execution.history.cleanup.retention.minimum=50
project.execution.history.cleanup.schedule=0 0 0 1/1 * ? *
project.gui.motd.display=projectList,projectHome,navbar
project.jobs.gui.groupExpandLevel=1
project.keep-alive-max-alive-count=5
project.label=Operateurs
project.later.executions.disable=false
project.later.executions.enable=false
project.later.schedule.disable=false
project.later.schedule.enable=false
project.name=Operateurs
project.nodeCache.enabled=true
project.nodeCache.firstLoadSynch=true
project.output.allowUnsanitized=false
project.retry-counter=3
project.ssh-authentication=privateKey
project.ssh-key-storage-path=keys/rundeck/rundeck.key
resources.source.1.type=local
resources.source.2.config.file=/var/lib/rundeck/projects/Operateurs/etc/resources.xml
resources.source.2.config.format=resourcexml
resources.source.2.config.generateFileAutomatically=true
resources.source.2.config.writeable=true
resources.source.2.type=file
service.FileCopier.default.provider=sshj-scp
service.NodeExecutor.default.provider=sshj-ssh

Maybe using the alternative is the best solution ? 

Best regards,

Diogène Mutombo

unread,
Jun 17, 2024, 5:02:21 AMJun 17
to rundeck-discuss
PS:
We are using openssh on windows server.

When using the commands utility(RUNDECK GUI) the command is succeding and the server is rebooting
 even if I run from rundeck server terminal it succeding

#ssh ssh_remote_user@SVR 'whoami'
svr\ssh_remote_user

#ssh ssh_remote_user@SVR 'shutdown -f -r' -> the server is rebooting.

From the job workflow it is giving me that error : net.schmizz.sshj.xfer.scp.SCPRemoteException: Remote SCP command had error: scp: 'C:/WINDOWS/TEMP/1-1558-SVR-dispatch-script.tmp.bat': No such file or directory

rac...@rundeck.com

unread,
Jun 17, 2024, 10:50:34 AMJun 17
to rundeck-discuss

Hi Diogène,

I get it now.

It seems related to how SSHJ interprets the Windows paths. After some tests, I’ve reproduced your issue.

The quickest way to solve this is to switch to SSH Node Executor / File Copier (managed by JSCH plugin), you can do it at the project level (go to Project Settings> Edit Configuration > Default Node Executor & Default File Copier and change SSHJ by SSH).

If you prefer to do so via node level, you can add the node-executor and file-copy-destination-dir attributes as follows:

<?xml version="1.0" encoding="UTF-8"?> <project> <node name="windows" description="Windows Server 2022" tags="win" hostname="192.168.1.14" osArch="amd64" osFamily="windows" osName="Windows 2022" osVersion="21H2" username="Administrator" ssh-authentication="password" ssh-password-storage-path="keys/winpasswd" file-copy-destination-dir="C:\Windows\Temp" node-executor="jsch-ssh" file-copier="jsch-scp" /> </project>

Result.

If you need to use Powershell scripts, make sure to define the powershell.exe invocation string as follows:

- defaultTab: nodes description: '' executionEnabled: true id: bcce3833-45ee-4f2d-bfbf-3c9c97fd3092 loglevel: INFO name: WindowsScript nodeFilterEditable: false nodefilters: dispatch: excludePrecedence: true keepgoing: false rankOrder: ascending successOnEmptyNodeFilter: false threadcount: '1' filter: 'name: windows ' nodesSelectedByDefault: true plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - fileExtension: .ps1 interpreterArgsQuoted: false script: ls scriptInterpreter: powershell.exe keepgoing: false strategy: node-first uuid: bcce3833-45ee-4f2d-bfbf-3c9c97fd3092

Amyway, the best way to connect to Windows remote nodes is to use the Winrm native protocol via the pywinrm plugin.

Hope it helps.

Diogène Mutombo

unread,
Jun 20, 2024, 4:00:16 PM (12 days ago) Jun 20
to rundeck...@googlegroups.com
Hello,

THank you for your answer.
I have make it work by changing from SSHJ-SCP  to SCP plugin.

Best regards,

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/5dcdabc1-0cf1-4ba6-a71b-c7b05b639b38n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages