1

So it seems I have a variant of the problem described in continuous WebJob stops automatically. The variation being that I have afforded to use Basic and set the site to Always On.

Still there are times when my webjob is shut down due to website shutting down, that's fine, but then the webjob does not start again. Not until I log into the Azure Management Portal and click the WebJobs Tab, at which time the webjob gets a "Starting" state and moments later it is "Running".

If you take a look at this excerpt from the log file you can see that at 19:16:31 all three instances have stopped (yes the website is set to have three instances so the webjob also has three instances, all fine). It should start up immediately again because the website started (not shown here but I have the Monitor Data from the Azure Portal showing me that requests came in later and that server errors were 0 (zero)). Only when I logged into the Portal in the morning (at 06:44:35) and actively selected the webjobs tab did the webjob start again, all three instances, all looks good.


[10/15/2015 14:02:21 > c260d5: SYS INFO] WebJob is still running
[10/15/2015 19:16:17 > c260d5: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:18 > c260d5: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:22 > fe23db: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:22 > fe23db: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:22 > c260d5: SYS INFO] Status changed to Success
[10/15/2015 19:16:22 > c260d5: SYS INFO] Status changed to Stopped
[10/15/2015 19:16:25 > fe23db: SYS INFO] Status changed to Success
[10/15/2015 19:16:25 > fe23db: SYS INFO] Status changed to Stopped
[10/15/2015 19:16:29 > a81043: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:29 > a81043: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:31 > a81043: SYS INFO] Status changed to Success
[10/15/2015 19:16:31 > a81043: SYS INFO] Status changed to Stopped
[10/16/2015 06:44:35 > c260d5: SYS INFO] Status changed to Starting
[10/16/2015 06:44:50 > c260d5: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:44:50 > c260d5: SYS INFO] Status changed to Running
[10/16/2015 06:44:53 > c260d5: INFO] Found the following functions:
[10/16/2015 06:44:53 > c260d5: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:44:53 > c260d5: INFO] Job host started
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:06 > a81043: SYS INFO] Status changed to Starting
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:08 > a81043: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:45:08 > a81043: SYS INFO] Status changed to Running
[10/16/2015 06:45:10 > a81043: INFO] Found the following functions:
[10/16/2015 06:45:10 > a81043: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:45:10 > a81043: INFO] Job host started
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:12 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:12 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:13 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > fe23db: SYS INFO] Status changed to Starting
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:17 > fe23db: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:45:17 > fe23db: SYS INFO] Status changed to Running
[10/16/2015 06:45:19 > fe23db: INFO] Found the following functions:
[10/16/2015 06:45:20 > fe23db: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:45:20 > fe23db: INFO] Job host started
[10/16/2015 06:45:19 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:20 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.

So why is this happening? And how can I avoid this problem?

Community
  • 1
  • 1
Abramelin
  • 61
  • 1
  • 6
  • I don't think you're doing anything wrong, what's happening probably indicates that Always On isn't working as expected. The [Azure Forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=windowsazurewebsitespreview&filter=alltypes&sort=firstpostdesc) might be a better place for debugging the issue, but if you can share your site name directly or [indirectly](https://github.com/projectkudu/kudu/wiki/Reporting-your-site-name-without-posting-it-publicly) I can take a quick look for you – ahmelsayed Oct 16 '15 at 18:03
  • 1
    try enabling http logs and look for requests to / with a user agent called "AlwaysOn", this can tell you whether its working. – Amit Apple Oct 17 '15 at 07:03
  • 1
    Allrighty then, I have been in contact with MS support about this for a couple of weeks now. The response is that I am doing everything correctly but something still breaks sometimes. I was prompted to re-deploy the webjob to see if it "resets" the settings for the webjob. This might make it work... I will try to remeber to report back here when I have had a trial period. Re-deploy here means just moving the directory with the webjob executable to another place, verifiy that the webjob is gone (through the Azure portal) and then moving the directory back again. Thus restarting the webjob. – Abramelin Nov 10 '15 at 14:23

0 Answers0