API Requests Return HTTP Timeout or 408 Errors
search cancel

API Requests Return HTTP Timeout or 408 Errors

book

Article ID: 288315

calendar_today

Updated On:

Products

Carbon Black App Control (formerly Cb Protection)

Issue/Introduction

Timeouts occurring when executing an API query, example:

Error :Invoke-RestMethod : The remote server returned an error: (408) Request Timeout.

Environment

  • App Control Server: All Supported Versions

Cause

The API Query executed is requesting too much data at once, or is too broad. This is causing SQL Server to take longer than expected in returning results and the query times out.

Resolution

Target the API request in some fashion, some examples include:

  • Limit the number of results returned per request, example:
    limit=50
  • Explicitly list only fields requested, rather than allowing all to be returned, example:
    fields=name,policyName
  • Avoid filtering and grouping on expanded fields due to SQL Server performance impacts from more complex queries, eample:
    fileCatalog?expand=certificateId&q=certificateId_publicKeySize<1024&limit=100

Additional Information

Some fields with known performance impacts:

  • Processor_Count
  • Machine_Model
  • Processor_Speed
  • Processor_Model
  • Memory_Size