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

scheduled_task won't work with schedule monthly

    XMLWordPrintable

Details

    • Hide

      Apply manifest with monthly schedule, use puppet resource to verify. Add spec test.

      Show
      Apply manifest with monthly schedule, use puppet resource to verify. Add spec test.
    • Windows
    • 1
    • Windows Kanban

    Description

      When trying to set a scheduled_task trigger I get the following error:

      C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:8:in `<main>'
      Error: /Stage[main]/Adoberum::Service/Scheduled_task[Adobe Remote Update Manager
      ]/ensure: change from absent to present failed: Failed to call #<Win32::TaskSche
      duler::COM::TaskTrigger:0x0000000872bd18>::SetTrigger with HRESULT: -2147024809.
      :  The parameter is incorrect.
      

      This happens for both month-by-date and month-by-weekday.

      My scheduled_task resource is as follows:

      scheduled_task { 'Adobe Remote Update Manager':
            ensure    => present,
            command   => $adoberum::command_source,
            enabled   => true,
            trigger   => {schedule => monthly, on => [1,3,last,17], start_time => '08:00', months => [1, 3, 5]},
          }
      

      I've tried quoting and unquoting the parameter in the triggers hash. Works completely fine for daily and weekly triggers.

      This has been tested on two different windows 7 machines with two different puppet version and the error is the same.

      Full Trace(from 3.7.4 Puppet):

      Error: Failed to call #<Win32::TaskScheduler::COM::TaskTrigger:0x0000000872bd18>
      ::SetTrigger with HRESULT: -2147024809.:  The parameter is incorrect.
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/com.rb:142:in
       `block (3 levels) in []'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:966:in `block (2 levels) in populate_trigger'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:918:in `initialize'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:918:in `new'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:918:in `block in populate_trigger'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:917:in `initialize'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:917:in `new'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:917:in `populate_trigger'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:621:in `block (2 levels) in trigger='
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/com.rb:117:in
       `block in UseInstance'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/com.rb:114:in
       `initialize'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/com.rb:114:in
       `new'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/com.rb:114:in
       `UseInstance'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:620:in `block in trigger='
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:615:in `initialize'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:615:in `new'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/taskscheduler
      .rb:615:in `trigger='
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:193:in `block in trigger='
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:188:in `each'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:188:in `trigger='
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:216:in `block in create'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:215:in `each'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/provider/scheduled_task/wi
      n32_taskscheduler.rb:215:in `create'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/property/ensure.rb:16:in `
      block in defaultvalues'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/property.rb:197:in `call_v
      aluemethod'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/property.rb:498:in `set'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/property.rb:581:in `sync'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harne
      ss.rb:204:in `sync'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harne
      ss.rb:128:in `sync_if_needed'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harne
      ss.rb:81:in `perform_changes'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harne
      ss.rb:20:in `evaluate'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:204:in `app
      ly'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:217:in `eva
      l_resource'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:147:in `cal
      l'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:147:in `blo
      ck (2 levels) in evaluate'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:327:in `block in t
      hinmark'
      C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.0.0/benchmark.rb:296:in
      `realtime'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:326:in `thinmark'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:147:in `blo
      ck in evaluate'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/graph/relationship_graph.r
      b:118:in `traverse'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:138:in `eva
      luate'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/resource/catalog.rb:169:in
       `block in apply'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_d
      estination'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/transaction/report.rb:112:
      in `as_logging_destination'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/resource/catalog.rb:168:in
       `apply'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:120:in `bloc
      k in apply_catalog'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:161:in `block in b
      enchmark'
      C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.0.0/benchmark.rb:296:in
      `realtime'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark'
       
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:119:in `appl
      y_catalog'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:227:in `run_
      internal'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:134:in `bloc
      k in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/context.rb:64:in `override
      '
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet.rb:244:in `override'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:133:in `run'
       
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:47:in `block (4 l
      evels) in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `loc
      k'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:47:in `block (3 l
      evels) in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:117:in `with_clie
      nt'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:44:in `block (2 l
      evels) in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:82:in `run_in_for
      k'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:43:in `block in r
      un'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `cal
      l'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `con
      trolled_run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:41:in `run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:356:i
      n `onetime'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:322:i
      n `run_command'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:381:in `blo
      ck (2 levels) in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:507:in `plu
      gin_hook'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:381:in `blo
      ck in run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:488:in `exit_on_fa
      il'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:381:in `run
      '
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:146:i
      n `run'
      C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:92:in
       `execute'
      C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:8:in `<main>'
      Error: /Stage[main]/Adoberum::Service/Scheduled_task[Adobe Remote Update Manager
      ]/ensure: change from absent to present failed: Failed to call #<Win32::TaskSche
      duler::COM::TaskTrigger:0x0000000872bd18>::SetTrigger with HRESULT: -2147024809.
      :  The parameter is incorrect.
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              r0b0tAnthony Anthony Scudese
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support