Troubleshooting AsyncOS API

This chapter contains the following sections:

API Logs

Subscribe to the API logs using System Administration > Log Subscriptions. For instructions, see the email gateway or Online Help.

The following are some of the events that are logged in the API logs:

  • API has started or stopped
  • Connection to the API failed or closed (after providing response)
  • Authentication succeeded or failed
  • Request contains errors
  • Error while communicating network configuration changes with AsyncOS API

Alerts

Ensure that the email gateway is configured to send you alerts related to AsyncOS API. You will receive alerts when:

Alert Description

Type

Severity

API has restarted due to an error

System

Warning

Handling Error Messages of Configuration APIs

This section lists the following error messages that you might receive when generating the following Configuration APIs ('Authentication,' 'URL lists,' 'Dictionary,' 'HAT,' 'File Hash Lists,' 'RAT,' 'Save and Load Configuration,' 'Address Lists,' 'Incoming Mail Policy Users,' 'Message Filters,' 'SMTP Call Ahead Profile,' and 'Bounce Verification'):

  • Error - Unauthorised API calls

  • Error - Invalid credentials while generating token

  • Error - Token not authenticating API calls

  • Error - API calls give an expired token

  • Error - API Calls give unsupported operation for mode

  • Error - Bad Request Syntax or Unsupported Method

  • Error - Request Entity Too Large

  • Error - Bad Gateway

Error - Unauthorised API Calls

You may receive the following error message for an unauthorized API call:
{
	     "error": {
		    "message": "Unauthorized.",
		    "code": "401",
		   "explanation": "401 = No permission -- see authorization schemes."
	    }
     }

Solution: See the Authentication APIssection for information about Authentication APIs.

Error - Invalid credentials while Generating Token

You may receive the following error message when invalid credentials are received when generating the token:

{
	"error": {
		"message": "Invalid credentials.",
		"code": "400",
		"explanation": "400 = Bad request syntax or unsupported method."
	}
}

Solution: The client credentials might be incorrect. See the Client Credentials APIs for information on how to retrieve the client credentials correctly.

Error - Token not authenticating API Calls

You may receive the following error message when the token does not authenticate the API calls:

{
	"error": {
		"message": "InvalidTokenError.",
		"code": "401",
		"explanation": "401 = No permission -- see authorization schemes."
	}
}

Solution: The token might be incorrect. See the Generating JWT Token section for information on how to generate the token correctly.

Error - API Calls give Expired Token

You may receive the following error message when the API calls give an expired token:

{
	"error": {
		"message": "ExpiredSignatureError.",
		"code": "401",
		"explanation": "401 = No permission -- see authorization schemes."
	}
}

Solution: The token might have expired. You can regenerate a token using the Token API call. For more information, see Generating JWT Token.

Error - API Calls give unsupported operation for mode

You may receive the following error message when the API calls give unsupported operation for mode:


{
    "error": {
        "message": "Unsupported operation for machine mode. Override settings from the UI for sender_groups to configure through APIs.",
        "code": "404",
        "explanation": "404 = Nothing matches the given URI."
    }

}

Solution: You must override settings for the particular feature from the UI. In this example, you must override settings for sender groups from the UI to machine mode, after which API calls for sender groups for machine mode will return a successful response.

Error - Bad Request Syntax or Unsupported Method

You may receive the following error message when the number of Dictionaries exceeds the upper limit:

{"error": 
{"message": "Maximum dictionaries count exceeded.", 
"code": "400", 
"explanation": "400 = Bad request syntax or unsupported method."
}
}

You may receive the following error message when the number of destination hosts that you have added in a single SMTP Route POST request exceeds the upper limit.:

{"error": 
{"message": "Routes must not contain more than 100 destinations", 
"code": "400", 
"explanation": "400 = Bad request syntax or unsupported method."
}
}

You may receive the following error message when the number of SMTP Routes that you have added to the database with a single destination host exceeds the upper limit:

{"error": 
{"message": "Maximum number of routes allowed is 40,000. Please remove one before trying to add a new route.", 
"code": "400", 
"explanation": "400 = Bad request syntax or unsupported method."
}
}

Solution: See the Configuration APIs - Rate Limits section for information about the rate limits for Configuration APIs.

Error - Request Entity Too Large

You may receive the following error response when:

  • the number of URLs allowed for one URL List (each URL with 50 characters) in a single POST request exceeds the upper limit.

  • the number of words in a Dictionary exceeds the upper limit.

  • the number of senders that can be added in one sender group in a single POST request exceeds the upper limit.

  • the number of File Hashes that you can add for a particular File Hash List exceeds the upper limit.

  • the number of user domain entries that you can add for sender and receiver keys in a single IMP Users POST or PUT request exceeds the upper limit.

  • the number of user domain entries having 'ANY' that you can add for sender and receiver keys in a single IMP Users POST or PUT request exceeds the upper limit.

  • the number of characters allowed for one sender and receiver domain entry in a single IMP Users POST or PUT request exceeds the upper limit.

  • the size of the configuration sent or read exceeds the upper limit.

  • the number of addresses allowed in one Address List in a single POST request exceeds the upper limit.

  • the number of SMTP Call Ahead Profiles that you can add exceeds the upper limit.

  • the number of address tagging keys that you can add exceeds the upper limit.


<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>

Solution: See the Configuration APIs - Rate Limits section for information about the rate limits for Configuration APIs.

Error - Bad Gateway

You may receive the following error message when:

  • the number of URL Lists with maximum URLs exceeds the upper limit.

  • the number of sender groups that can added with the maximum number of senders exceeds the upper limit.

  • the number of File Hash Lists exceeds the upper limit.

  • the number of entries with each entry containing 4000 recipient addresses exceeds the upper limit.

  • the size of the configuration that you receive or save exceeds the upper limit.

  • the number of Address List entries exceeds the upper limit.


{
    "error": {
        "code": "502",
        "explanation": "502 = Bad Gateway"
    }

}

Solution: See the Configuration APIs - Rate Limits section for information about the rate limits for Configuration APIs.

Error - Failed to POST

You may receive the following error response when the number of Message Filters that you can add exceeds the upper limit.


{
    "error": {
        "code": "400",
        "explanation": "400 = An error occurred during processing: maximum work per expression/data limit exceeded."
    }

}

Solution: See the Configuration APIs - Rate Limits section for information about the rate limits for Configuration APIs.