Bulk Jobs Return Status of Aborted

So you're trying to download a large amount of data from Netsuite and keep getting an infuriating aborted message in the response JSON from your /bulk/{id}/status call that looks something like this...

{
"bulk_finish_time": "Some_time_in_zulu_format",
"bulk_start_time": "Some_time_in_zulu_format",
"error": null,
"fileFormat": "json",
"id": "and_id",
"instanceId": your_instance_id,
"job_direction": "DOWNLOAD",
"object_name": "Object_Name",
"recordsCount": number_of_records,
"recordsFailedCount": 0,
"status": "ABORTED"
}

The problem may be that you are not using a Single Session Lock Key. Let's take a look...

  1. Obtain a Single Session Lock Key From Netsuite.
  2. Enter the Lock Key for your element instance .
  3. Rerun the original query.

Now your response from /bulk/{id}/status should look like...

{
"bulk_finish_time": "Some_time_in_zulu_format",
"bulk_start_time": "Some_time_in_zulu_format",
"error": null,
"fileFormat": "json",
"id": "and_id",
"instanceId": your_instance_id,
"job_direction": "DOWNLOAD",
"object_name": "Object_Name",
"recordsCount": number_of_records,
"recordsFailedCount": 0,
"status": "COMPLETED"
}

And that makes a developer happy. And a happy developer makes for a happy CTO. And the world goes 'round. 

By using a single session lock you are telling the Netsuite API to only deal with the current API call (in this case the bulk job) and to ignore all other requests. Otherwise, for longer calls, the stream will be interrupted , leading to "status": "ABORTED" ".