Issue #14749 has been reported by Josh Cooper.
----------------------------------------
Bug #14749: puppet resource scheduled_task creates the task, but generates an
error
https://projects.puppetlabs.com/issues/14749
Author: Josh Cooper
Status: Accepted
Priority: Normal
Assignee: Josh Cooper
Category: windows
Target version: 2.7.x
Affected Puppet version:
Keywords: windows scheduled_task
Branch:
Executing the following creates the task, but generates an exception:
<pre>
C:\work\puppet>envpuppet puppet resource --debug --trace --verbose
scheduled_task pl107124 ensure=present command=c:/windows/system32/notepad.exe
debug: Loaded state in 0.00 seconds
notice: /Scheduled_task[pl107124]/ensure: created
debug: Finishing transaction 131594112
debug: Storing state
debug: Stored state in 0.02 seconds
c:/puppetwinbuilder/sys/ruby/lib/ruby/gems/1.8/gems/win32-taskscheduler-0.2.2/lib/win32/taskscheduler.rb:1297:in
`flags'
: null pointer (Win32::TaskScheduler::Error)
from
c:/work/puppet/ext/../lib/puppet/provider/scheduled_task/win32_taskscheduler.rb:49:in
`enabled'
from c:/work/puppet/ext/../lib/puppet/property.rb:277:in `send'
from c:/work/puppet/ext/../lib/puppet/property.rb:277:in `retrieve'
from c:/work/puppet/ext/../lib/puppet/type.rb:720:in `retrieve'
from c:/work/puppet/ext/../lib/puppet/type.rb:715:in `each'
from c:/work/puppet/ext/../lib/puppet/type.rb:715:in `retrieve'
from c:/work/puppet/ext/../lib/puppet/type.rb:728:in `retrieve_resource'
from c:/work/puppet/ext/../lib/puppet/type.rb:1930:in `to_trans'
from c:/work/puppet/ext/../lib/puppet/type.rb:1955:in `to_resource'
from c:/work/puppet/ext/../lib/puppet/indirector/resource/ral.rb:32:in
`save'
from c:/work/puppet/ext/../lib/puppet/indirector/indirection.rb:272:in
`save'
from c:/work/puppet/ext/../lib/puppet/application/resource.rb:227:in
`find_or_save_resources'
from c:/work/puppet/ext/../lib/puppet/application/resource.rb:144:in
`main'
from c:/work/puppet/ext/../lib/puppet/application.rb:317:in
`run_command'
from c:/work/puppet/ext/../lib/puppet/application.rb:309:in `run'
from c:/work/puppet/ext/../lib/puppet/application.rb:416:in `hook'
from c:/work/puppet/ext/../lib/puppet/application.rb:309:in `run'
from c:/work/puppet/ext/../lib/puppet/application.rb:407:in
`exit_on_fail'
from c:/work/puppet/ext/../lib/puppet/application.rb:309:in `run'
from c:/work/puppet/ext/../lib/puppet/util/command_line.rb:69:in
`execute'
from c:/work/puppet/ext/../bin/puppet:4
</pre>
The issue is that when the provider's flush method is called, it saves the
task, which releases (in the COM sense) the handle to the `@pITask`. Then
`puppet resource` retrieves the resource it just saved, and it reuses the
invalid task object.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.