Troubleshooting Gateway

If Gateway is not performing as expected, you might need to troubleshoot issues.

Request error handling

When requests cannot be fully satisfied, the Gateway service gives the caller accurate, practical error information. The Gateway service honors the GraphQL error specification with some custom extensions for greater specificity.

Syntax Validation

Before processing any portion of a request, the service parses its syntax. If the request is not valid GraphQL, or if it does not conform to the schema, the service returns a response with the syntax errors, including line and column positions whenever possible.

Examples of syntax errors include:

  • Unbalanced parentheses, braces, brackets, and quotation marks

  • References to fields that do not exist

The GraphQL error specification requires reporting these errors to the caller by line and column in the request.

Note: When possible, the Query pane in the Query Explorer identifies syntax errors in the request.

Structural Validation

If the request passes syntax validation, the service evaluates the request for structural validity, which checks for errors not expressible with the GraphQL type system. Structural error examples include:

  • Restrictions on type values, such as:

    • A string may not be empty

    • An integer must be positive

  • Constraints on input objects, such as:

    • Exactly one of two or more entries must be present

  • Existence of values in a known set, such as:

    • A named sensor must exist

  • References to fields that cannot be satisfied in the current environment, such as:

    • A sensor does not exist

The GraphQL extensions error field for custom fields contains these errors.

Error Extensions

Errors that pertain to a specific field in the request are identified by a fieldPath entry in the extensions object. Similar to the path entry on the GraphQL error type, the fieldPath consists of a list of strings and integers which indicate keys in objects and offsets in lists, respectively. The root of the fieldPath is the request field that triggered the GraphQL error.

Note: The numbering for list items starts at 0 for the first item and increments for each additional item. For example, if a fieldPath contains 5, this refers to the sixth item in the list.

The extensions object may also have these fields:

Table 1. Fields contained by the extensions object

Extensions field

Description

code

an error code attributable to the field itself

context

a map of contextual information that refines or specifies the error

message

a short error explanation

For example, with the following syntactically valid request:

CODE
{
  endpoints {
    edges {
      node {
        name
        serialNumber
      }
    }
  }
}

If the serial number is not available in the underlying data store, the Gateway service returns a response including an extended error that the value does not exist:

JSON
{
  "errors": [
    {
      "message": "Invalid request",
      "path": ["endpoints"],
      "extensions": {
        "fieldPath": ["edges", "node", "serialNumber"],
        "code": "validation_exists",
        "message": "must refer to an existing sensor",
        "context": {
          "source": "tds"
        }
      }
    }
  ]
}

Invalid argument errors contain an extended argumentErrors entry. The value of that entry is a list of objects that may have the following entries:

Table 2. Possible values for the object list in the argumentErrors entry

Extensions field

Description

code

an error code attributable to the field itself

context

a map of contextual information that refines or specifies the error

path

the path to the argument error, relative to the field

message

a short error explanation

For example, with the following request that does not define a name or path value:

JSON
{
  endpoints(filter: {filters: [{memberOf: {name: ""}}, {path:""}]}) {
    edges {
      node {
        name
      }
    }
  }
}

The Gateway service returns a response including both errors stating a value is a required:

JSON
{
  "errors": [
    {
      "message": "Invalid request",
      "path": ["endpoints"],
      "extensions": {
        "argumentErrors": [
          {
            "code": "validation_required",
            "path": ["filter", "filters", 0, "memberOf", "name"]
          },
          {
            "code": "validation_required",
            "path": ["filter", "filters", 1, "path"]
          }
        ]
      }
    }
  ]
}

Extended errors may identify argument errors within sub-fields. For example, the following request specifies a non-existent sensor name:

JSON
{
  endpoints {
    edges {
      node {
        sensorReadings(sensors:[{name: "A Non-Existent Sensor"}]) {
          columns {
            values
          }
        }
      }
    }
  }
}

The Gateway service returns a response including the sub-field error that the value does not exist:

JSON
{
  "errors": [
    {
      "message": "Invalid request",
      "path": ["endpoints"],
      "extensions": {
        "fieldPath": ["edges", "node", "sensorReadings"],
        "argumentErrors": [
          {
            "code": "validation_exists",
            "path": ["sensors", 0, "name"]
          }
        ]
      }
    }
  ]
}

Whenever possible, the response includes the valid portions of a query. For example, the following request references a valid sensor (Custom Tags) and a not valid sensor (A Non-existent Sensor):

JSON
{
  endpoints {
    edges {
      node {
        name
        ipAddress
        os {
          generation
        }
        sensorReadings(sensors: [{name: "Custom Tags"}, {name: "A Non-existent Sensor"}]) {
          columns {
            sensor {
              name
            }
            name
            values
          }
        }
      }
    }
  }
}

The response includes the error from A Non-Existent Sensor not being found, and all information that can otherwise be returned from the Custom Tags sensor:

JSON
{
  "errors": [
    {
      "message": "sensors: (1: (name: must refer to an existing sensor.).).",
      "path": [
        "endpoints"
      ],
      "extensions": {
        "argumentErrors": [
          {
            "code": "validation_exists",
            "context": {
              "source": "tds"
            },
            "message": "must refer to an existing sensor",
            "path": [
              "sensors",
              1,
              "name"
            ]
          }
        ],
        "fieldPath": [
          "edges",
          "node",
          "sensorReadings"
        ]
      }
    }
  ],
  "data": {
    "endpoints": {
      "edges": [
        {
          "node": {
            "name": "example-host",
            "ipAddress": "192.0.2.10",
            "os": {
              "generation": "Windows 10"
            },
            "sensorReadings": {
              "columns": [
                {
                  "sensor": {
                    "name": "Custom Tags"
                  },
                  "name": "Custom Tags",
                  "values": [
                    "custom-tag-1",
                    "custom-tag-2"
                  ]
                }
              ]
            }
          }
        }
      ]
    }
  }
}
Note: Similar to lists in the fieldPath referring to offsets in lists, if an error occurs on an item in a list, the error message might refer to the list offset instead of the field name. In the above response, the message refers to item 1 in the list; because list numbering starts at 0, this points to the second sensor (A Non-existent Sensor).

Error codes

General error codes include:

Table 3. General error codes

Error code

Description

401 Unauthorized

If using an API token, you do not have permission to use the token for authentication, or the token is not valid or does not exist.

403 Forbidden

You do not have the permissions required for your request. See the message for more information.

500 Internal Server Error

The response field cannot be resolved due to a server error.

502 Bad Gateway

The Gateway service received an invalid response from the server.

503 Service Unavailable

The Gateway service is running, but cannot handle a request.

COMPLEXITY_LIMIT_EXCEEDED

The request contains too many fields, or the request would return too many results, based on field complexity weight and query maximum complexity.

incompatible_solution

A required Tanium solution is not installed at the correct version.

insufficient_permissions

The user account making the request does not have the proper permissions to access a resource.

Syntax error codes include:

Table 4. Syntax error codes

Error code

Description

GRAPHQL_PARSE_FAILED

The request contains unbalanced parentheses, braces, brackets, or quotation marks. See the message for more information.

GRAPHQL_VALIDATION_FAILED

The request does not pass validation. Causes include a syntax error, an unrecognized argument, a required argument that is not included, a variable that does not match the schema, or a request that exceeds the maximum alias or depth limit. Aliases and nesting levels in a fragment count toward the limits of each operation that spreads the fragment. By default, a request can contain up to 10 aliases and 15 nesting levels. The sensorReading and sensorReadings fields do not count toward the alias limit. See the message for more information.

INVALID_GRAPHQL

The request contains an unknown operation. See the message for more information.

Structural error codes include:

Table 5. Structural error codes

Error code

Description

validation_allowed

The field is not allowed in this position.

validation_data_limit

The request pagination settings result in a response size greater than the maximum response size allowed.

validation_date

The field must contain a valid RFC 3339 long date format (YYYY-MM-DD).

validation_deadline_exceeded

The system did not respond within an amount of time, dependent on the specific request.

validation_exists

The field must refer to an existing entity.

validation_in_invalid

The field must have a value from a specific set.

validation_invalid_action_perform

The action operation must specify only one operation, specify package or operation, or a tag value contains whitespace characters or a number sign (#).

validation_invalid_dec_process_name

The request contains a process name that does not match the process ID.

validation_invalid_field_filter

The field filter is not valid, or is not allowed for filtering on sensors with multi-character delimiters.

validation_invalid_for_source

The source does not allow the request.

validation_invalid_group

The request must provide name, id, or filter for the group.

validation_invalid_ref

The reference must include either a name or ID.

validation_invalid_use

The filter is not valid in its context.

validation_integration_name

The integration name must contain a value that does not start with tanium-.

validation_ipaddress

The field must contain an IPv4 address or IPv4 CIDR range.

validation_key_unexpected

The field is not allowed.

validation_min_greater_equal_than_required

The field must have a value greater than or equal to its documented minimum.

validation_nil

The field must be absent.

validation_nil_or_not_empty_required

The field must be absent or have a non-empty value.

validation_not_nil_required

The field must have a value.

validation_overdetermined

The field's object must not have inconsistent entries.

validation_param_missing

The request must define all required parameter values for referenced sensors.

validation_param_unexpected

The request must define valid parameter values for referenced sensors.

validation_persona_name

The persona must be a persona assigned to the account that submitted the request.

validation_positive_integer

The field must contain a positive integer.

validation_required

The field must have a non-empty value.

validation_timestamp

The field's value must be a valid RFC 3339 string.

validation_unique

The field's value must be unique in its documented container.

validation_unregistered

The sensor must be registered with Tanium Data Service, or the sensor parameter values must be an exact match for a parameterized sensor instance registered with Tanium Data Service.

Issue: error message for enumerated value displays the value in the request

For enumerated type fields in requests, if you pass the enumerated value in quotation marks, the response error message appears to state that you must pass that value. For example, with the following request, any (a boolean field) is set to "false" and visibility (an enumerated type) is set to "ALL" (in quotation marks):

JSON
mutation createActionGroup {
  actionGroupCreate(
    input: {any: "false", computerGroups: [{name: "Example Computer Group"}], name: "Example Action Group", visibility: "ALL"}
  ) {
    group {
      id
    }
    error {
      message
    }
  }
}

The response constrains validation error messages similar to the following because the validation engine parses "false" and "ALL" as non-enumerated values, and requires that they be passed in the request without quotation marks.

JSON
{
  "errors": [
    {
      "message": "Boolean cannot represent a non boolean value: \"false\"",
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    },
    {
      "message": "Enum \"ActionGroupVisibility\" cannot represent non-enum value: \"ALL\". Did you mean the enum value \"ALL\"?",
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ]
}

Do one of the following:

  • Pass the value as a JSON variable definition.

  • Pass the value in your request without quotation marks.

  • If using the Query Explorer, enter an enumerated type field and a colon, press Shift + Space when your cursor is after the colon, then select an enumerated value.

Issue: ResourceExhausted error in response to valid query request

Query requests that retrieve a large amount of information in the response might return a ResourceExhausted error, due to the size of the response in bytes being too large to return. For example, the following request specifies returning the first 99999 results, and requests multiple fields with the potential to return many results per field, increasing the overall size of the response:

JSON
query endpointsLargePagination {
  endpoints(first: 99999) {
    edges {
      node {
        id
        eidFirstSeen
        eidLastSeen
        namespace
        computerID
        systemUUID
        name
        domainName
        serialNumber
        manufacturer
        model
        ipAddress
        macAddresses
        isVirtual
        isEncrypted
        chassisType
        os {
          name
          language
        }
        services {
          status
          startupMode
        }
        installedApplications {
          uninstallable
          name
          version
          silentUninstallString
        }
        deployedSoftwarePackages {
          id
          name
          applicability
          gallery
        }
        compliance {
          cveFindings {
            cveYear
            summary
            severity
            cveId
            cvssScore
          }
          complianceFindings {
            standard
            standardVersion
            state
            id
            ruleId
          }
        }
      }
    }
  }
}

If this response size in bytes is too large, the response might include a ResourceExhausted error code:

JSON
{
  "errors": [
    {
      "message": "Error fetching endpoints: response error: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (28156311 vs. 4194304)",
      "extensions": {
        "serviceName": "graphql-platform",
        "code": "DOWNSTREAM_SERVICE_ERROR"
      }
    }
  ],
  "data": {
    "endpoints": null
  }
}

Reduce the response size. You have the following options:

  • Reduce the number of results returned per page.

  • Reduce or otherwise constrain the information you request, especially if a given field might return an array for each result with multiple result values.

Note: For the best results, due to the variability in size of Tanium deployments, retrieve 100 records per page for an initial test of your paginated query, and adjust the number of records returned per page based on performance and response time.

Issue: repeated 503 error code in responses

The Gateway service imposes maximums on allocated memory and concurrent response size to optimize overall performance and resource use. If you submit too many simultaneous requests to the Gateway service and exceed either maximum, you might receive 503 errors in response to your requests.

Wait 60 seconds for the Gateway service to process queued requests, then try again. If this message persists, Contact Tanium Support.