NetDocuments-Archive / rd-winrm-plugin

Allows rundeck to execute commands with powershell
Apache License 2.0
31 stars 19 forks source link

"can't dup NilClass" error when attempting to execute simple job #14

Open fellenberger opened 8 years ago

fellenberger commented 8 years ago

Seeing the following error in Rundeck (v2.6.2) when attempting to use the WinRM Node Executor to exec a simple remote command. This is on Win2K12 R2. Any guidacne would be appreciated. I'm a Rundeck / WinRM newby FWIW.

[WinRMexe] execCommand started, command: cmd /C dir C: [WinRMexe] executing: [[ruby, E:\rundeck\libext\cache\rd-winrm-plugin-1.3.2\winrmexe.rb]] E:/rundeck/libext/cache/rd-winrm-plugin-1.3.2/winrmexe.rb:4:in dup': can't dup NilClass (TypeError) from E:/rundeck/libext/cache/rd-winrm-plugin-1.3.2/winrmexe.rb:4:in

' [WinRMexe]: result code: 1, success: false Failed: NonZeroResultCode: [WinRMexe] Result code: 1

H:>ruby -v ruby 2.0.0p648 (2015-12-16) [i386-mingw32]

H:>gem list --local

* LOCAL GEMS *

bigdecimal (1.2.0) builder (3.2.2) erubis (2.7.0) ffi (1.9.10 x86-mingw32) gssapi (1.2.0) gyoku (1.3.1) httpclient (2.7.1) io-console (0.4.2) json (1.7.7) little-plugger (1.1.4) logging (2.0.0, 1.8.2) minitest (4.3.2) multi_json (1.11.2) nori (2.6.0) psych (2.0.0) rake (0.9.6) rdoc (4.0.0) rubyntlm (0.5.3) rubyzip (1.1.7) test-unit (2.0.0.0) winrm (1.6.1) winrm-fs (0.3.0)

spuder commented 8 years ago

I don't think this plugin has been tested on a windows host.

@vvchik Any idea what might be going on?

fellenberger commented 8 years ago

Looks like this error is avoidable if the proper windows credentials are stored either at the project level, or as options at the job level. Was able to get this working on the Win2K12R2 server, as well as a RHEL 7 box.

I do have some other questions pertaining to storage of passwords in the job option (specifically, Secure Remote Authentication) option does not work, what is the best forum to pose those questions as well as glean additional details on using this plugin?

Great work! Was able to execute commands in various fashion, and looking forward to doing more with the remoting capabilities!

vvchik commented 8 years ago

True, it was never tested on Windows box. Good to know that you was able to find proper configuration. Where do you try to store credentials? I want to check this case.

Secured storage isn't supported yet. But PR connected to is kindly welcome.

Questions better to ask here, using GitHub issues, It is small project, so no support forums or webpage is exists.

SolarisYan commented 7 years ago

hi, does this plugin can config on node level? thanks