title: Sheets API v4 is returning 503 Unavailable
body: <p>I'm using the Google API Ruby <a href="https://github.com/google/google-api-ruby-client" rel="nofollow noreferrer" title="client">client</a> to do 4 things:</p>
  
  <ol>
  <li>Access my drive</li>
  <li>Create a new spreadsheet</li>
  <li>Update cells in the the spreadsheet</li>
  <li>Get cells with calculated results from same spreadsheet</li>
  </ol>
  
  <p>I'm able to successfully achieve the first 3 items listed above, but arrive at a 503 error when attempting to fetch the cells. I am able to get cells from the spreadsheet if I <strong><em>DO NOT</em></strong> run the #batch_update_values method. The error only occurs when both functions are called sequentially, yet work when called individually.</p>
  
  <p>In my service:</p>
  
  <pre><code>data = [list of ValueRange Objects]
  request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new
  request_body.value_input_option = "user_entered";
  request_body.data = data;
  
  # this works
  @sheets_client.batch_update_values(working_copy.id, request_body)
  
  
  # this does not work even with retries set
  range = "Sheet2!A3:BN23"
  response = @sheets_client.get_spreadsheet_values(working_copy.id, range, value_render_option: "UNFORMATTED_VALUE", date_time_render_option: "SERIAL_NUMBER")
  </code></pre>
  
  <p>The exact error is:</p>
  
  <pre><code>{"error": {
  "cause": null,
  "status_code": 503,
  "header": {
    "Vary": "Referer",
    "Content-Type": "application/json; charset=UTF-8",
    "Content-Encoding": "gzip",
    "Date": "Tue, 04 Apr 2017 00:42:21 GMT",
    "Server": "ESF",
    "Cache-Control": "private",
    "X-Xss-Protection": "1; mode=block",
    "X-Frame-Options": "SAMEORIGIN",
    "Alt-Svc": "quic=\":443\"; ma=2592000; v=\"37,36,35\"",
    "Transfer-Encoding": "chunked"
  },
  "body": "{\n  \"error\": {\n    \"code\": 503,\n    \"message\": \"The service is currently unavailable.\",\n    \"errors\": [\n      {\n        \"message\": \"The service is currently unavailable.\",\n        \"domain\": \"global\",\n        \"reason\": \"backendError\"\n      }\n    ],\n    \"status\": \"UNAVAILABLE\"\n  }\n}\n"
  </code></pre>
  
  <p>}
  }</p>
  
  <p>the update:</p>
  
  <pre><code>def generate_value_range_objects(data)
    value_range_objects = []
    data.each do |range, value|
      value_range_objects &lt;&lt; Google::Apis::SheetsV4::ValueRange.new(major_dimension: "ROWS", values: [[value]], range: range)
    end
    value_range_objects
  end
  
  d = Hash.new
  d["Sheet1!B5"] = "# Address"
  d["Sheet1!B6"] = "# City/Town"
  d["Sheet1!B7"] = "# County"
  d["Sheet1!B8"] = "# State"
  d["Sheet1!B9"] = "# Zip"
  
  d["Sheet1!B11"] = "# Year Built"
  d["Sheet1!B12"] = "# Year Gut Renovated"
  
  d["Sheet1!B14"] =  "# Number of Residential Units"
  d["Sheet1!B15"] =  "# Number of Commercial Units"
  d["Sheet1!B17"] =  "# Number of Occupied Units Mo. X"
  d["Sheet1!B18"] =  "# Number of Occupied Units Mo. X"
  d["Sheet1!B19"] =  "# Number of Occupied Units Mo. X"
  
  # Operating Numbers
  # Something in here causing issue
  d["Sheet1!B22"] = "# Income "
  d["Sheet1!B23"] = "# Less Concessions"
  d["Sheet1!B24"] = "# Vacancy"
  d["Sheet1!B27"] = "# Income "
  d["Sheet1!B28"] = "# Plus Income Other"
  d["Sheet1!B35"] = "# Expense"
  d["Sheet1!B36"] = "# Expense"
  d["Sheet1!B37"] = "# Expense"
  d["Sheet1!B38"] = "# Expense"
  d["Sheet1!B39"] = "# Expense"
  d["Sheet1!B40"] = "# Expense"
  d["Sheet1!B41"] = "# Expense"
  
  
  data = generate_value_range_objects(d)
  request_body = Google::Apis::SheetsV4::BatchUpdateValuesRequest.new
  request_body.value_input_option = "user_entered";
  request_body.data = data;
  
  @sheets_client.batch_update_values(working_copy.id, request_body)
  </code></pre>