apache/dolphinscheduler · error

10103

10103

Error message

view task instance log error: {0}

What it means

QUERY_TASK_INSTANCE_LOG_ERROR (10103) is thrown by the API server's LoggerService when it cannot fetch the log of a running/finished task instance. The private queryLog path in LoggerServiceImpl.java:182-208 throws it in two cases: (1) the task instance's logPath is blank, which means the task was never dispatched to a worker, or (2) the LogClient RPC to the worker/master hosting the log file failed. The controller wraps log-viewing endpoints in @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR), so any underlying exception is surfaced with this status and the original message interpolated into '{0}'.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java:125

    QUERY_TASK_LIST_PAGING_ERROR(10082, "query task list paging error", "分页查询任务列表错误"),
    QUERY_TASK_RECORD_LIST_PAGING_ERROR(10083, "query task record list paging error", "分页查询任务记录错误"),
    CREATE_TENANT_ERROR(10084, "create tenant error", "创建租户错误"),
    QUERY_TENANT_LIST_PAGING_ERROR(10085, "query tenant list paging error", "分页查询租户列表错误"),
    QUERY_TENANT_LIST_ERROR(10086, "query tenant list error", "查询租户列表错误"),
    UPDATE_TENANT_ERROR(10087, "update tenant error", "更新租户错误"),
    DELETE_TENANT_BY_ID_ERROR(10088, "delete tenant by id error", "删除租户错误"),
    VERIFY_OS_TENANT_CODE_ERROR(10089, "verify os tenant code error", "操作系统租户验证错误"),
    CREATE_USER_ERROR(10090, "create user error", "创建用户错误"),
    QUERY_USER_LIST_PAGING_ERROR(10091, "query user list paging error", "分页查询用户列表错误"),
    UPDATE_USER_ERROR(10092, "update user error", "更新用户错误"),
    DELETE_USER_BY_ID_ERROR(10093, "delete user by id error", "删除用户错误"),
    GRANT_PROJECT_ERROR(10094, "grant project error", "授权项目错误"),
    GRANT_RESOURCE_ERROR(10095, "grant resource error", "授权资源错误"),
    GRANT_DATASOURCE_ERROR(10097, "grant datasource error", "授权数据源错误"),
    GET_USER_INFO_ERROR(10098, "get user info error", "获取用户信息错误"),
    USER_LIST_ERROR(10099, "user list error", "查询用户列表错误"),
    VERIFY_USERNAME_ERROR(10100, "verify username error", "用户名验证错误"),
    QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error: {0}", "查询任务实例日志错误: {0}"),
    DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"),
    CREATE_WORKFLOW_DEFINITION_ERROR(10105, "create workflow definition error", "创建工作流错误"),
    VERIFY_WORKFLOW_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify workflow definition name unique error", "工作流定义名称验证错误"),
    UPDATE_WORKFLOW_DEFINITION_ERROR(10107, "update workflow definition error", "更新工作流定义错误"),
    RELEASE_WORKFLOW_DEFINITION_ERROR(10108, "release workflow definition error", "上线工作流错误"),
    QUERY_DETAIL_OF_WORKFLOW_DEFINITION_ERROR(10109, "query detail of workflow definition error", "查询工作流详细信息错误"),
    QUERY_WORKFLOW_DEFINITION_LIST(10110, "query workflow definition list", "查询工作流列表错误"),
    ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR(10111, "encapsulation treeview structure error", "查询工作流树形图数据错误"),
    GET_TASKS_LIST_BY_WORKFLOW_DEFINITION_CODE_ERROR(10112, "get tasks list by workflow definition code error",
            "查询工作流定义节点信息错误"),
    QUERY_WORKFLOW_INSTANCE_LIST_PAGING_ERROR(10113, "query workflow instance list paging error", "分页查询工作流实例列表错误"),
    QUERY_TASK_LIST_BY_WORKFLOW_INSTANCE_ID_ERROR(10114, "query task list by workflow instance id error", "查询任务实例列表错误"),
    UPDATE_WORKFLOW_INSTANCE_ERROR(10115, "update workflow instance error", "更新工作流实例错误"),
    QUERY_WORKFLOW_INSTANCE_BY_ID_ERROR(10116, "query workflow instance by id error", "查询工作流实例错误"),
    DELETE_WORKFLOW_INSTANCE_BY_ID_ERROR(10117, "delete workflow instance by id error", "删除工作流实例错误"),
    QUERY_SUB_WORKFLOW_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR(10118,
            "query sub workflow instance detail info by task id error", "查询子流程任务实例错误"),
    QUERY_PARENT_WORKFLOW_INSTANCE_DETAIL_INFO_BY_SUB_WORKFLOW_INSTANCE_ID_ERROR(10119,

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Wait until the task instance has a non-empty host/logPath (status beyond SUBMITTED_SUCCESS) and retry viewing the log
  2. Check that the worker that ran the task is up and reachable from the api-server; verify registry entries and worker ports
  3. Confirm the log file still exists at taskInstance.logPath on the worker host; if rotated/deleted, restore from backup or accept the loss
  4. Check api-server logs for the wrapped exception message in '{0}' to distinguish empty-logPath vs RPC failure
  5. If this happens constantly, verify all nodes share the same registry/zookeeper configuration and time-sync

Example fix

// before: viewing log right after submit fails with empty logPath
TaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId);
String log = loggerService.queryLog(taskInstance, skip, limit); // throws QUERY_TASK_INSTANCE_LOG_ERROR
// after: guard on dispatch state first
TaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId);
if (StringUtils.isBlank(taskInstance.getLogPath()) || taskInstance.getState().isFinished() == false && taskInstance.getHost() == null) {
    // task not dispatched yet; poll or return an empty log instead
    return "log not available yet";
}
String log = loggerService.queryLog(taskInstance, skip, limit);
Defensive patterns

Strategy: try-catch

Validate before calling

// check dispatch state before calling the log API
TaskInstance ti = processService.findTaskInstanceById(taskInstanceId);
if (ti == null || StringUtils.isBlank(ti.getLogPath())) {
    throw new IllegalStateException("task instance " + taskInstanceId + " not dispatched yet, log unavailable");
}

Type guard

// Java: narrow/validate a task instance is viewable
static boolean isLogViewable(TaskInstance ti) {
    return ti != null && StringUtils.isNotBlank(ti.getLogPath()) && StringUtils.isNotBlank(ti.getHost());
}

Try / catch

try {
    String log = loggerService.queryLog(taskInstance, skipLineNum, limit);
} catch (ServiceException e) {
    if (e.getCode() == 10103) {
        // empty logPath or RPC failure: poll/retry or show 'log unavailable'
        log.warn("task log not available: {}", e.getMessage());
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling GET /dolphinscheduler/log/detail (or the UI 'view log' action) where taskInstance.logPath is empty because the task instance has not been dispatched yet; the worker that holds the log file is down or unreachable via RPC; the log file was deleted/rotated on the worker; network partition between api-server and worker log client.

Common situations: Clicking 'View Log' immediately after submitting a workflow before the master dispatches the task; worker node restarted or decommissioned after the task ran; cluster deployed behind a firewall blocking the log RPC port; stale task instance rows left from an upgraded/migrated cluster where log paths no longer exist.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/6adf1c35dfa99b88. Report an issue: GitHub.