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

Powershell script returns an exit code of 1 even though its executing successfully #237

Open
Ankitr19 opened this issue Aug 22, 2022 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@Ankitr19
Copy link

Version: 2.3.2-universal-mingw32

[Version of the project installed]

Environment: Windows 11

[Details about the environment such as the Operating System, cookbook details, etc...]

Scenario: When running powershell scripts , the script is exiting with a status code of 1 rather then 0 even though the script is working fine

[What you are trying to achieve and you can't?]

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

[What actually happens after the reproduction steps?]

@Ankitr19 Ankitr19 added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Aug 22, 2022
@Ankitr19
Copy link
Author

Stack trace looks like -

C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2-universal-mingw32/lib/mixlib/shellout.rb:293:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2-universal-mingw32/lib/mixlib/shellout.rb:280:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/mixin/powershell_out.rb:48:in `powershell_out!'
c:/chef/rippling/setup/local-mode-cache/cache/cookbooks/cpe_utils/libraries/node_functions.rb:403:in `run_powershell_command'
c:/chef/rippling/setup/local-mode-cache/cache/cookbooks/ping/recipes/default_windows.rb:132:in `block (2 levels) in from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/provider/ruby_block.rb:31:in `block in action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/provider.rb:202:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/provider/ruby_block.rb:30:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/runner.rb:70:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/runner.rb:98:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/runner.rb:98:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/runner.rb:98:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/runner.rb:97:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/client.rb:718:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/client.rb:713:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/client.rb:713:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/client.rb:752:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application.rb:274:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application.rb:250:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application.rb:233:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/client.rb:457:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/client.rb:457:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/client.rb:441:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/lib/chef/application/solo.rb:225:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.0-universal-mingw32/bin/chef-solo:25:in `<top (required)>'
C:/opscode/chef/bin/chef-solo:59:in `load'
C:/opscode/chef/bin/chef-solo:59:in `<main>'```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant