Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2818

Win32-taskscheduler gem 0.2.2 (patched in vendored repo) crashes when task scheduler is disabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • None
    • PUP 3.7.0
    • None
    • None

    Description

      This ticket should represent more of a verification of behavior in the latest 0.3.0 taskscheduler gem after upgrading to the latest version during x64 FFI work.

      According to user reports, a crash occurs at the following line of puppet-win32-ruby:

      https://github.com/puppetlabs/puppet-win32-ruby/blob/1.9.3-p484.3/ruby/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.2/lib/win32/taskscheduler.rb#L529

      Where ptr_to_string is called:
      https://github.com/puppetlabs/puppet-win32-ruby/blob/1.9.3-p484.3/ruby/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.2/lib/win32/taskscheduler.rb#L1637

      It was determined that the reason for the crash is ultimately that the task scheduler service has been disabled on affected boxes. At the very least, Puppet should perform a check on the service and report a sensible error message.

      The following callstack appears on PE 3.2.1:

      Could not evaluate: undefined method `+' for nil:NilClass c:/Program Files/Puppet Labs/Puppet Enterprise/sys/ruby/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.2/lib/win32/taskscheduler.rb:1637:in `ptr_to_string' c:/Program Files/Puppet Labs/Puppet Enterprise/sys/ruby/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.2/lib/win32/taskscheduler.rb:529:in `account_information' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb:65:in `user' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/property.rb:471:in `retrieve' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type.rb:1045:in `block in retrieve' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type.rb:1040:in `each' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type.rb:1040:in `retrieve' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type.rb:1063:in `retrieve_resource' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction/resource_harness.rb:223:in `from_resource' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction/resource_harness.rb:19:in `evaluate' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:174:in `apply' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:187:in `eval_resource' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:117:in `call' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util.rb:327:in `block in thinmark' c:/Program Files/Puppet Labs/Puppet Enterprise/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util.rb:326:in `thinmark' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:117:in `block in evaluate' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/graph/relationship_graph.rb:118:in `traverse' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction.rb:108:in `evaluate' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util/log.rb:149:in `with_destination' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/resource/catalog.rb:163:in `apply' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util.rb:161:in `block in benchmark' c:/Program Files/Puppet Labs/Puppet Enterprise/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util.rb:160:in `benchmark' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/configurer.rb:124:in `apply_catalog' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/configurer.rb:192:in `run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent/locker.rb:20:in `lock' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:114:in `with_client' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:79:in `run_in_fork' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:40:in `block in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:179:in `call' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:179:in `controlled_run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/agent.rb:38:in `run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application/agent.rb:355:in `onetime' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application/agent.rb:321:in `run_command' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:364:in `block (2 levels) in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:470:in `plugin_hook' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:364:in `block in run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util.rb:478:in `exit_on_fail' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/application.rb:364:in `run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util/command_line.rb:137:in `run' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/util/command_line.rb:91:in `execute' c:/Program Files/Puppet Labs/Puppet Enterprise/puppet/bin/puppet:4:in `<main>'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ethan Ethan Brown
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support