Getting 404 error while using Search Job API
Hi,
I am using Search Job API to create a search job and am later calling the search/job/<job\_id> GET API to get the status of the search job.
I make the /api/v1/search/jobs POST request to create a new search which is created successfully and I get the Search Job ID in the response. Later, I use the received Search Job ID to make the /api/v1/search/jobs/<job\_id> GET call to get the status of the Search Job. I call the GET API repeatedly after certain intervals, say 1 second or 10 seconds until I get the DONE GATHERING RESULTS status.
For the first few calls, I get proper response with status as GATHERING RESULTS. For example,
Response:
{"state":"GATHERING RESULTS","pendingErrors":[],"pendingWarnings":[],"histogramBuckets":[{"length":60000,"count":2627,"startTimestamp":1409663400000},{"length":60000,"count":32215,"startTimestamp":1409663340000},{"length":60000,"count":74832,"startTimestamp":1409663280000},{"length":60000,"count":80633,"startTimestamp":1409663220000},...,{"length":60000,"count":54466,"startTimestamp":1409662680000}],"messageCount":52500,"recordCount":1}
But after a few calls, I start getting 404 status for the same GET calls. For example,
Response:{
"status" : 404,
"id" : "THCIC-04F8V-NIMFU",
"code" : "searchjob.jobid.invalid",
"message" : "Job ID is invalid."
}
And then, after some time depending on the duration of the search, I get the DONE GATHERING RESULTS response.
{"state":"DONE GATHERING RESULTS","pendingErrors":[],"pendingWarnings":[],"histogramBuckets":[{"length":60000,"count":2627,"startTimestamp":1409663400000},{"length":60000,"count":32215,"startTimestamp":1409663340000},{"length":60000,"count":74832,"startTimestamp":1409663280000},{"length":60000,"count":80633,"startTimestamp":1409663220000},{"length":60000,"count":97854,"startTimestamp":1409663160000},{"length":60000,"count":96360,"startTimestamp":1409663100000},{"length":60000,"count":98576,"startTimestamp":1409663040000},{"length":60000,"count":100162,"startTimestamp":1409662980000},{"length":60000,"count":101440,"startTimestamp":1409662920000},{"length":60000,"count":105896,"startTimestamp":1409662860000},{"length":60000,"count":109760,"startTimestamp":1409662800000},{"length":60000,"count":105199,"startTimestamp":1409662740000},...,{"length":60000,"count":125758,"startTimestamp":1409660040000},{"length":31016,"count":64547,"startTimestamp":1409660008984}],"messageCount":52500,"recordCount":2}
Is this some bug in the Search Job API? Do I need to do something else? Please help.
-
Rahul,
Would the one shot search API work for you?
https://github.com/SumoLogic/sumo-api-doc/wiki/search-api
You might be hitting a throttling limit on the job based API. I'd suggest that you open up a ticket with support to get to the bottom of it. We can search the API tier and see if there are any additional error messages around your request.
I prefer to use the simpler, "one shot" search for API calls, but I understand that it might not meet your use case. Feel free to comment back with additional details and we'll help you out.
Thanks!
-
In my case, I am launching a number of search jobs in parallel. I then check on status of search jobs in series (predetermined order). After first search job complete (with status code 200), I move on to check second. However, second search job returns status code 400. Is this timeout issue or something else?
-
I'm observing the same thing. The jobs is launched and I receive successful status updates... up to a certain moment when 404 error occur. I haven't waited enough to see a 'Done gathering results' message. I am running a single search job at the time, over an whole day of logs.
Any suggestions on how to avoid these messages are well received!
Please sign in to leave a comment.
Comments
3 comments