title: Salesforce Bulk API error: InvalidBatch: Records not processed
body: <p>I'm sending a batch of contacts through Restforce gem via Bulk apu</p>
  
  <pre><code>response = connection.post("/services/async/#{connection.options[:api_version]}/job/#{job_id}/batch") do |req|
    req.headers['Content-Type'] = 'text/csv; charset=UTF-8'
    req.headers['X-SFDC-Session'] = connection.options[:oauth_token]
    req.headers['Content-Length'] = payload.length.to_s
    req.body = Restforce::UploadIO.new(StringIO.new(payload), 'text/csv; charset=UTF-8')
   end
  </code></pre>
  
  <p>Where payload is:</p>
  
  <blockquote>
    <p>"AccountId,FirstName,LastName,Description,Phone,Email\n0011510001DXiOVAA1,Matt,Cali,Nice
    guy,+14150000000,matt@example.com\n0011501001DXiOWAA1,Michael,Michael,very nice guy,+14150000001,michael@example.com\n"</p>
  </blockquote>
  
  <p>I'm getting an error: "InvalidBatch: Records not processed"
  The only response that I get.</p>
  
  <p>How can I see what's exactly wrong with my batch?
  It used to work before, and at some point it stopped working. I made sure I added all permissions on a trial account I created.</p>
  
  <p>Request/response data:</p>
  
  <blockquote>
    <p>struct Faraday::Env method=:post, body=#Restforce::Mash batchInfo=#Restforce::Mash apexProcessingTime="0"
    apiActiveProcessingTime="0" createdDate="2015-12-06T23:06:28.000Z"
    id="<em>SOME_ID</em>" jobId="<em>SOME_ID</em>" numberRecordsFailed="0"
    numberRecordsProcessed="0" state="Queued"
    systemModstamp="2015-12-06T23:06:28.000Z" totalProcessingTime="0">>,
    url=#https://na22.salesforce.com/services/async/33.0/job/*SOME_ID*/batch>,
    request=#, request_headers={"User-Agent"=>"Faraday
    v0.9.2", "Content-Type"=>"text/csv; charset=UTF-8",
    "X-SFDC-Session"=>"<em>SOME_SESSION_ID</em>", "Content-Length"=>"233",
    "Authorization"=>"<em>SOME_AUTH_ID</em>"}, ssl=#, parallel_manager=nil, params=nil,
    response=#> @url=#URI::HTTPS
    <a href="https://na22.salesforce.com/services/async/33.0/job/" rel="nofollow">https://na22.salesforce.com/services/async/33.0/job/</a><em>SOME_ID</em>/batch>
    @request=#Faraday::RequestOptions timeout=600 seconds,
    open_timeout=600 seconds> @request_headers={"User-Agent"=>"Faraday
    v0.9.2", "Content-Type"=>"text/csv; charset=UTF-8",
    "X-SFDC-Session"=>"<em>SOME_ID</em>", "Content-Length"=>"233",
    "Authorization"=>"<em>SOME_ID</em>"} @ssl=#Faraday::SSLOptions verify=true>
    @response=#Faraday::Response:0x007f22b44a78 ...>
    @response_headers={"date"=>"Sun, 06 Dec 2015 23:06:28 GMT",
    "set-cookie"=>"*SOME_DATA>",
    "location"=>"/services/async/33.0/job/<em>SOME_ID</em>/batch/<em>SOME_ID</em>",
    "content-type"=>"application/xml", "transfer-encoding"=>"chunked",
    "connection"=>"close"} @status=201>>, response_headers={"date"=>"Sun,
    06 Dec 2015 23:06:28 GMT", "set-cookie"=>"<em>SOME_ID</em>",
    "expires"=>"<em>SOME_ID</em>",
    "location"=>"/services/async/33.0/job/<em>SOME_ID</em>/batch/<em>SOME_ID</em>",
    "content-type"=>"application/xml", "transfer-encoding"=>"chunked",
    "connection"=>"close"}, status=201></p>
  </blockquote>