{"record":{"id":"4c9f0b00883bbb21","repo":"apache/dolphinscheduler","slug":"can-not-find-valid-project-by-name-s","errorCode":null,"errorMessage":"Can not find valid project by name %s","messagePattern":"Can not find valid project by name (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java","lineNumber":559,"sourceCode":"        return result;\n    }\n\n    /**\n     * Get project, workflow, task code.\n     * Useful in Python API create dependent task which need workflow information.\n     *\n     * @param projectName  project name which workflow belongs to\n     * @param workflowName workflow name\n     * @param taskName     task name\n     */\n    public Map<String, Object> getDependentInfo(String projectName, String workflowName, String taskName) {\n        Map<String, Object> result = new HashMap<>();\n\n        Project project = projectDao.queryByName(projectName);\n        if (project == null) {\n            String msg = String.format(\"Can not find valid project by name %s\", projectName);\n            log.error(msg);\n            throw new IllegalArgumentException(msg);\n        }\n        long projectCode = project.getCode();\n        result.put(\"projectCode\", projectCode);\n\n        WorkflowDefinition workflowDefinition =\n                workflowDefinitionDao.queryByDefineName(projectCode, workflowName);\n        if (workflowDefinition == null) {\n            String msg = String.format(\"Can not find valid workflow by name %s\", workflowName);\n            log.error(msg);\n            throw new IllegalArgumentException(msg);\n        }\n        result.put(\"workflowDefinitionCode\", workflowDefinition.getCode());\n\n        if (taskName != null) {\n            TaskDefinition taskDefinition =\n                    taskDefinitionDao.queryByName(projectCode, workflowDefinition.getCode(), taskName);\n            result.put(\"taskDefinitionCode\", taskDefinition.getCode());\n        }","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java#L541-L577","documentation":"getDependentInfo resolves a project by name via projectDao.queryByName; a null result (no project with that name) throws IllegalArgumentException. Dependent task resolution needs the project code to find the referenced workflow/task.","triggerScenarios":"Calling getDependentInfo(projectName, workflowName, ...) with a project name that has no matching row in the project table.","commonSituations":"pydolphinscheduler dependent tasks pointing at a project in another instance; project deleted; project renamed; case-sensitivity/whitespace mismatch in the name.","solutions":["Verify the project name in the web UI Project list and use it exactly in the Python script","Create the project if it does not exist in this instance","Fix typos / trailing whitespace in projectName","If cross-instance, switch the Python script to the correct environment"],"exampleFix":"// before (Python)\ndependent = Dependent(project_name=\"DW\", workflow_name=\"daily_etl\")\n// after\ndependent = Dependent(project_name=\"data-warehouse\", workflow_name=\"daily_etl\")  # exact project name","handlingStrategy":"validation","validationCode":"Project project = projectDao.queryByName(projectName);\nif (project == null) {\n    throw new IllegalStateException(\"Project does not exist: \" + projectName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    pythonGateway.getDependentInfo(projectName, workflowName, taskName);\n} catch (IllegalArgumentException e) {\n    log.error(\"Project/workflow lookup failed: {}\", e.getMessage());\n}","preventionTips":["Copy project names exactly from the web UI","Create the referenced project before running dependent-task scripts","Trim whitespace when loading project names from config files"],"tags":["python-api","project","not-found"],"backgroundTag":"entity-not-found","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"}