Closed ghost closed 4 years ago
Can you find any state document for the job.
SELECT * FROM c WHERE c.type = 8 AND job_Id = ''
yes, there are 3 with names: "Processing", "Enqueued", "Scheduled".
Can you check the job document and see which state it is in
SELECT * FROM c WHERE c.type = 2 AND id= ''
If the state is missing - then it looks like the reference state document did not save or it got deleted.
That's result
Yeah, the job state is in "Succeeded" but there is no corresponding document for that state. Workaround - create the state document using the "State_Id"
Before creating the state document - just look for other succeeded state document for example
Ok, I see that workaround. But do you think that throwing NullReferenceException here is good decision? How about just ignore missing "states"?
Ignoring the states - I believe will create issues on UI. Wherever it is being displayed (you can give a try by handling it) Also, at the time of the development this library is the exact port from the Hangfire.SqlServer.
I think this scenario might happened when cosmosdb is throttling because of too many requests(429). Because unhandle exception our dashboard UseHangfireDashboard crash.
Error 429 is being handled and the retry is made based on the milliseconds returned with the error. I don't know why was the state document not created. For now your best option is to create the state document and monitor if the similar issue arises again
Hi, I'm getting NullReferenceException on Hangfire.Azure.CosmosDbMonitoringApi.SucceededJobs method. It's happening when for a given job there is no state with specific job.StateId.
If that's a valid issue I can help with PR. Thanks.