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

Invoke-BoltCommand fails when passing multiple servers to -Targets #2739

Closed
rogfut opened this issue Mar 25, 2021 · 4 comments
Closed

Invoke-BoltCommand fails when passing multiple servers to -Targets #2739

rogfut opened this issue Mar 25, 2021 · 4 comments
Labels
Bug Bug reports and fixes.

Comments

@rogfut
Copy link

rogfut commented Mar 25, 2021

Describe the Bug

When running an Invoke-BoltCommand and passing in a server list text file that is UTF8 encoded with .txt extension, the command throws 800+ line Traceback

Invoke-BoltCommand -Command "write-host 'hi'" -Targets '@servers.txt' -Transport winrm -Ssl:$false -User roger@example.com -PasswordPrompt

This also happens when I pass in a comma delimited server list as a string:

Invoke-BoltCommand -Command "write-host 'hi'" -Targets 'server01.example.com,server02.example.com' -Transport winrm -Ssl:$false -User roger@example.com -PasswordPrompt

Expected Behavior

The bolt command should be successful and output the following:

Started on <server>...
Finished on <server>:
  hi

When I run the command and pass a single server to -Targets, the command is successful.

Invoke-BoltCommand -Command "write-host 'hi'" -Targets 'server01.example.com' -Transport winrm -Ssl:$false -User roger@example.com -PasswordPrompt

Steps to Reproduce

Invoke-BoltCommand -Command "write-host 'hi'" -Targets '@servers.txt' -Transport winrm -Ssl:$false -User roger@example.com -PasswordPrompt

where @'servers.txt' has 12+ servers, is in my cwd, is UTF8 encoded with CRLF end of line sequence

Format is like:

server1.example.com
server2.example.com
server3.example.com

Environment

  • Version 3.4.0
  • Platform Windows 10 Enterprise 10.0.17763
  • Powershell version
    Major Minor Build Revision

5 1 17763 1490

Additional Context

Stdout from the command is attached
puppet_error_log.txt

@lucywyman
Copy link
Contributor

Ah, that's a duplicate of this issue: #1478
We spent a few days investigating the issue when it first happened, but it only happens very rarely and we couldn't pinpoint what the actual issue is. Previously we had only seen this on MacOS though, so running into it on Windows is a very interesting new data point! Just for a little more data to help us diagnose the issue, how did you install Bolt?

Re-installing (through whatever method you originally installed it) should do the trick, and to be extra sure you can remove C:\Program Files\Puppet Labs\Bolt first and then reinstall. Let us know if that doesn't work and we'll help get you sorted!

@rogfut
Copy link
Author

rogfut commented Mar 25, 2021

Hi Lucy, I installed bolt using the Windows MSI. I had a previous bolt installed via MSI (2.7 or something? not sure!).

I'll go ahead and uninstall => clean C:\Program Files\Puppet Labs\Bolt => install via msi again. Will let you know how it goes.

@beechtom
Copy link
Contributor

beechtom commented Mar 25, 2021

@rogfut Those deprecation warnings are from the gssapi gem, which is one of Bolt's dependencies. We have a PR up to fix it, which you can track here: zenchild/gssapi#35 .

@rogfut
Copy link
Author

rogfut commented Mar 25, 2021

@lucywyman reinstall seemed to have done the trick, feel free to close if this is a duplicate

Hi @beechtom if you are referring to the deleted comment I forgot to set the -Transport to winrm 🤦‍♂️ Thanks for the link to the PR I've subscribed to it

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

No branches or pull requests

3 participants