Skip to content

500 error on getNextInvoiceTopLevelBillingItems for large accounts #110

@cbreden

Description

@cbreden

I have a repeatable failure for SoftLayer accounts with large numbers of instances.

require 'rubygems'
require 'softlayer_api'
require 'pp'

client = SoftLayer::Client.new(
    :username => ENV["SL_API_USER"],  ## API Username
    :api_key => ENV["SL_API_KEY"],    ## API Key
    :timeout => 120
)

BILLING_ITEM = "mask[
                  id,
                  description,
                  categoryCode,
                  category,
                  createDate,
                  cancellationDate,
                  lastBillDate,
                  nextBillDate,
                  orderItemId,
                  parentId,
                  recurringMonths,
                  serviceProviderId,
                  invoiceItem[hostName,domainName,resourceTableId,notes],
                  item,
                  location[longName],
                  nextInvoiceTotalOneTimeAmount,
                  nextInvoiceTotalOneTimeTaxAmount,
                  nextInvoiceTotalRecurringAmount,
                  nextInvoiceTotalRecurringTaxAmount,
                  bundledItems,
                  currentHourlyCharge,
                  hourlyRecurringFee,
                  hoursUsed,
                  orderItem[order[userRecord]]
               ]"

acct = client.service_named("SoftLayer_Account")
items = acct.object_mask(BILLING_ITEM).getNextInvoiceTopLevelBillingItems

unless items.kind_of?(Array)
  items = [items]
end

pp items.empty? ? "No results" : items.first

On small accounts (say like 50 devices), this will return just fine. But on large accounts (1000+ devices), this will fail with a HTTP 500 error after about 40 seconds (well before the 120 second timeout). Bringing the timeout down to low values does cause it to abort with a predictable timeout error, so it seems like there's something happening on the SL side.

Other queries like fetching virtual guests with deep object masks will respect the long timeouts past 40 seconds, so this seems like it may be unique to the billing layer you have gating this data.

...unless of course I'm missing something obvious. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions