Help Center/ CodeArts Build/ API Reference/ APIs/ LogManager/ Obtaining Error Logs When a Task Fails
Updated on 2025-08-21 GMT+08:00

Obtaining Error Logs When a Task Fails

Function

This API is used to obtain error logs when a task fails.

Calling Method

For details, see Calling APIs.

URI

GET /v1/log/{job_id}/{build_no}/analysis

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Definition

Enter the ID of the build task whose history you want to query. To obtain this ID, open the build task details page in your browser, and copy the 32-character string, which includes both digits and letters, at the end of the URL.

Constraints

N/A.

Range

The value is 32 characters long. Only letters and digits are allowed.

Default Value

N/A.

build_no

Yes

Integer

Definition

The build number tracks each run of the build task. This parameter starts at 1, indicating the first build. It increments by 1 for every subsequent run.

Constraints

The value is a positive integer.

Range

Use only numbers that are 1 or greater.

Default Value

1

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Details:

Number of items displayed on each page. The value of limit is no more than 100.

Constraints:

N/A

Value Range:

Only numbers that are 100 or less can be used.

offset

No

Integer

Definition

The index of the page to start the query from.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

result object

Result.

error

String

Returned error message.

status

String

Returned status information.

Table 4 result

Parameter

Type

Description

jobName

String

Definition

Build task name.

Constraints

N/A.

Range

The value consists of letters and other characters.

error_nodes

Array of AnalysisError objects

Definition

A collection of task error messages.

Constraints

N/A.

Range

N/A.

Table 5 AnalysisError

Parameter

Type

Description

node_id

String

Definition

Node ID.

Constraints

N/A.

Range

N/A.

step

String

Definition

Action.

Constraints

N/A.

Range

N/A.

analyzed_success

Boolean

Definition

A flag that indicates whether the analysis is successful.

Constraints

N/A.

Range

true: Success.

false: Failure.

error_info

error_info object

Definition

Error message.

Constraints

N/A.

Range

N/A.

Table 6 error_info

Parameter

Type

Description

error_code

String

Definition

Error code.

Constraints

N/A.

Range

N/A.

error_message

String

Definition

Error logs.

Constraints

N/A.

Range

N/A.

faq

String

Definition

Common issues.

Constraints

N/A.

Range

N/A.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET https://{endpoint}/v1/log/{job_id}/{build_no}/analysis

Example Responses

Status code: 200

OK

{
  "result" : {
    "jobName" : "j_JbgkmAfe",
    "error_nodes" : [ {
      "step" : "releasemanArtifactsUploader",
      "node_id" : 114,
      "analyzed_success" : true,
      "error_info" : {
        "faq" : null,
        "error_code" : "DEV.CB.0220021",
        "error_message" : "DEV.CB.0220021: File not found. Possible cause: Incorrect file path (build/*)"
      }
    }, {
      "step" : "releasemanArtifactsUploader",
      "node_id" : 82,
      "analyzed_success" : true,
      "error_info" : {
        "faq" : null,
        "error_code" : "DEV.CB.0210032",
        "error_message" : "File verification failed."
      }
    } ]
  },
  "error" : null,
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.