All Products
Search
Document Center

Database Autonomy Service:DescribeErrorLogRecords

Last Updated:Jul 24, 2025

Queries the details of error logs for a specific database instance within a specified time range.

Operation description

This operation queries the error log details of an instance within a specified time range.

The following prerequisites must be met to use this operation:

  • Engine: RDS MySQL, RDS PostgreSQL, PolarDB for MySQL, PolarDB for PostgreSQL, PolarDB for PostgreSQL (compatible with Oracle), or ApsaraDB for MongoDB.

  • SDK version: Use the latest version of the Alibaba Cloud SDK.

  • Region: If you call the API via the SDK, set the region ID to cn-shanghai.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:DescribeErrorLogRecords

none

*All Resource

*

None

None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

pc-bp1u5mas9exx7****

NodeId

string

No

The node ID.

pi-bp16v3824rt73****

Role

string

No

The node role:

  • db

  • mongos

Note

This parameter is supported only for ApsaraDB for MongoDB instances.

db

StartTime

integer

Yes

The beginning of the time range to query. The value is a UNIX timestamp. Unit: milliseconds.

Important

This field is of the Long type. During serialization and deserialization, precision may be lost. Make sure that the value does not exceed 9007199254740991.

1731983066000

EndTime

integer

Yes

The end of the time range to query. The value is a UNIX timestamp. Unit: milliseconds.

Important

This field is of the Long type. During serialization and deserialization, precision may be lost. Make sure that the value does not exceed 9007199254740991.

1732069466000

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page. Maximum value: 100.

10

Filters

array

No

The filter conditions.

Note

Error log filtering is supported only for RDS MySQL, RDS PostgreSQL, PolarDB for MySQL, PolarDB for PostgreSQL, and PolarDB for PostgreSQL (compatible with Oracle).

object

No

The filter conditions.

Key

string

No

The filter parameter. Set the value to filters.

filters

Value

string

No

The content of the error log to filter.

deadlock

Response parameters

Parameter

Type

Description

Example

object

The returned data.

Code

integer

The returned status code.

200

Message

string

The returned message.

Note

If the request is successful, Successful is returned. If the request fails, error information such as an error code is returned.

Successful

RequestId

string

The unique request ID.

AAA17591-B48B-4D31-9CD6-9B9796B2****

Success

boolean

Indicates whether the request was successful:

  • true: The request was successful.

  • false: The request failed.

true

Data

object

The data details.

ItemsNumbers

integer

The total number of log details returned.

10

StartTime

string

The beginning of the time range to query. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2025-07-22T05:48:43Z

EndTime

string

The end of the time range to query. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2025-07-23T05:48:43Z

TotalRecords

integer

The total number of log details within the time range to query.

100

PageNumbers

integer

The page number of the current query.

1

MaxRecordsPerPage

integer

The maximum number of records displayed per page.

10

Logs

array

The log details.

object

The log details.

CreateTime

string

The time when the error log was generated. The value is a UNIX timestamp. Unit: milliseconds.

Important

For ApsaraDB for MongoDB instances, the time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

1731983067000

DBInstanceName

string

The node ID.

Note

This parameter is supported only for ApsaraDB for MongoDB instances.

d-bp128a003436****

Category

string

The log category. Valid values:

  • NETWORK: network connectivity logs.

  • ACCESS: access control logs.

  • -: common logs.

  • COMMAND: slow query log.

  • SHARDING: cluster logs.

  • STORAGE: storage engine logs.

  • CONNPOOL: connection pool logs.

  • ASIO: asynchronous I/O logs.

  • WRITE: slow update logs.

Note

This parameter is supported only for ApsaraDB for MongoDB instances.

NETWORK

ConnInfo

string

The connection information of the log.

Note

This parameter is supported only for ApsaraDB for MongoDB instances.

conn18xxxxxx

Content

string

The error log.

2025-07-15T15:14:27.175188+08:00 0 [Note] [MY-012468] [InnoDB] Transactions deadlock detected, dumping detailed information.

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "Successful",
  "RequestId": "AAA17591-B48B-4D31-9CD6-9B9796B2****",
  "Success": true,
  "Data": {
    "ItemsNumbers": 10,
    "StartTime": "2025-07-22T05:48:43Z",
    "EndTime": "2025-07-23T05:48:43Z",
    "TotalRecords": 100,
    "PageNumbers": 1,
    "MaxRecordsPerPage": 10,
    "Logs": [
      {
        "CreateTime": "1731983067000",
        "DBInstanceName": "d-bp128a003436****\n",
        "Category": "NETWORK",
        "ConnInfo": "conn18xxxxxx",
        "Content": "2025-07-15T15:14:27.175188+08:00 0 [Note] [MY-012468] [InnoDB] Transactions deadlock detected, dumping detailed information."
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400

InvalidParams

The request parameters are invalid.

403

NoPermission

You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.