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

Transports that detect Powershell Core (pwsh) or Powershell (powershell) do not function if Powershell Core is also installed on Windows. #720

Open
rlakey opened this issue Feb 8, 2022 · 0 comments

Comments

@rlakey
Copy link
Contributor

rlakey commented Feb 8, 2022

Version:

3.8.1

Environment:

Windows

Scenario:

Transports that detect Powershell Core (pwsh) or Powershell (powershell) do not function if Powershell Core is also installed on Windows.

Powershell Core is cross platform so it can't be assumed to mean Linux or Mac.

Steps to Reproduce:

Install Powershell 7 on a Windows 10 system. Attempt to run a profile with the vmware transport.

Expected Result:

Playbook executes successfully.

Actual Result:

The logic in vmware.rb detects the pwsh executable on Windows but then seems to perform functions that to not work on Windows but do work fine on Linux.

<internal:io>:63:in `read_nonblock': A non-blocking socket operation could not be completed immediately. - read would block (IO::EWOULDBLOCKWaitReadable)
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:122:in `flush_stdout'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:189:in `session'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:146:in `parse_pwsh_output'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:87:in `run_command_via_connection'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:64:in `connect'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:54:in `initialize'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:17:in `new'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/train-3.8.1/lib/train/transports/vmware.rb:17:in `connection'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/backend.rb:38:in `create'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/runner.rb:87:in `configure_transport'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/runner.rb:79:in `initialize'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/cli.rb:284:in `new'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/cli.rb:284:in `exec'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.41.20/lib/inspec/base_cli.rb:35:in `start'
        from C:/opscode/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-bin-4.41.20/bin/inspec:11:in `<top (required)>'
        from C:/opscode/chef-workstation/bin/inspec:386:in `load'
        from C:/opscode/chef-workstation/bin/inspec:386:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant