{"record":{"id":"6adf1c35dfa99b88","repo":"apache/dolphinscheduler","slug":"10103","errorCode":"10103","errorMessage":"view task instance log error: {0}","messagePattern":"view task instance log error: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java","lineNumber":125,"sourceCode":"    QUERY_TASK_LIST_PAGING_ERROR(10082, \"query task list paging error\", \"分页查询任务列表错误\"),\n    QUERY_TASK_RECORD_LIST_PAGING_ERROR(10083, \"query task record list paging error\", \"分页查询任务记录错误\"),\n    CREATE_TENANT_ERROR(10084, \"create tenant error\", \"创建租户错误\"),\n    QUERY_TENANT_LIST_PAGING_ERROR(10085, \"query tenant list paging error\", \"分页查询租户列表错误\"),\n    QUERY_TENANT_LIST_ERROR(10086, \"query tenant list error\", \"查询租户列表错误\"),\n    UPDATE_TENANT_ERROR(10087, \"update tenant error\", \"更新租户错误\"),\n    DELETE_TENANT_BY_ID_ERROR(10088, \"delete tenant by id error\", \"删除租户错误\"),\n    VERIFY_OS_TENANT_CODE_ERROR(10089, \"verify os tenant code error\", \"操作系统租户验证错误\"),\n    CREATE_USER_ERROR(10090, \"create user error\", \"创建用户错误\"),\n    QUERY_USER_LIST_PAGING_ERROR(10091, \"query user list paging error\", \"分页查询用户列表错误\"),\n    UPDATE_USER_ERROR(10092, \"update user error\", \"更新用户错误\"),\n    DELETE_USER_BY_ID_ERROR(10093, \"delete user by id error\", \"删除用户错误\"),\n    GRANT_PROJECT_ERROR(10094, \"grant project error\", \"授权项目错误\"),\n    GRANT_RESOURCE_ERROR(10095, \"grant resource error\", \"授权资源错误\"),\n    GRANT_DATASOURCE_ERROR(10097, \"grant datasource error\", \"授权数据源错误\"),\n    GET_USER_INFO_ERROR(10098, \"get user info error\", \"获取用户信息错误\"),\n    USER_LIST_ERROR(10099, \"user list error\", \"查询用户列表错误\"),\n    VERIFY_USERNAME_ERROR(10100, \"verify username error\", \"用户名验证错误\"),\n    QUERY_TASK_INSTANCE_LOG_ERROR(10103, \"view task instance log error: {0}\", \"查询任务实例日志错误: {0}\"),\n    DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, \"download task instance log file error\", \"下载任务日志文件错误\"),\n    CREATE_WORKFLOW_DEFINITION_ERROR(10105, \"create workflow definition error\", \"创建工作流错误\"),\n    VERIFY_WORKFLOW_DEFINITION_NAME_UNIQUE_ERROR(10106, \"verify workflow definition name unique error\", \"工作流定义名称验证错误\"),\n    UPDATE_WORKFLOW_DEFINITION_ERROR(10107, \"update workflow definition error\", \"更新工作流定义错误\"),\n    RELEASE_WORKFLOW_DEFINITION_ERROR(10108, \"release workflow definition error\", \"上线工作流错误\"),\n    QUERY_DETAIL_OF_WORKFLOW_DEFINITION_ERROR(10109, \"query detail of workflow definition error\", \"查询工作流详细信息错误\"),\n    QUERY_WORKFLOW_DEFINITION_LIST(10110, \"query workflow definition list\", \"查询工作流列表错误\"),\n    ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR(10111, \"encapsulation treeview structure error\", \"查询工作流树形图数据错误\"),\n    GET_TASKS_LIST_BY_WORKFLOW_DEFINITION_CODE_ERROR(10112, \"get tasks list by workflow definition code error\",\n            \"查询工作流定义节点信息错误\"),\n    QUERY_WORKFLOW_INSTANCE_LIST_PAGING_ERROR(10113, \"query workflow instance list paging error\", \"分页查询工作流实例列表错误\"),\n    QUERY_TASK_LIST_BY_WORKFLOW_INSTANCE_ID_ERROR(10114, \"query task list by workflow instance id error\", \"查询任务实例列表错误\"),\n    UPDATE_WORKFLOW_INSTANCE_ERROR(10115, \"update workflow instance error\", \"更新工作流实例错误\"),\n    QUERY_WORKFLOW_INSTANCE_BY_ID_ERROR(10116, \"query workflow instance by id error\", \"查询工作流实例错误\"),\n    DELETE_WORKFLOW_INSTANCE_BY_ID_ERROR(10117, \"delete workflow instance by id error\", \"删除工作流实例错误\"),\n    QUERY_SUB_WORKFLOW_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR(10118,\n            \"query sub workflow instance detail info by task id error\", \"查询子流程任务实例错误\"),\n    QUERY_PARENT_WORKFLOW_INSTANCE_DETAIL_INFO_BY_SUB_WORKFLOW_INSTANCE_ID_ERROR(10119,","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java#L107-L143","documentation":"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}'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Wait until the task instance has a non-empty host/logPath (status beyond SUBMITTED_SUCCESS) and retry viewing the log","Check that the worker that ran the task is up and reachable from the api-server; verify registry entries and worker ports","Confirm the log file still exists at taskInstance.logPath on the worker host; if rotated/deleted, restore from backup or accept the loss","Check api-server logs for the wrapped exception message in '{0}' to distinguish empty-logPath vs RPC failure","If this happens constantly, verify all nodes share the same registry/zookeeper configuration and time-sync"],"exampleFix":"// before: viewing log right after submit fails with empty logPath\nTaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId);\nString log = loggerService.queryLog(taskInstance, skip, limit); // throws QUERY_TASK_INSTANCE_LOG_ERROR\n// after: guard on dispatch state first\nTaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId);\nif (StringUtils.isBlank(taskInstance.getLogPath()) || taskInstance.getState().isFinished() == false && taskInstance.getHost() == null) {\n    // task not dispatched yet; poll or return an empty log instead\n    return \"log not available yet\";\n}\nString log = loggerService.queryLog(taskInstance, skip, limit);","handlingStrategy":"try-catch","validationCode":"// check dispatch state before calling the log API\nTaskInstance ti = processService.findTaskInstanceById(taskInstanceId);\nif (ti == null || StringUtils.isBlank(ti.getLogPath())) {\n    throw new IllegalStateException(\"task instance \" + taskInstanceId + \" not dispatched yet, log unavailable\");\n}","typeGuard":"// Java: narrow/validate a task instance is viewable\nstatic boolean isLogViewable(TaskInstance ti) {\n    return ti != null && StringUtils.isNotBlank(ti.getLogPath()) && StringUtils.isNotBlank(ti.getHost());\n}","tryCatchPattern":"try {\n    String log = loggerService.queryLog(taskInstance, skipLineNum, limit);\n} catch (ServiceException e) {\n    if (e.getCode() == 10103) {\n        // empty logPath or RPC failure: poll/retry or show 'log unavailable'\n        log.warn(\"task log not available: {}\", e.getMessage());\n    } else {\n        throw e;\n    }\n}","preventionTips":["Only query logs for task instances past SUBMITTED state (dispatched with host and logPath set)","Poll the task instance status before fetching its log in automation/scripts","Keep workers reachable from api-server and monitor registry health","Alert on this status code in api-server logs to catch worker log-dir disk issues early"],"tags":["api","logging","task-instance","rpc"],"backgroundTag":"file-read-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}