ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Windows Server 2012 - Task Scheduler Issue

    IT Discussion
    8
    54
    3.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • anthonyhA
      anthonyh
      last edited by

      What's killing me is this only impacts some tasks. Other tasks that run as the SYSTEM account that do similar functions (execute a PowerShell script that does a SQL query and ships the result to its respective destination) are fine.

      I don't know how the underlyings of the Task Scheduler work, but a WAG says that something on the back end is corrupt/broken. I dunno if there is a "rebuild" Task Scheduler sort of function.

      1 Reply Last reply Reply Quote 0
      • anthonyhA
        anthonyh @Obsolesce
        last edited by

        @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

        Well, create a new task with the same settings and see if that gives the same issue.

        Yeah, I think I may just do that. Though I'd really like to know 1) what happened (?!?!), and 2) if there is a better fix than to just re-do things, heh.

        ObsolesceO 1 Reply Last reply Reply Quote 0
        • 1
          1337
          last edited by

          How many tasks are we talking about?

          I would probably export them, delete and import just to be certain.

          And make sure task history is enabled.

          anthonyhA 1 Reply Last reply Reply Quote 1
          • anthonyhA
            anthonyh @1337
            last edited by

            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

            @anthonyh

            Has this only happened once?

            Nope. It's been happening for at least a week or so. I've finally pulled a majority of my hair out and made a post here.

            There is always the possibility that it is the task scheduling service that fails or one of it's dependencies.

            You could create a new task that triggers a simple script that just writes the current time in a log file.
            If the task service fails to run you would know and also be able to see when.

            There are some settings under the service as well what the service should do if it fails. Might want to check those as well.

            If the Task Scheduler service was failing, wouldn't that be written to the Event Log? If so, it's not.

            1 1 Reply Last reply Reply Quote 0
            • ObsolesceO
              Obsolesce @anthonyh
              last edited by

              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

              @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

              Well, create a new task with the same settings and see if that gives the same issue.

              Yeah, I think I may just do that. Though I'd really like to know 1) what happened (?!?!), and 2) if there is a better fix than to just re-do things, heh.

              Well, you could add into the script at the end, to remove the scheduled task and create it again, followed by a verification of such, and to email you if it fails.

              1 Reply Last reply Reply Quote 0
              • 1
                1337 @anthonyh
                last edited by

                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                @anthonyh

                Has this only happened once?

                Nope. It's been happening for at least a week or so. I've finally pulled a majority of my hair out and made a post here.

                There is always the possibility that it is the task scheduling service that fails or one of it's dependencies.

                You could create a new task that triggers a simple script that just writes the current time in a log file.
                If the task service fails to run you would know and also be able to see when.

                There are some settings under the service as well what the service should do if it fails. Might want to check those as well.

                If the Task Scheduler service was failing, wouldn't that be written to the Event Log? If so, it's not.

                Well, we are kind of assuming that we are dealing with something that has changed or is not the way it should. Either a software bug, a change made by windows updates, insufficient privileges or something of that nature.

                1 Reply Last reply Reply Quote 0
                • anthonyhA
                  anthonyh @1337
                  last edited by

                  @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                  How many tasks are we talking about?

                  I would probably export them, delete and import just to be certain.

                  And make sure task history is enabled.

                  Looks like at least 4 tasks are having this issue (there may be some more, I need to do another pass through the scheduled tasks). I'm going to try an export/delete/import and see what happens...

                  ObsolesceO 1 Reply Last reply Reply Quote 0
                  • ObsolesceO
                    Obsolesce @anthonyh
                    last edited by

                    @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                    @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                    How many tasks are we talking about?

                    I would probably export them, delete and import just to be certain.

                    And make sure task history is enabled.

                    Looks like at least 4 tasks are having this issue (there may be some more, I need to do another pass through the scheduled tasks). I'm going to try an export/delete/import and see what happens...

                    Don't import the old task. Create it new. Just set the same options, but new start date.

                    1 1 Reply Last reply Reply Quote 1
                    • anthonyhA
                      anthonyh
                      last edited by

                      Wow, so I just went through all the scheduled tasks on this box.

                      There are 41 tasks total. Out of the 41, there are 13 that are in this weird "ignored" condition. Bleh. This is going to be fun re-creating these.

                      DashrenderD 1 Reply Last reply Reply Quote 0
                      • DashrenderD
                        Dashrender @anthonyh
                        last edited by

                        @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                        Wow, so I just went through all the scheduled tasks on this box.

                        There are 41 tasks total. Out of the 41, there are 13 that are in this weird "ignored" condition. Bleh. This is going to be fun re-creating these.

                        Perhaps export them all - then find out how to re-create them using powershell. Then you'll have a backup for them incase you need to migrate this to another server, etc for the future.

                        anthonyhA 1 Reply Last reply Reply Quote 0
                        • anthonyhA
                          anthonyh @Dashrender
                          last edited by

                          @Dashrender said in Windows Server 2012 - Task Scheduler Issue:

                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                          Wow, so I just went through all the scheduled tasks on this box.

                          There are 41 tasks total. Out of the 41, there are 13 that are in this weird "ignored" condition. Bleh. This is going to be fun re-creating these.

                          Perhaps export them all - then find out how to re-create them using powershell. Then you'll have a backup for them incase you need to migrate this to another server, etc for the future.

                          Not a bad idea.

                          ObsolesceO 1 Reply Last reply Reply Quote 0
                          • 1
                            1337 @Obsolesce
                            last edited by

                            @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                            @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                            @Pete-S said in Windows Server 2012 - Task Scheduler Issue:

                            How many tasks are we talking about?

                            I would probably export them, delete and import just to be certain.

                            And make sure task history is enabled.

                            Looks like at least 4 tasks are having this issue (there may be some more, I need to do another pass through the scheduled tasks). I'm going to try an export/delete/import and see what happens...

                            Don't import the old task. Create it new. Just set the same options, but new start date.

                            Makes no sense. They will be exactly the same regardless. If you want another start date (which makes no difference) just change it in the xml.

                            1 Reply Last reply Reply Quote -1
                            • ObsolesceO
                              Obsolesce @anthonyh
                              last edited by

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              @Dashrender said in Windows Server 2012 - Task Scheduler Issue:

                              @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                              Wow, so I just went through all the scheduled tasks on this box.

                              There are 41 tasks total. Out of the 41, there are 13 that are in this weird "ignored" condition. Bleh. This is going to be fun re-creating these.

                              Perhaps export them all - then find out how to re-create them using powershell. Then you'll have a backup for them incase you need to migrate this to another server, etc for the future.

                              Not a bad idea.

                              You could write a simple function for a script to recreate them all based on the exported XMLs.

                              1 Reply Last reply Reply Quote 1
                              • 1
                                1337
                                last edited by

                                This is how you create tasks from the xml files with powershell.

                                https://www.petri.com/import-scheduled-tasks-PowerShell

                                1 Reply Last reply Reply Quote 1
                                • anthonyhA
                                  anthonyh
                                  last edited by

                                  So, I ended up just re-creating the jobs manually. It wasn't nearly as cumbersome as I had imagined. I'd export the job and use the XML as reference.

                                  Things seemed good, until Friday (1/31). Some of the jobs I re-created did not run that night. They have subsequently ran successfully though...just "skipped" Friday even though they're scheduled to run that day of the week (Monday - Friday)...so what the heck?!

                                  I've been meaning to move these jobs to another box, but it's been low priority. I guess this is a sign that I should do that....

                                  ObsolesceO wrx7mW 2 Replies Last reply Reply Quote 0
                                  • ObsolesceO
                                    Obsolesce @anthonyh
                                    last edited by

                                    @anthonyh maybe schedule something else to log pings to that device when those tasks are supposed tobrun. Maybe it's taking a nap or something at that time. No idea, never seen that before, lots of variables.

                                    anthonyhA 1 Reply Last reply Reply Quote 0
                                    • wrx7mW
                                      wrx7m @anthonyh
                                      last edited by

                                      @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                      So, I ended up just re-creating the jobs manually. It wasn't nearly as cumbersome as I had imagined. I'd export the job and use the XML as reference.

                                      Things seemed good, until Friday (1/31). Some of the jobs I re-created did not run that night. They have subsequently ran successfully though...just "skipped" Friday even though they're scheduled to run that day of the week (Monday - Friday)...so what the heck?!

                                      I've been meaning to move these jobs to another box, but it's been low priority. I guess this is a sign that I should do that....

                                      Do you have backup jobs or VSS running at the same time? Could be a stun.

                                      anthonyhA 1 Reply Last reply Reply Quote 0
                                      • anthonyhA
                                        anthonyh @Obsolesce
                                        last edited by

                                        @Obsolesce said in Windows Server 2012 - Task Scheduler Issue:

                                        @anthonyh maybe schedule something else to log pings to that device when those tasks are supposed tobrun. Maybe it's taking a nap or something at that time. No idea, never seen that before, lots of variables.

                                        These jobs, unfortunately, run queries against a SQL database that's local to the box.

                                        It's definitely weird.

                                        1 Reply Last reply Reply Quote 0
                                        • anthonyhA
                                          anthonyh @wrx7m
                                          last edited by

                                          @wrx7m said in Windows Server 2012 - Task Scheduler Issue:

                                          @anthonyh said in Windows Server 2012 - Task Scheduler Issue:

                                          So, I ended up just re-creating the jobs manually. It wasn't nearly as cumbersome as I had imagined. I'd export the job and use the XML as reference.

                                          Things seemed good, until Friday (1/31). Some of the jobs I re-created did not run that night. They have subsequently ran successfully though...just "skipped" Friday even though they're scheduled to run that day of the week (Monday - Friday)...so what the heck?!

                                          I've been meaning to move these jobs to another box, but it's been low priority. I guess this is a sign that I should do that....

                                          Do you have backup jobs or VSS running at the same time? Could be a stun.

                                          Not on this particular VM.

                                          1 Reply Last reply Reply Quote 0
                                          • anthonyhA
                                            anthonyh
                                            last edited by

                                            Upon further scrutiny of the Event Logs, I think I might be on to what is happening. I think it may be a clock issue.

                                            We are an XCP-ng shop, and it seems that the XenServer guest agent is attempting to sync the clock every 30 minutes. It issues a sync which causes the time to shift anywhere from a few milliseconds to a few MINUTES.

                                            https://discussions.citrix.com/topic/404819-xenapppvs-weired-time-sync-problems-after-ctx235405-xeniface-windows-io-driver-821123/

                                            Seems this is an issue other folks have complained about (though others seem to experience much wider variations in time).

                                            The two jobs that were "skipped" on the 01/31 are scheduled to run at 7:00 PM. It looks like the system time was tweaked at 6:39 PM and 7:09 PM. So, in theory, the jobs should've fired, but this is definitely not helping things. These are events with the ID of 1, the "source" is Kernel-General, and the user is SYSTEM.

                                            01/31 @ 6:39:18 PM: The system time has changed to ‎2020‎-‎02‎-‎01T02:39:18.826000000Z from ‎2020‎-‎02‎-‎01T02:40:37.936724600Z.

                                            01/31 @ 7:09:17 PM: The system time has changed to ‎2020‎-‎02‎-‎01T03:09:17.907000000Z from ‎2020‎-‎02‎-‎01T03:10:33.882678100Z.

                                            This eventually causes the Time Service to complain since it causes the time to be off by more than 5 seconds for a period of time.

                                            Every time it seems to roll the clock back. I followed the guidance via the Citrix forum post linked above in modifying registry entries to stop it from doing this but it didn't seem to help. Supposedly modifying the following registry entries to be either "blank" or set to "Local" is supposed to stop the Xen agent time sync.

                                            HKLM\Software\Citrix\XenTools\HostTime
                                            HKLM\Software\Wow6432Node\Citrix\XenTools\HostTime

                                            However, they were already blank in the registry. So I set them to "Local" and restarted all the services on the box that have Citrix or Xen in the name since I can't reboot this box without pre-planning (yay for 24/7 availability). I'm still seeing the Kernel-General Event ID 1's in the System event log. Fun...

                                            The time on the hosts are correct, and my NTP hierarchy is as so:

                                            Member Servers -> DCs -> Stratum 1 NTP servers hosted by Hurricane Electric (one in San Jose, CA and the other in New York, NY).

                                            I combed through time stuff yesterday and the time on the DCs seems stable (and w32tm reports they are syncing properly), as well as on other hosts, but I'll need to give it a second look.

                                            I am also planning on upgrading from XCP-ng 7.6 to 8.0 this weekend...I'll have to see if this behavior continues after that.

                                            black3dynamiteB JaredBuschJ 2 Replies Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • First post
                                              Last post