Try our conversational search powered by Generative AI!

OnStatusChanged does not update Scheduled Jobs UI

Vote:
 

Hi, 

Our servers are running EPiServer v8.11. 

We have encountered a problem with jobs inherited from EPiServer.BaseLibrary.Scheduling.JobBase.

The admin UI will no longer show the update messages provided by the OnStatusChanged method. This makes it hard to see if a task is still running or started at all when starting them manually. I have searched all over, but have not seen any other report this problem.

Have anybody come across this problem before?

regards,

Trond Nilsen

#140681
Oct 27, 2015 13:15
Vote:
 

Hi,

The EPiServer.BaseLibrary.Scheduling.JobBase and EPiServer.Scheduler.ScheduledJobBase should be used as base class.

The OnStatusChanged method, should work using:

this.OnStatusChanged("Job step");
#140690
Oct 27, 2015 19:50
Vote:
 

This is the code for my job;

[ScheduledPlugIn(
        Description = "Index all members",
        DisplayName = "EPiServer Find Members indexing job",
        SortIndex = 9900)]
    public class MemberIndexer : EPiServer.BaseLibrary.Scheduling.JobBase


OnStatusChanges does not update the UI.

I'm not sure what you mean by EPiServer.BaseLibrary.Scheduling.JobBase and EPiServer.Scheduler.ScheduledJobBase...

#140717
Oct 28, 2015 12:47
Vote:
 

I tested it on Alloy. And it looks like it's working. Try to add this test job to your code and check if it's working:

using System.Threading;
using EPiServer.PlugIn;

namespace ExtendingCompareVersion.Business
{
    [ScheduledPlugIn(DisplayName = "Test Job")]
    public class TestJob: EPiServer.Scheduler.ScheduledJobBase
    {
        public override string Execute()
        {
            for (var i = 0; i < 10; i++)
            {
                this.OnStatusChanged("Job in progress: " + i);
                Thread.Sleep(1500);
            }
            return "Job completed";
        }
    }
}
#140735
Oct 28, 2015 19:06
Vote:
 

Looks like the ScheduledJobBase is a CMS 9 Class. I'm still on 8.11.

My code did work before, not sure if it happened in 8.11 or one of the minor releases before that.

#140761
Oct 29, 2015 13:15
Vote:
 

Trond, Grzegorz,

I'm having this issue on Epi 10.4.2.0 . I even tried Grzegorz's simple Test Job with Thread.Sleep example for sanity's sake, and it's still not publishing any statuses whatsoever for me. Have either of you run into this again since, or found any solutions?

P.S. I'd love to paste a screenshot, but can't for the life of me find how to attach a dang image in this wysiwyg.

#179544
Jun 15, 2017 5:03
Vote:
 

Maxim, if you open "Network" tab in devtools - is page refresh happening to fetch new running status?

#179603
Jun 15, 2017 22:20
Vote:
 

@Valdis -- yep, sure does. It tries to hit /EPiServer/CMS/Admin/DatabaseJob.aspx?GetRunningState=0838b94b-5e54-494f-9416-e611afe9e201 for the URL, and fails due to a null reference, it seems.

Going to attempt pasting the stack trace below.

Value cannot be null.
Parameter name: String

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: String

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: String]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14289492
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +177
   ScheduledParameterJob.DatabaseJobAdapter.get_Attribute() +48
   ScheduledParameterJob.DatabaseJobAdapter.OnInit(EventArgs e) +30
   System.Web.UI.Control.InitRecursive(Control namingContainer) +11938992
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +464
#179607
Jun 15, 2017 23:57
Vote:
 

Do you need "ScheduledParameterJob" package?

#179608
Jun 16, 2017 1:01
Vote:
 

Hmm, having a look -- but that shouldn't be required to provide basic status updates, should it? I thought that was default functionality for scheduled jobs.

#179627
Jun 16, 2017 18:24
Vote:
 

No, that's separate package to be able to parametrize job runs (pass in parameters for jobs on every execute cycle). It's not standard Episerver stuff.

#179628
Jun 16, 2017 18:39
Vote:
 

I see. Well, regardless, it looks like I already do have it :(
Package 'ScheduledParameterJob.1.1.0' already exists in project 'xxxx'

Any other ideas? :)

#179633
Jun 16, 2017 22:10
Vote:
 

Question remains open - do you need that package? If not - try to uninstall and see if that solves the issue.

#179634
Jun 16, 2017 22:53
Vote:
 

Gotcha -- I misunderstood, I thought you were saying I was missing it.

Genius. Removing that fixed all the things, it seems. Very interesting. The buttons for "Show Statistics" and "Scheduled job overview" even appeared, which were missing before. I guess that thing breaks a whole ton of stuff.

Thank you very much Valdis!

#179635
Jun 16, 2017 23:01
Vote:
 

hahaaa sounds like you have installed another great plugin ;))

#179636
Jun 16, 2017 23:11
Vote:
 

Hah -- I think you probably noticed that I had no idea what that was! So I definitely wasn't the one to install it, and will now know to avoid it like the plague :)

#179637
Jun 16, 2017 23:14
Vote:
 

No I mean for "show statistics" and "overview" buttons.. I've seen those somewhere ;)

#179639
Jun 16, 2017 23:24
Vote:
 

Ohhhh. God yeah, you're right, I think I saw those as a part of some plugin somewhere too. Hahaha, sheesh!

#179640
Jun 16, 2017 23:27
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.