NetDocuments-Archive / rd-winrm-plugin

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

winrmexe.rb:96: syntax error, unexpected ':' #48

Closed DerfOh closed 6 years ago

DerfOh commented 7 years ago

Hi, I am getting the following output when trying to execute a job. Any ideas? I've tried changing the credentials many ways to no avail.

[WinRMexe] execCommand started, command: (get-date) - (gcim Win32_OperatingSystem).LastBootUpTime
[WinRMexe] executing: [[ruby, /export/local/rundeck_rcm/libext/cache/rd-winrm-plugin-1.5.1/winrmexe.rb]]
/export/local/rundeck_rcm/libext/cache/rd-winrm-plugin-1.5.1/winrmexe.rb:96: syntax error, unexpected ':', expecting ')'
...ew(endpoint, :negotiate, user: user, pass: pass)
                              ^
/export/local/rundeck_rcm/libext/cache/rd-winrm-plugin-1.5.1/winrmexe.rb:96: syntax error, unexpected ':', expecting '='
... :negotiate, user: user, pass: pass)
                              ^
/export/local/rundeck_rcm/libext/cache/rd-winrm-plugin-1.5.1/winrmexe.rb:98: syntax error, unexpected ':', expecting ')'
...ew(endpoint, :kerberos, realm: realm)
                              ^
[WinRMexe]: result code: 1, success: false
Failed: NonZeroResultCode: [WinRMexe] Result code: 1

Ruby version:

ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

WinRM version:

1.5.1

Any help is greatly appreciated!

spuder commented 7 years ago

Sorry, We aren't actively using this plugin at the moment so support is limited. @vvchik any ideas?

DerfOh commented 7 years ago

Thanks @spuder I updated Ruby without any success, here's the current output for the version:

ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
spuder commented 7 years ago

I actually think you need to try downgrading ruby. When this was released I think ruby 2.1 or 2.2 was the most recent version.

UnicodeTreason commented 7 years ago

Im running this plugin on the following versions without trouble:

Using the following gems:

Im yet to find time to test any upgrade path from these versions. Newer gems shouldnt matter as I locked the version in one of my previous Pull Requests. But newer Ruby might have unexpected behaviour.

UnicodeTreason commented 6 years ago

@DerfOh I learnt a lot in my recent travels to add error handling to this code, were you still having this issue at all?

UnicodeTreason commented 6 years ago

This might be closable? No response from OP and not an error I've ever seen in my environment.