Summary:
This article troubleshoots an error that occurs when scheduling a new job where a constraint is missing from the scheduledata table.
Article Sections:
Symptoms:
When a user schedules a new job for integration, they receive the following error message:
"Object reference not set to an instance of an object."
"$type": "System.Web.Http.HttpError, System.Web.Http",
"message": "An error has occurred.",
"exceptionMessage": "Object reference not set to an instance of an object.",
"exceptionType": "System.NullReferenceException",
"stackTrace": " at JobScheduler.Web.Controllers.SchedulerController.<UpdateJobScheduleAsync>d__19.MoveNext() in C:\\BuildAgent\\work\\6d18b07aa4e21bc6\\JobScheduler.Web\\Controllers\\SchedulerController.cs:line 333\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
Causes:
This is caused by missing constraint in scheduledata table in Scheduler database.
NOTE: This below steps and resolution needs to be done by SQL DBA.
To find out where the missing constraint is by doing a SQL profiler and replicate the issue to get the last query at the point of the error. Then run the query on SQL server Management Studio to get the result. It should return error message something like below.
Resolution:
Add the missing constraint. Normally if the constraint was created then it should look like the image below:
In this case, this constraint was not there, so we need to run the following query to create it.
This should then allow you to create new scheduled job.
Properties:
Private Host 5.x