Task Sched­uler is fail­ing to run a par­tic­u­lar task. Or, rather, it’s run­ning it, exit­ing imme­di­ately, and refus­ing to log the out­put. (I don’t know why Microsoft came up with the bril­liant idea of Task Sched­uler not hav­ing a MAILTO fea­ture!) This is a PHP com­mand, some­thing like php file.php --param=val …all Task Sched­uler sees it as, accord­ing to its log, is Task Scheduler successfully completed task "\Stage\DB\Generate_VU_files" , instance "{3676cfd5-9fc0-460d-9738-1b1b5347ecb9}" , action "C:\Program Files (x86)\PHP\php.exe" with return code 255. Agh! Tell me more!

When the same ‘action’ com­mand com­mand is run from the com­mand line, by the same user as whom Task Sched­uler runs the task, every­thing works fine. There is no error, and the com­mand does it stuff. Run­ning through Task Sched­uler, on the other hand… :-(

The chances are that this is a per­mis­sions prob­lem.

Yes, it would seem that attempt­ing to change per­mis­sions on a par­ent direc­tory of the direc­tory to which the com­mand is try­ing to write gives “Error Apply­ing Secu­rity”.

An answer on Server Fault sug­gests tak­ing own­er­ship (and only in Windows-world does one see things like “This can hap­pen if you really don’t have access to that direc­tory.”! because one’s first thought is always that the error is just stu­pid and not telling you the whole story —— I’m an admin, and admins have write access, but do I have write access? No!).

So I changed the owner of the tar­get direc­tory, click­ing “Replace owner on sub­con­tain­ers and objects”.

[tbc]

[No comments] [Permanent link]

Leave a Reply

Your email address will not be published. Required fields are marked *