overthere-winrm file copier attempting to copy file connection reset

34 views
Skip to first unread message

Osman Javed

unread,
Jun 19, 2020, 10:06:32 AM6/19/20
to rundeck-discuss
Hello,

I am trying to figure out what step I may have missed in order to have a job execute in-line script in a windows server.

This setup works fine on my existing windows node (winrm over HTTP) but for this new node registered, there is a requirement that WinRM activity be done over https. 

Both target servers are the same OS (Windows server 2012 R2), I enable the same firewall rules and extra server features )I enabled SMB on the target server and added the windows firewall rule to allow traffic) 

Telnet seems to work from rundeck server to target node on port 445 and 139. But the file copy operation fails. 

Some questions:

Does winrm perform the file-copy operation over 5986? Or does the file copy operation require 445 or 139? Either way I tried whitelisting all 3 ports 

But the log suggests there is some timeout error, is there any extended logging or something I can enable on the rundeck to see exactly what port it's trying to connect to for this file copy operation?

Is this error being returned from the target machine trying to file copy operation locally or the rundeck server trying toi reach \\O365AEH3.keenondots.io\C$\Users\Osman\Code\Scripts\5467-207237-O365AEH3-dispatch-script.tmp.py ?


16:05:04 1. execute O365AEH3[workflow] beginExecuteNodeStep(O365AEH3): NodeDispatch: ScriptFileItem{label='execute', script=[21682 chars]}
16:05:04[overthere-winrm:O365AEH3.keenondots.io]
16:05:04[overthere-winrm:O365AEH3.keenondots.io] ConnectionOptions[ connectionTimeoutMillis --> 86400000 winrmEnableHttps --> true address --> O365AEH3.keenondots.io os --> WINDOWS winrmKerberosUseHttpSpn --> false winrmHttpsHostnameVerificationStrategy --> ALLOW_ALL winrmKerberosAddPortToSpn --> false file-copy-destination-dir --> C:\Users\Osman\Code\Scripts connectionType --> WINRM_INTERNAL winrmHttpsCertificateTrustStrategy --> ALLOW_ALL password --> ******** port --> 5986 winrmTimeout --> PT86400.000S username --> script-runner ]
16:05:04[overthere-winrm:O365AEH3.keenondots.io] Destination file acquired C:\Users\Osman\Code\Scripts\5472-207256-O365AEH3-dispatch-script.tmp.py
16:05:04[overthere-winrm:O365AEH3.keenondots.io] Copying file to C:\Users\Osman\Code\Scripts\5472-207256-O365AEH3-dispatch-script.tmp.py
16:05:04[overthere-winrm:O365AEH3.keenondots.io] Closing connection
16:05:04com.xebialabs.overthere.RuntimeIOException: Cannot open \\O365AEH3.keenondots.io\C$\Users\Osman\Code\Scripts\5472-207256-O365AEH3-dispatch-script.tmp.py for writing: jcifs.smb.SmbException: Failed to connect: O365AEH3.keenondots.io/172.22.8.13
16:05:04jcifs.util.transport.TransportException: Connection in error
16:05:04jcifs.util.transport.TransportException
16:05:04java.net.SocketException: Connection reset
16:05:04 at java.net.SocketInputStream.read(SocketInputStream.java:210)
16:05:04 at java.net.SocketInputStream.read(SocketInputStream.java:141)
16:05:04 at jcifs.util.transport.Transport.readn(Transport.java:29)
16:05:04 at jcifs.smb.SmbTransport.peekKey(SmbTransport.java:388)
16:05:04 at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:288)
16:05:04 at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:319)
16:05:04 at jcifs.util.transport.Transport.run(Transport.java:241)
16:05:04 at java.lang.Thread.run(Thread.java:748)
16:05:04
16:05:04 at jcifs.util.transport.Transport.run(Transport.java:258)
16:05:04 at java.lang.Thread.run(Thread.java:748)
16:05:04
16:05:04 at jcifs.util.transport.Transport.connect(Transport.java:154)
16:05:04 at jcifs.smb.SmbTransport.connect(SmbTransport.java:307)
16:05:04 at jcifs.smb.SmbTree.treeConnect(SmbTree.java:156)
16:05:04 at jcifs.smb.SmbFile.doConnect(SmbFile.java:911)
16:05:04 at jcifs.smb.SmbFile.connect(SmbFile.java:954)
16:05:04 at jcifs.smb.SmbFile.connect0(SmbFile.java:880)
16:05:04 at jcifs.smb.SmbFile.open0(SmbFile.java:972)
16:05:04 at jcifs.smb.SmbFile.open(SmbFile.java:1006)
16:05:04 at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
16:05:04 at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
16:05:04 at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
16:05:04 at jcifs.smb.SmbFile.getOutputStream(SmbFile.java:2853)
16:05:04 at com.xebialabs.overthere.cifs.CifsFile.getOutputStream(CifsFile.java:344)
16:05:04 at com.dtolabs.rundeck.plugin.overthere.OTWinRMFileCopier.copyFileStream(OTWinRMFileCopier.java:109)
16:05:04 at com.dtolabs.rundeck.plugin.overthere.OTWinRMFileCopier.copyFile(OTWinRMFileCopier.java:139)
16:05:04 at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.fileCopyFile(ExecutionServiceImpl.java:319)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.steps.node.impl.DefaultScriptFileNodeStepUtils.executeScriptFile(DefaultScriptFileNodeStepUtils.java:106)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.steps.node.impl.ScriptFileNodeStepExecutor.executeNodeStep(ScriptFileNodeStepExecutor.java:64)
16:05:04 at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeNodeStep(ExecutionServiceImpl.java:206)
16:05:04 at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:130)
16:05:04 at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:61)
16:05:04 at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodesWith(ExecutionServiceImpl.java:262)
16:05:04 at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodes(ExecutionServiceImpl.java:233)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.steps.NodeDispatchStepExecutor.executeWorkflowStep(NodeDispatchStepExecutor.java:66)
16:05:04 at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:111)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWFItem(BaseWorkflowExecutor.java:287)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWorkflowStep(BaseWorkflowExecutor.java:683)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.engine.StepCallable.apply(StepCallable.java:71)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.engine.StepOperation.apply(StepOperation.java:76)
16:05:04 at com.dtolabs.rundeck.core.execution.workflow.engine.StepOperation.apply(StepOperation.java:32)
16:05:04 at com.dtolabs.rundeck.core.rules.WorkflowEngineOperationsProcessor.lambda$beginOperation$2(WorkflowEngineOperationsProcessor.java:327)
16:05:04 at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
16:05:04 at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
16:05:04 at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
16:05:04 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16:05:04 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16:05:04 at java.lang.Thread.run(Thread.java:748)

Reiner Acuña

unread,
Jun 19, 2020, 10:30:44 AM6/19/20
to rundeck-discuss
Hi Osman,

All operations that involve the winrm port 5985 or 5986(SSL). About the error indicates that can't reach the machine specified (similar to this: https://github.com/rundeck-plugins/rundeck-winrm-plugin/issues/57#issuecomment-520243734), can you try using the IP address instead of hostname?

So, right now Rundeck uses by default the new PyWinRM (out of the box with Rundeck) plugin instead of Overthere WinRM plugin, easiest to configure, take a look at this.

https://github.com/rundeck-plugins/py-winrm-plugin

Regards!

javed...@gmail.com

unread,
Jun 19, 2020, 11:19:31 AM6/19/20
to rundeck...@googlegroups.com
Hello,

Thanks for your reply.

I have pyWinRM plugins for the longest time but I had no idea there was a drop-down selector in the Edit Configuration... option. 

It works with PyWinRM.



--
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/b2c86a07-73ce-45df-bf8e-522951ddf36co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages