Background:
Often jobs needed to be cancelled. Getting error while cancelling a job!
Request URL:http://taskcatdev.azurewebsites.net/api/Job/cancel/579ed9bb85e54d24c4bacd4b
Request Method:POST
Status Code:500 Internal Server Error
Remote Address:104.214.29.203:80
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://127.0.0.1:8080
Content-Length:2733
Content-Type:application/json
Date:Tue, 02 Aug 2016 13:09:52 GMT
Server:Microsoft-IIS/8.0
Set-Cookie:ARRAffinity=d5baaa4af13ed7a15d133cc9fb3175ad57c46ec6cfd3ea7a639bbc0f442a6612;Path=/;Domain=taskcatdev.azurewebsites.net
X-Powered-By:ASP.NET
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8,bn;q=0.6
Authorization:Bearer rbovVoixWVkNrCD0LcfjUMqOB9vI2cX7JcoLcgC2EagJaalzYjCGky7WGmmb7PGt0ZzaXdgNb7eForfSSBs7R0L2o4U8BCuouwQTuWg2qi92pvVmib2JrVzklyXN2mDchUUtGgVVj2lo5Tq-i05CGkfKpD7JaRTW1a6Ud9SyPIgyNeDu7y7PKzgq-v8E0L1660kryPS6C_eUB4-QjpVP87jDQXe2AyOYpijSL1JBY54o6FyEpQ_eY6YrIyT3X7haYWbmVgzbeWS5VoCyRT_EshBo-SJndFOaU8ajABLiwp8QM42qRMduIcs-92vwr0U5tWphEiRJBOqQUXWMmD2_-7py5W8EUiB0We8sHyEdnsuCA3EHFim50YeBs2j7_D_8BmxLDVZeQtcuvTd4ave-UQrTP6zPFpJ7WSzLtT-5rAPHkNSi-l8hxHACztg4uUSbLo8tWAnudUIk2DkOQM9qs8YLIkZX0-3vsi8yoq8XlpWlwYB1xy4_GPZWworE-yV3TKi1fQ
Connection:keep-alive
Content-Length:0
DNT:1
Host:taskcatdev.azurewebsites.net
Origin:http://127.0.0.1:8080
Referer:http://127.0.0.1:8080/
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
{
"ClassName": "System.NullReferenceException",
"Message": "Object reference not set to an instance of an object.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at TaskCat.Lib.Job.JobRepository.<CancelJob>d__14.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at TaskCat.Controller.JobController.<CancelJob>d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": "8\nMoveNext\nTaskCat, Version=0.1.3.54, Culture=neutral, PublicKeyToken=null\nTaskCat.Lib.Job.JobRepository+<CancelJob>d__14\nVoid MoveNext()",
"HResult": -2147467261,
"Source": "TaskCat",
"WatsonBuckets": null
}
This is technically my fault, the swagger doc is confusing, its basically a post with a JSON payload, not from url to be honest as you can also mention the reason of the job cancellation
Background: Often jobs needed to be cancelled. Getting error while cancelling a job!