Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7240

scheduled_task : Setting a user for a task fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: scheduled_task
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      • The given manifest works properly without failure, creating a task
      • New tests to prevent regression (integration should be sufficient)
    • Team:
      Windows
    • Story Points:
      1
    • Sprint:
      Windows 2018-08-15, Windows 2018-08-22
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Set a non-SYSTEM user for a task via manifest like the following:

      scheduled_task { 'test':
        ensure        => 'present',
        command       => 'c:\\windows\\system32\\notepad.exe',
        trigger       => [
        {
          'schedule' => 'once',
          'start_date' => '2018-04-30',
          'start_time' => '00:00',
        }],
        user          => 'VAGRANT-2008R2\\Administrator',
      }
      

      Puppet will declare the resource created and will emit an error, even though the task is never created.

      bundle exec puppet apply .\test-task.pp --modulepath .\spec\fixtures\modules\
      Notice: Compiled catalog for vagrant-2008r2.localdomain in environment production in 0.14 seconds
      Notice: /Stage[main]/Main/Scheduled_task[test]/ensure: created
      Error: /Stage[main]/Main/Scheduled_task[test]: Could not evaluate: (in OLE method `RegisterTaskDefinition': )
          OLE error code:8007052E in <Unknown>
            <No Description>
          HRESULT error code:0x80020009
            Exception occurred.
      Notice: Applied catalog in 0.37 seconds
      

      Puppet reports the task as missing:

      bundle exec puppet resource scheduled_task test --modulepath .\spec\fixtures\modules\
      scheduled_task { 'test':
        ensure => 'absent',
      }
      

      The full stack trace for the error is:

      Error: /Stage[main]/Main/Scheduled_task[test]: Could not evaluate: (in OLE method `RegisterTaskDefinition': )
          OLE error code:8007052E in <Unknown>
            <No Description>
          HRESULT error code:0x80020009
            Exception occurred.
      C:/source/puppetlabs-scheduled_task/lib/puppet_x/puppetlabs/scheduled_task/taskscheduler2.rb:157:in `method_missing'
       
      C:/source/puppetlabs-scheduled_task/lib/puppet_x/puppetlabs/scheduled_task/taskscheduler2.rb:157:in `save'
      C:/source/puppetlabs-scheduled_task/lib/puppet_x/puppetlabs/scheduled_task/v2adapter.rb:63:in `save'
      C:/source/puppetlabs-scheduled_task/lib/puppet/provider/scheduled_task/taskscheduler_api2.rb:189:in `flush'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/type.rb:1006:in `flush'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction/resource_harness.rb:25:in `evaluate'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:248:in `apply'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:267:in `eval_resource'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:179:in `call'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:179:in `block (2 levels) in evaluate'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util.rb:511:in `block in thinmark'
      C:/tools/ruby24/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util.rb:510:in `thinmark'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:179:in `block in evaluate'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/graph/relationship_graph.rb:121:in `traverse'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction.rb:169:in `evaluate'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/resource/catalog.rb:225:in `block in apply'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util/log.rb:155:in `with_destination'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/transaction/report.rb:140:in `as_logging_destination'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/resource/catalog.rb:224:in `apply'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/configurer.rb:172:in `block in apply_catalog'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util.rb:224:in `block in benchmark'
      C:/tools/ruby24/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util.rb:223:in `benchmark'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/configurer.rb:171:in `apply_catalog'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/configurer.rb:344:in `run_internal'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/configurer.rb:222:in `block in run'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/context.rb:65:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet.rb:263:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/configurer.rb:196:in `run'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application/apply.rb:356:in `apply_catalog'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application/apply.rb:280:in `block (2 levels) in main'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/context.rb:65:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet.rb:263:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application/apply.rb:280:in `block in main'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/context.rb:65:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet.rb:263:in `override'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application/apply.rb:233:in `main'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application/apply.rb:174:in `run_command'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application.rb:358:in `block in run'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util.rb:666:in `exit_on_fail'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/application.rb:358:in `run'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util/command_line.rb:132:in `run'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/lib/puppet/util/command_line.rb:72:in `execute'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/gems/puppet-5.3.3-x64-mingw32/bin/puppet:5:in `<top (required)>'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/bin/puppet:22:in `load'
      C:/source/puppetlabs-scheduled_task/.bundle/gems/ruby/2.4.0/bin/puppet:22:in `<main>'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              william.hurt William Hurt
              Reporter:
              ethan Ethan Brown
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support