[Bug] [Worker] File parameter transfer feature is broken
Search before asking
- [x] I had searched in the issues and found no similar issues.
What happened
File parameter transfer feature is completely broken in DolphinScheduler 3.4.1. The upstream task generates files with OUT type FILE parameters, but the downstream task cannot receive the files. The resourceItemMap={} in logs indicates that no files were downloaded to the downstream task.
After deep investigation, I found that commit 6f12d1ded9 ([Fix-17184] Fix varpool cannot use #17199) deleted the TaskFilesTransferUtils.java, which contains the critical file transfer logic:
uploadOutputFiles()- uploads output files to S3 (DATA_TRANSFER directory)downloadUpstreamFiles()- downloads upstream files from S3 to local
Without these functions, files remain only in the local task working directory and downstream tasks cannot access them.
What you expected to happen
The file parameter transfer should work as documented:
- Upstream task (ot) generates files and declares FILE type OUT parameters
- System automatically uploads files to S3 (DATA_TRANSFER directory)
- Downstream task (n2) declares FILE type IN parameters with reference ot.dir-data
- System automatically downloads files from S3 to n2's working directory before execution
- n2 can access the files locally
How to reproduce
- Create a workflow with two Shell tasks (ot -> n2)
- Configure ot task:
- rawScript:
mkdir -p data/test1 data/test2 && echo "test1 message" >> data/test1/text.txt && echo "test2 message" >> data/test2/text.txt && tree . - localParams:
dir-data(OUT, FILE, value=data)
- rawScript:
- Configure n2 task:
- rawScript:
tree . && cat input_dir/test1/text.txt && cat input_dir/test2/text.txt - localParams:
input_dir(IN, FILE, value=ot.dir-data)
- rawScript:
- Execute workflow
- Result: n2 fails with "No such file or directory"
Anything else
MinIO bucket verification (empty):
$ mc ls myminio/dolphinscheduler/
[2026-04-10 11:40:25 CST] 0B dolphinscheduler/
No DATA_TRANSFER directory - files were never uploaded.
ot task (upstream) logs:
Initialize shell task params {
"localParams" : [ {
"prop" : "dir-data",
"direct" : "OUT",
"type" : "FILE",
"value" : "data"
} ],
"varPool" : [ ],
...
}
Set taskVarPool: null successfully
n2 task (downstream) logs:
Download resources successfully: ResourceContext(resourceItemMap={})
Initialize shell task params {
"localParams" : [ {
"prop" : "input_dir",
"direct" : "IN",
"type" : "FILE",
"value" : "ot.dir-data"
} ],
...
}
cat: input_dir/test1/text.txt: No such file or directory
Version
3.4.1
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Parameter passing currently only supports data, not files.
Parameter passing currently only supports data, not files.
https://dolphinscheduler.apache.org/zh-cn/docs/3.4.1/guide/parameter/file-parameter But the official documentation shows that this feature is still available.
There may be some deviations, and this function is not implemented in the new version. I've reopened this issue.
Hi there! I've been looking into this issue and it seems like a critical regression.
The root cause is quite clear: commit 6f12d1ded9 deleted TaskFilesTransferUtils.java, which handled the core logic for uploadOutputFiles() and downloadUpstreamFiles(). Without this utility, the system has no way to move files from the upstream task's local directory to S3, and subsequently, the downstream task finds nothing to download, leading to the 'No such file or directory' error.
Reproduction Analysis:
- Upstream Task: Generates files $\rightarrow$ calls uploadOutputFiles() (Now missing) $\rightarrow$ Files stay local.
- S3 Bucket: Remains empty (as verified by your mc ls output).
- Downstream Task: Calls downloadUpstreamFiles() (Now missing) $\rightarrow$ esourceItemMap is empty $\rightarrow$ File access fails.
Proposed Fix: The TaskFilesTransferUtils.java needs to be restored or its logic reimplemented in the current architecture. If the deletion was intentional for a refactor, the corresponding logic for S3 transfer was accidentally omitted.
I'd recommend checking if the logic was moved to a different utility class or if this was a genuine accidental deletion during the arpool fix. This effectively breaks the fundamental 'FILE' parameter contract in 3.4.1.
Hi, I'd like to work on this issue.
Based on the discussion and the related commits, it's clear that this missing functionality was caused by the architecture evolution and the refactoring of varPool.
My plan:
- Restore the file transfer utility class.
- Call the utility class in
PhysicalTaskExecutor#initializeTaskContextto download upstream files. - Add a success hook in
PhysicalTaskExecutorso that output files are uploaded after the physical task succeeds. - In
CuringParamsServiceImpl#parseLocalParamsMap, map the input file parameter's value as the key to match the output file parameters in the workflowvarPool, so the correct file path can be retrieved fromTaskExecutionContext#prepareParamsMap.
Hi maintainers, I looked into this issue and the closed PR #18273. I agree that reviving the old TaskFilesTransferUtils / localParams approach as-is would repeat the design problem that was already discussed there.
Here is a possible new design direction that tries to follow the feedback from #18273:
Proposed direction
Restore FILE parameter transfer as an explicit task-level file transfer feature, not as an implicit localParams path convention.
1. Add explicit task-level transfer metadata
For tasks that want to produce or consume files, add a dedicated file-transfer configuration instead of relying on localParams values:
- output mappings:
outputKey, local source path, file/directory type, required/optional flag, and an explicituploadswitch; - input mappings: local target path, upstream task identifier, and upstream
outputKeyto download; - transfer should be disabled by default unless the task explicitly declares it.
This matches the previous maintainer suggestion of using a task-level switch plus an explicit parameter to select an upstream task output.
2. Keep localParams / varPool out of the storage-path contract
localParams / varPool can still expose logical values to the task, but they should not be the source of truth for resource storage paths. Instead, the runtime should build a small FileTransferContext in TaskExecutionContext, containing resolved input download entries and output upload entries.
This avoids coupling file movement to parameter names, file renames, or varPool merging rules.
3. Worker lifecycle
- Before task execution: validate input target paths are inside the task working directory, resolve upstream output metadata, and download files from resource storage.
- After successful task execution: validate declared output paths, upload files/directories to resource storage, then persist output metadata for downstream tasks.
- On failure: do not upload incomplete outputs, and make the error explicit if a required output is missing.
A deterministic storage path could be based on workflow instance / task instance / output key, for example under the existing DATA_TRANSFER namespace, but downstream tasks should consume it via metadata rather than by constructing the path themselves.
4. Compatibility and documentation
I would not try to silently support every old FILE-parameter behavior in the first PR. A safer first step could be:
- update the FILE parameter documentation to describe the new explicit mapping model;
- preserve the user-facing goal of upstream OUT file -> downstream IN file;
- avoid changing global parameter parsing rules;
- fail fast with a clear message if resource storage is not configured.
5. Test plan
A focused implementation should add tests for:
- upstream task success uploads declared output files;
- downstream task initialization downloads selected upstream output files;
- missing required output fails clearly;
- path traversal / absolute path targets are rejected;
- directory output handling if directories are supported;
- multiple upstream outputs do not collide.
Open questions before implementation:
- Is this explicit task-level transfer model acceptable for fixing #18166?
- Should the metadata be persisted in an existing task-instance field / varPool-compatible structure, or should it use a dedicated runtime field/table?
- Should the first PR implement only Shell/common task support, or should it introduce a task-plugin API that all task types can opt into later?
- Should the current documentation be corrected immediately to say the old FILE parameter behavior is not implemented, while the new design is being built?
If this direction looks reasonable, I can prepare a smaller implementation plan and tests before opening a PR.
I'd like to submit a documentation-only PR for this issue first.
Maintainer feedback indicates FILE parameter transfer is not implemented in the current version, while the docs (and demo) still describe it as working. That leads users to configure FILE IN/OUT params that cannot transfer files.
Proposed doc change (EN + ZH file-parameter.md):
- Add a clear notice that FILE transfer is currently unavailable pending redesign (link this issue)
- Keep the historical usage/example content marked as outdated / not applicable to current releases
A separate PR can restore the runtime feature once the redesign direction is agreed.
I would like to work on this bug. I have experience with Java file handling and parameter passing mechanisms. Will investigate and submit a PR.