{"record":{"id":"00c613f5d1d4053b","repo":"apache/dolphinscheduler","slug":"cannot-find-the-task-instance-log-base-path-pleas","errorCode":null,"errorMessage":"Cannot find the task instance log base path, please check your logback.xml file","messagePattern":"Cannot find the task instance log base path, please check your logback\\.xml file","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/LogUtils.java","lineNumber":115,"sourceCode":"\n    /**\n     * todo: Remove the submitTime parameter?\n     * The task instance log full path, the path is like:{log.base}/{taskSubmitTime}/{workflowDefinitionCode}/{workflowDefinitionVersion}/{}workflowInstance}/{taskInstance}.log\n     *\n     * @param taskFirstSubmitTime       task first submit time\n     * @param workflowDefinitionCode    workflow definition code\n     * @param workflowDefinitionVersion workflow definition version\n     * @param workflowInstanceId        workflow instance id\n     * @param taskInstanceId            task instance id.\n     * @return task instance log full path.\n     */\n    public static String getTaskInstanceLogFullPath(Date taskFirstSubmitTime,\n                                                    Long workflowDefinitionCode,\n                                                    int workflowDefinitionVersion,\n                                                    int workflowInstanceId,\n                                                    int taskInstanceId) {\n        if (TASK_INSTANCE_LOG_BASE_PATH == null) {\n            throw new IllegalArgumentException(\n                    \"Cannot find the task instance log base path, please check your logback.xml file\");\n        }\n        final String taskLogFileName = Paths.get(\n                String.valueOf(workflowDefinitionCode),\n                String.valueOf(workflowDefinitionVersion),\n                String.valueOf(workflowInstanceId),\n                String.format(\"%s.log\", taskInstanceId)).toString();\n        return TASK_INSTANCE_LOG_BASE_PATH\n                .resolve(DateUtils.format(taskFirstSubmitTime, DateConstants.YYYYMMDD, null))\n                .resolve(taskLogFileName)\n                .toString();\n    }\n\n    /**\n     * Get task instance log base absolute path, this is defined in logback.xml\n     *\n     * @return\n     */","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/LogUtils.java#L97-L133","documentation":"LogUtils.getTaskInstanceLogFullPath() reads TASK_INSTANCE_LOG_BASE_PATH, which is populated from the logback.xml appender path. If it is null, the logback.xml on the worker does not define the expected task-instance log base path, so an IllegalArgumentException is thrown instead of returning a bogus path.","triggerScenarios":"Calling getTaskInstanceLogFullPath(...) on a worker whose logback.xml lacks the task log appender (or uses a modified appender whose file path no longer matches what LogUtils parses), so the static TASK_INSTANCE_LOG_BASE_PATH is never set.","commonSituations":"Custom/overwritten logback.xml deployed to workers; upgrading DolphinScheduler with an old logback.xml; mixing server and worker distributions; manually editing logback.xml and renaming the TASK_LOG_FILE appender's path property.","solutions":["Restore/merge the stock logback.xml from the matching distribution version onto each worker.","Ensure the task log appender and its <file>/<fileNamePattern> path are defined exactly as the version expects.","Restart workers after fixing logback.xml so the static base path is re-read.","Verify with a small deployment that task logs appear under the expected base path directory."],"exampleFix":"// before (logback.xml)\n<appender name=\"TASKLOGFILE\" class=\"...\"> <!-- removed path -->\n// after (logback.xml)\n<appender name=\"TASKLOGFILE\" class=\"org.apache.dolphinscheduler.plugin.task.api.log.TaskLogAppender\">\n  <file>${log.base}/task-instance/</file>\n  ...\n</appender>","handlingStrategy":"try-catch","validationCode":"// startup check on worker\nif (LogUtils.getTaskInstanceLogFullPath(new Date(), 0L, 1, 1, 1) == null) {\n    throw new IllegalStateException(\"logback.xml task log base path not configured\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    path = LogUtils.getTaskInstanceLogFullPath(submitTime, code, ver, wfId, taskId);\n} catch (IllegalArgumentException e) {\n    log.error(\"worker logback.xml missing task log appender\", e);\n    throw e;\n}","preventionTips":["Deploy the stock logback.xml bundled with your DolphinScheduler version to every worker.","Diff custom logback.xml against upstream when upgrading.","Add a worker startup smoke test that resolves a sample log path."],"tags":["logging","logback","configuration"],"backgroundTag":"missing-config-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}