Issue #14749 has been updated by Patrick Carlisle.

Status changed from In Topic Branch Pending Review to Merged - Pending Release
Target version changed from 2.7.x to 2.7.18

Merged in 
<https://github.com/puppetlabs/puppet/commit/c737f5066e6ae43f742daf3920e54dcfdd974cf3>
----------------------------------------
Bug #14749: puppet resource scheduled_task creates the task, but generates an 
error
https://projects.puppetlabs.com/issues/14749#change-66617

Author: Josh Cooper
Status: Merged - Pending Release
Priority: Normal
Assignee: Josh Cooper
Category: windows
Target version: 2.7.18
Affected Puppet version: 2.7.8
Keywords: windows scheduled_task
Branch: https://github.com/puppetlabs/puppet/pull/828


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.

Reply via email to