Skip to main content

Bulk v2 Load Results Not Written Back

Salesforce has the records from this <operation>, but Speediful could not write their results back to <schema>.<table>: <reason>

A Bulk v2 load sends the input table to Salesforce as one or more jobs, waits for Salesforce to process them, then writes each record's result (Id and SLAM_message) back to the input table. Once a job is submitted, Salesforce processes it whether or not the results reach SQL Server. This error means the load itself happened, and only the write of its results back to SQL Server failed.

The reason after the colon is the SQL Server error that stopped the write, for example a full transaction log or a value SQL Server rejected. When the cause is internal, the reason is an unexpected error occurred, and the Support reference # identifies the run.

The stored procedure raises error 88300. If the write stalled, the error is 88321 instead and the message names the stalled write, but the notes below appear in the same way.

When the results of a job could not be retrieved​

Salesforce has records from this <operation>, but Speediful could not get the results of every job to write back to <schema>.<table>: <reason>

This form means Speediful could not get one job's results from Salesforce, for example because the job ended in state Failed or Aborted, or the connection to Salesforce failed. The results of the jobs that arrived before it are still written to the input table. Instead of one line naming every job, the notes say what is known about each job:

  • Salesforce processed Bulk v2 jobs ... and returned their results. These jobs are complete, and their results are in the input table.
  • Bulk v2 job ... ended in state Failed. Salesforce stopped this job. The note gives the number of its records Salesforce reports it processed before it stopped. Salesforce does not roll those records back. If the number is none, Salesforce has no record from that job.
  • Speediful could not get the results of Bulk v2 job ... Speediful does not know how far this job got. Salesforce processes it anyway.
  • Bulk v2 jobs ... were submitted names the jobs whose results Speediful had not yet received. Salesforce processes them anyway.

When a load has only one job and Salesforce reports that the job ended without processing any record, Salesforce has nothing from the load. The procedure then fails with the job's own error (Bulk job ... was aborted) and does not show this message, and you can run the load again once you fix the cause.

What the notes tell you​

The lines after the message say:

  • Which jobs Salesforce has. The records were sent to Salesforce in Bulk v2 job ... names each job ID.
  • Which rows have their result. Results received before the failure are still written to the input table, and the note gives the count. Every other row keeps the Id and SLAM_message it had before the run, which can be a result from an earlier run.
  • Whether a re-run is safe.

Do not run an insert again​

For @operation = 'insert', Salesforce has already created the records. Running the same insert again creates every record a second time. For update, upsert and delete, Salesforce has already applied the change; check the job results before you run it again.

Resolution​

  1. Fix the cause named in the message. For a full transaction log, see SQL Server Transaction Log Full. For a rejected value, see SQL Server Rejected a Value. For a stalled write, see SQL Server Write Stalled.

  2. Download each job's results with SLAM_download_job, using the job IDs from the message. Give @table a new root name, not the input table's name:

    EXEC dbo.SLAM_download_job
    @job_id = '750000000000001AAA',
    @table = 'Account_Load_results'

    This creates Account_Load_results_successful, Account_Load_results_failed and Account_Load_results_unprocessed, each holding the external ID column.

  3. Join those tables to the input table on the external ID to see each record's result, or to copy the results into the input table.

A job that ended in state Failed or Aborted cannot be downloaded with SLAM_download_job. Review it in Salesforce Setup, under Bulk Data Load Jobs, to see which of its records were processed.